Firebase-ios-sdk: Crash on FIRUser parseIdToken:error:

Created on 2 May 2018  路  10Comments  路  Source: firebase/firebase-ios-sdk

[READ] Step 1: Are you in the right place?

I hope so.

[REQUIRED] Step 2: Describe your environment

  • Xcode version: Version 9.3 (9E145)
  • Firebase SDK version: 4.13.0
  • Firebase Component: Auth
  • Component version:
  • Firebase/Auth (4.13.0):

    • Firebase/Core

    • FirebaseAuth (= 4.6.1)

[REQUIRED] Step 3: Describe the problem

Crash on FIRUser parseIdToken:error:

Thread 1 Crashed:: Dispatch queue: com.google.firebase.auth.serialTaskQueue
0 com.okmno.setteo.beta 0x00000001089ee290 -[FIRUser parseIDToken:error:] + 801
1 com.okmno.setteo.beta 0x00000001089edd65 __53-[FIRUser getIDTokenResultForcingRefresh:completion:]_block_invoke_2 + 82
2 com.okmno.setteo.beta 0x00000001089ee439 __51-[FIRUser internalGetTokenForcingRefresh:callback:]_block_invoke + 183
3 com.okmno.setteo.beta 0x00000001089e8dbf __65-[FIRSecureTokenService fetchAccessTokenForcingRefresh:callback:]_block_invoke + 93
4 com.okmno.setteo.beta 0x00000001089e6646 __38-[FIRAuthSerialTaskQueue enqueueTask:]_block_invoke + 114
5 libdispatch.dylib 0x000000011303e73b _dispatch_call_block_and_release + 12
6 libdispatch.dylib 0x000000011303f779 _dispatch_client_callout + 8
7 libdispatch.dylib 0x00000001130471b2 _dispatch_queue_serial_drain + 735
8 libdispatch.dylib 0x00000001130479af _dispatch_queue_invoke + 321
9 libdispatch.dylib 0x0000000113046ffd _dispatch_queue_serial_drain + 298
10 libdispatch.dylib 0x00000001130479af _dispatch_queue_invoke + 321
11 libdispatch.dylib 0x000000011304416a _dispatch_queue_override_invoke + 477
12 libdispatch.dylib 0x0000000113049cf8 _dispatch_root_queue_drain + 473
13 libdispatch.dylib 0x0000000113049ac1 _dispatch_worker_thread3 + 119
14 libsystem_pthread.dylib 0x0000000113562169 _pthread_wqthread + 1387
15 libsystem_pthread.dylib 0x0000000113561be9 start_wqthread + 13

Steps to reproduce:

Upgraded pods to 4.13.0.

Debugged to the point of extracting the base64 payload/JSON that causes the crash.
(Crash, base64, JSON available via private message).

Relevant Code:

auth

Most helpful comment

Does the workaround described in #1140 and #1197 help?

Set the Firebase version back to 4.11.0 by adding the following to the Podfile:

pod 'Firebase/Core', '4.11.0'
pod 'FirebaseSwizzlingUtilities', '1.0.0'

You could be running into this base64 encoding bug that hasn't been released yet.

All 10 comments

Also this was on $eax:

Error Domain=FIRAuthErrorDomain Code=17999 "An internal error has occurred, print and inspect the error details for more information." UserInfo={error_name=ERROR_INTERNAL_ERROR, NSLocalizedDescription=An internal error has occurred, print and inspect the error details for more information., NSUnderlyingError=0x608000640ff0 {Error Domain=FIRAuthInternalErrorDomain Code=4 "(null)" UserInfo={FIRAuthErrorUserInfoDeserializedResponseKey=####BASE64 DATA####}}}

Looks related to #1140. @protocol86 ?

I'm using this indirectly through react-native-firebase and I'm facing the same issue. My upgrade was a pretty big leap, but I can't seem to get past this issue.

@ramonpoca when you say "removing the user" do you mean in firebase? Like removing the actual user? If so, I think I'll need to find a better solution because I can't just delete all my users.

Yes, I could because I was on testing. The problem is in the "image" URL that Firebase returns that the SDK cannot parse (funnily enough is a firebase URL...).
You could fix it by removing the image (avatar) URL for the affected user(s), and use a third party service for them.
Hope this helps. :)

I'm already using a different service for the images. This is just auth, so still not a viable solution I think. I'm willing to help, just point me in the right direction. :)

If you are on XCode, I'd trace the request up to the crash point and then display one of $r13, $r14 or $r15 CPU registers. Usually one of them points to either the offending string, the base64-encoded json or similar. I decoded mine, it was correct JSON but someone mentioned that the URL encoding for complex URLs was what causing the crash.

Hi,

I have the same crash than @ramonpoca with some Firebase id tokens relative to users which always have a profile picture but all users with profile pictures are not impacted.

I guess it could be related to image color mode or something like that...

Does the workaround described in #1140 and #1197 help?

Set the Firebase version back to 4.11.0 by adding the following to the Podfile:

pod 'Firebase/Core', '4.11.0'
pod 'FirebaseSwizzlingUtilities', '1.0.0'

You could be running into this base64 encoding bug that hasn't been released yet.

Closing for now. Please open a new issue if you see the problem with 5.0.0 or the workaround above

Was this page helpful?
0 / 5 - 0 ratings