Skip to content

[firebase_auth]: internal-error increases with phone number authentication on iOS since 3/14 #12541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
FujiKinaga opened this issue Mar 27, 2024 · 6 comments
Closed
1 task done
Labels
Needs Attention This issue needs maintainer attention. platform: ios Issues / PRs which are specifically for iOS. plugin: auth resolution: user This was a user issue, e.g. invalid configuration or code. type: bug Something isn't working

Comments

@FujiKinaga
Copy link

FujiKinaga commented Mar 27, 2024

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Auth

Which platforms are affected?

iOS

Description

FirebaseAuthException: [firebase_auth/internal-error] An internal error has occurred, print and inspect the error details for more information.
  File "verify_phone_number.dart", line 58, in VerifyPhoneNumberUseCase.call.handleVerificationFailed
  File "method_channel_firebase_auth.dart", line 620, in MethodChannelFirebaseAuth.verifyPhoneNumber.<fn>
  File "zone.dart", line 1594, in _RootZone.runUnaryGuarded
  File "stream_impl.dart", line 339, in _BufferingStreamSubscription._sendData
  File "stream_impl.dart", line 271, in _BufferingStreamSubscription._add
  File "stream_pipe.dart", line 123, in _ForwardingStreamSubscription._add
  File "stream_pipe.dart", line 253, in _HandleErrorStream._handleData
  File "stream_pipe.dart", line 153, in _ForwardingStreamSubscription._handleData
  File "zone.dart", line 1594, in _RootZone.runUnaryGuarded
  File "stream_impl.dart", line 339, in _BufferingStreamSubscription._sendData
  File "stream_impl.dart", line 515, in _DelayedData.perform
  File "stream_impl.dart", line 620, in _PendingEvents.handleNext
  File "stream_impl.dart", line 591, in _PendingEvents.schedule.<fn>
  File "schedule_microtask.dart", line 40, in _microtaskLoop
  File "schedule_microtask.dart", line 49, in _startMicrotaskLoop
  • Our service has seen a significant increase in the frequency of errors since 3/13~3/14.
  • These errors occur when a reCaptcha is displayed during phone number authentication.
  • Cannot be reproduced on Web or Android, only occurs on iOS

Sentry Errors

Reproducing the issue

  1. call FirebaseAuth#verifyPhoneNumber by iOS devices.
  2. encountering the reCaptcha.
  3. complete the reCaptcha.
  4. The reCaptcha will either loop or retry and start again.

supplements

Firebase Core version

2.19.0

Flutter Version

3.13.9

Flutter dependencies

Expand Flutter dependencies snippet
  firebase_core: 2.19.0
  firebase_auth: 4.11.1
  firebase_messaging: 14.7.1

Additional context and comments

firebase/firebase-js-sdk#8056 was made at the same time on the day the problem occurred🧐

Movie

sms_bug_demo.mp4

@FujiKinaga FujiKinaga added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Mar 27, 2024
@FujiKinaga FujiKinaga changed the title [firebase_auth]: Internal-error increases with phone number authentication on iOS since 3/14 [firebase_auth]: internal-error increases with phone number authentication on iOS since 3/14 Mar 27, 2024
@Lyokone Lyokone added plugin: auth platform: ios Issues / PRs which are specifically for iOS. and removed Needs Attention This issue needs maintainer attention. labels Mar 29, 2024
@Lyokone
Copy link
Contributor

Lyokone commented Mar 29, 2024

Hello @FujiKinaga, I'm unable to reproduce the issue on my end 🤔 Have you tried to add App Check to your iOS app to see if the verification works?

@Lyokone Lyokone added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Mar 29, 2024
@FujiKinaga
Copy link
Author

@Lyokone
Thanks for your response.

Have you tried to add App Check to your iOS app to see if the verification works?

Is 'App Check' from Firebase? or App Attest?
in any event, We haven't tried it yet...

I am struggling to investigate because it does not reproduce all the time, but only when the ReCaptcha is passed, and once it happens, I have to wait for several hours until the restriction is removed.😭

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Mar 29, 2024
@FujiKinaga
Copy link
Author

@Lyokone
Is it unlikely that this bug is caused by firebase/firebase-js-sdk#8056 ? Because they appear to be occurring at the same time.

@Lyokone
Copy link
Contributor

Lyokone commented Apr 3, 2024

It's unlikely, since it's for the JS SDK, I don't see any recent changes in Auth in the iOS release note: https://firebase.google.com/support/release-notes/ios

@Lyokone Lyokone added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Apr 3, 2024
@FujiKinaga
Copy link
Author

FujiKinaga commented Apr 4, 2024

@Lyokone
The new findings indicate that the root cause seems to be 503 or 400 status code in the following APIs🧐

POST https://www.googleapis.com/identitytoolkit/v3/relyingparty/sendVerificationCode?key=[key]

other Error messages

  • [firebase_auth/internal-error] An internal error has occurred, print and inspect the error details for more information.

@google-oss-bot google-oss-bot removed the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Apr 4, 2024
@FujiKinaga
Copy link
Author

I would like to close this Issue as I have been able to greatly reduce the occurrence of errors by using APNs.

@TarekkMA TarekkMA added the resolution: user This was a user issue, e.g. invalid configuration or code. label May 2, 2024
@firebase firebase locked and limited conversation to collaborators May 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs Attention This issue needs maintainer attention. platform: ios Issues / PRs which are specifically for iOS. plugin: auth resolution: user This was a user issue, e.g. invalid configuration or code. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants