Skip to content
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

Firestore crashes on iOS when Airplane mode is on with FirestoreInternalError #872

Closed
mojikashani opened this issue Nov 22, 2020 · 8 comments

Comments

@mojikashani
Copy link

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2020.1.12f1
  • Firebase Unity SDK version: 6.16.1
  • Source you installed the SDK: Unity Package Manager
  • Problematic Firebase Component: Firestore
  • Other Firebase Components in use: Auth, Crashlytics, Cloud Messaging, firebase analytics
  • Additional SDKs you are using: Facebook, AdMob
  • Platform you are using the Unity editor on: Mac
  • Platform you are targeting: iOS, Android (issue is only happening in iOS)
  • Scripting Runtime: IL2CPP

[REQUIRED] Please describe the issue here:

App crashes occasionally on iOS when app in in airplane mode

2020-11-22 12:50:43.457557+1100 ABC[50296:3980446] FCM: Loading UIApplication FIRFCM category
CrashReporter: initialized
2020-11-22 12:50:43.718964+1100 ABC[50296:3980446] Built from '2020.1/staging' branch, Version '2020.1.12f1 (55b56f0a86e3)', Build type 'Release', Scripting Backend 'il2cpp'
2020-11-22 12:50:43.729313+1100 ABC[50296:3980446] Setting up iOS 10 message delegate.
-> applicationDidFinishLaunching()
-> applicationDidBecomeActive()
2020-11-22 12:50:43.972134+1100 ABC[50296:3980651] 6.32.0 - [I-ACS031025] Analytics screen reporting is enabled. Call +[FIRAnalytics logEventWithName:FIREventScreenView parameters:] to log a screen view event. To disable automatic screen reporting, set the flag FirebaseAutomaticScreenReportingEnabled to NO (boolean) in the Info.plist
2020-11-22 12:50:44.026055+1100 ABC[50296:3980656] Connection 1: received failure notification
GfxDevice: creating device client; threaded=1
2020-11-22 12:50:44.026597+1100 ABC[50296:3980656] Connection 1: failed to connect 1:50, reason -1
2020-11-22 12:50:44.026897+1100 ABC[50296:3980656] Connection 1: encountered error(1:50)
Initializing Metal device caps: Apple A13 GPU
Initialize engine version: 2020.1.12f1 (55b56f0a86e3)
2020-11-22 12:50:44.030706+1100 ABC[50296:3980656] Connection 2: received failure notification
2020-11-22 12:50:44.030740+1100 ABC[50296:3980656] Connection 2: failed to connect 1:50, reason -1
2020-11-22 12:50:44.030755+1100 ABC[50296:3980656] Connection 2: encountered error(1:50)
2020-11-22 12:50:44.033369+1100 ABC[50296:3980656] Connection 3: received failure notification
2020-11-22 12:50:44.033501+1100 ABC[50296:3980656] Connection 3: failed to connect 1:50, reason -1
2020-11-22 12:50:44.038707+1100 ABC[50296:3980656] Connection 3: encountered error(1:50)
2020-11-22 12:50:44.087381+1100 ABC[50296:3980654] Error getting network monitor context Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"
2020-11-22 12:50:44.087771+1100 ABC[50296:3980654] Task <03B02BE5-7A47-4C07-A121-FE8756663702>.<1> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
2020-11-22 12:50:44.087806+1100 ABC[50296:3980654] Task <2842B228-3CA5-4F80-836B-B15473A08669>.<1> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
2020-11-22 12:50:44.087826+1100 ABC[50296:3980654] Task <2EF39D38-A420-43D7-8A38-F676D5FD3129>.<1> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
2020-11-22 12:50:44.204946+1100 ABC[50296:3980656] Task <2842B228-3CA5-4F80-836B-B15473A08669>.<1> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283acb1b0 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <2842B228-3CA5-4F80-836B-B15473A08669>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <2842B228-3CA5-4F80-836B-B15473A08669>.<1>"
), NSLocalizedDescription=The internet connection appears to be offline., NSErrorFailingURLStringKey=https://graph.facebook.com/v8.0, NSErrorFailingURLKey=https://graph.facebook.com/v8.0, _kCFStreamErrorDomainKey=1}
2020-11-22 12:50:44.204947+1100 ABC[50296:3980653] Task <03B02BE5-7A47-4C07-A121-FE8756663702>.<1> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283b94420 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <03B02BE5-7A47-4C07-A121-FE8756663702>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <03B02BE5-7A47-4C07-A121-FE8756663702>.<1>"
), NSLocalizedDescription=The internet connection appears to be offline., NSErrorFailingURLStringKey=https://graph.facebook.com/v8.0, NSErrorFailingURLKey=https://graph.facebook.com/v8.0, _kCFStreamErrorDomainKey=1}
2020-11-22 12:50:44.205045+1100 ABC[50296:3980654] Task <2EF39D38-A420-43D7-8A38-F676D5FD3129>.<1> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283ad5950 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <2EF39D38-A420-43D7-8A38-F676D5FD3129>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <2EF39D38-A420-43D7-8A38-F676D5FD3129>.<1>"
), NSLocalizedDescription=The internet connection appears to be offline., NSErrorFailingURLStringKey=https://graph.facebook.com/v8.0, NSErrorFailingURLKey=https://graph.facebook.com/v8.0, _kCFStreamErrorDomainKey=1}
CrashReporter: No pending report exists at /var/mobile/Containers/Data/Application/9B84C874-472F-4CCE-A2FD-A8ABDC5F4CD1/Library/Caches/CrashReports/crash-pending.plcrash
2020-11-22 12:50:44.547058+1100 ABC[50296:3980651] Connection 4: received failure notification
2020-11-22 12:50:44.547163+1100 ABC[50296:3980651] Connection 4: failed to connect 1:50, reason -1
2020-11-22 12:50:44.547432+1100 ABC[50296:3980651] Connection 4: encountered error(1:50)
2020-11-22 12:50:44.551628+1100 ABC[50296:3980651] Task .<1> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
2020-11-22 12:50:44.551679+1100 ABC[50296:3980651] Connection 5: received failure notification
2020-11-22 12:50:44.551989+1100 ABC[50296:3980651] Connection 5: failed to connect 1:50, reason -1
2020-11-22 12:50:44.552060+1100 ABC[50296:3980654] Task .<1> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283b6e850 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask .<1>"
), NSLocalizedDescription=The internet connection appears to be offline., NSErrorFailingURLStringKey=https://graph.facebook.com/v8.0, NSErrorFailingURLKey=https://graph.facebook.com/v8.0, _kCFStreamErrorDomainKey=1}
2020-11-22 12:50:44.552058+1100 ABC[50296:3980651] Connection 5: encountered error(1:50)
2020-11-22 12:50:44.553426+1100 ABC[50296:3980446] Unbalanced calls to begin/end appearance transitions for <UnityViewControllerStoryboard: 0x104e88bc0>.
2020-11-22 12:50:44.557039+1100 ABC[50296:3980651] Task .<1> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
2020-11-22 12:50:44.557598+1100 ABC[50296:3980695] Task .<1> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283b46a00 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask .<1>"
), NSLocalizedDescription=The internet connection appears to be offline., NSErrorFailingURLStringKey=https://graph.facebook.com/v8.0, NSErrorFailingURLKey=https://graph.facebook.com/v8.0, _kCFStreamErrorDomainKey=1}
2020-11-22 12:50:44.564428+1100 ABC[50296:3980651] Connection 6: received failure notification
2020-11-22 12:50:44.564526+1100 ABC[50296:3980651] Connection 6: failed to connect 1:50, reason -1
2020-11-22 12:50:44.564807+1100 ABC[50296:3980651] Connection 6: encountered error(1:50)
2020-11-22 12:50:44.565425+1100 ABC[50296:3980651] Connection 7: received failure notification
2020-11-22 12:50:44.565454+1100 ABC[50296:3980651] Connection 7: failed to connect 1:50, reason -1
2020-11-22 12:50:44.565545+1100 ABC[50296:3980651] Connection 7: encountered error(1:50)
2020-11-22 12:50:44.566371+1100 ABC[50296:3980651] Connection 8: received failure notification
2020-11-22 12:50:44.566446+1100 ABC[50296:3980651] Connection 8: failed to connect 1:50, reason -1
2020-11-22 12:50:44.566638+1100 ABC[50296:3980651] Connection 8: encountered error(1:50)
2020-11-22 12:50:44.567411+1100 ABC[50296:3980651] Task <7BE8E011-7402-42E3-88A3-B06736E5C0E6>.<1> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
2020-11-22 12:50:44.567445+1100 ABC[50296:3980651] Task .<1> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
2020-11-22 12:50:44.567624+1100 ABC[50296:3980710] Task <7BE8E011-7402-42E3-88A3-B06736E5C0E6>.<1> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283b47a50 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <7BE8E011-7402-42E3-88A3-B06736E5C0E6>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <7BE8E011-7402-42E3-88A3-B06736E5C0E6>.<1>"
), NSLocalizedDescription=The internet connection appears to be offline., NSErrorFailingURLStringKey=https://graph.facebook.com/v8.0, NSErrorFailingURLKey=https://graph.facebook.com/v8.0, _kCFStreamErrorDomainKey=1}
2020-11-22 12:50:44.567803+1100 ABC[50296:3980651] Task .<1> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283b45fb0 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask .<1>"
), NSLocalizedDescription=The internet connection appears to be offline., NSErrorFailingURLStringKey=https://graph.facebook.com/v8.0, NSErrorFailingURLKey=https://graph.facebook.com/v8.0, _kCFStreamErrorDomainKey=1}
2020-11-22 12:50:44.568398+1100 ABC[50296:3980695] Task <8BEA3AC7-7477-4D66-B1FF-02DD47C7BB08>.<1> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
2020-11-22 12:50:44.568655+1100 ABC[50296:3980651] Task <8BEA3AC7-7477-4D66-B1FF-02DD47C7BB08>.<1> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283b66940 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <8BEA3AC7-7477-4D66-B1FF-02DD47C7BB08>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <8BEA3AC7-7477-4D66-B1FF-02DD47C7BB08>.<1>"
), NSLocalizedDescription=The internet connection appears to be offline., NSErrorFailingURLStringKey=https://graph.facebook.com/v8.0, NSErrorFailingURLKey=https://graph.facebook.com/v8.0, _kCFStreamErrorDomainKey=1}
2020-11-22 12:50:44.572055+1100 ABC[50296:3980651] Connection 9: received failure notification
2020-11-22 12:50:44.572185+1100 ABC[50296:3980651] Connection 9: failed to connect 1:50, reason -1
2020-11-22 12:50:44.572269+1100 ABC[50296:3980651] Connection 9: encountered error(1:50)
2020-11-22 12:50:44.573680+1100 ABC[50296:3980651] Task <22062BF4-A4D4-4E38-B507-4A76E12531A2>.<1> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
2020-11-22 12:50:44.573771+1100 ABC[50296:3980651] Connection 10: received failure notification
2020-11-22 12:50:44.573994+1100 ABC[50296:3980653] Task <22062BF4-A4D4-4E38-B507-4A76E12531A2>.<1> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283b47900 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <22062BF4-A4D4-4E38-B507-4A76E12531A2>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <22062BF4-A4D4-4E38-B507-4A76E12531A2>.<1>"
), NSLocalizedDescription=The internet connection appears to be offline., NSErrorFailingURLStringKey=https://graph.facebook.com/v2020-11-22 12:50:44.574007+1100 ABC[50296:3980651] Connection 10: failed to connect 1:50, reason -1
8.0, NSErrorFailingURLKey=https://graph.facebook.com/v8.0, _kCFStreamErrorDomainKey=1}
2020-11-22 12:50:44.574090+1100 ABC[50296:3980651] Connection 10: encountered error(1:50)
2020-11-22 12:50:44.575006+1100 ABC[50296:3980651] Task .<1> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
2020-11-22 12:50:44.575110+1100 ABC[50296:3980651] Task .<1> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283b65dd0 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask .<1>"
), NSLocalizedDescription=The internet connection appears to be offline., NSErrorFailingURLStringKey=https://graph.facebook.com/v8.0, NSErrorFailingURLKey=https://graph.facebook.com/v8.0, _kCFStreamErrorDomainKey=1}
2020-11-22 12:50:44.579031+1100 ABC[50296:3980696] 6.32.0 - [I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
UnloadTime: 1.813958 ms
2020-11-22 12:50:52.527478+1100 ABC[50296:3980696] 6.32.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add [FIRApp configure]; (FirebaseApp.configure() in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.
2020-11-22 12:50:52.557203+1100 ABC[50296:3980653] Connection 11: received failure notification
2020-11-22 12:50:52.557242+1100 ABC[50296:3980653] Connection 11: failed to connect 1:50, reason -1
2020-11-22 12:50:52.557262+1100 ABC[50296:3980653] Connection 11: encountered error(1:50)
2020-11-22 12:50:52.557877+1100 ABC[50296:3980653] Task <3D215A6B-B76A-42D3-97D0-A28EBF64D474>.<1> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
2020-11-22 12:50:52.558071+1100 ABC[50296:3980653] Task <3D215A6B-B76A-42D3-97D0-A28EBF64D474>.<1> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283b14c90 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <3D215A6B-B76A-42D3-97D0-A28EBF64D474>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <3D215A6B-B76A-42D3-97D0-A28EBF64D474>.<1>"
), NSLocalizedDescription=The internet connection appears to be offline., NSErrorFailingURLStringKey=https://config.uca.cloud.unity3d.com/, NSErrorFailingURLKey=https://config.uca.cloud.unity3d.com/, _kCFStreamErrorDomainKey=1}
2020-11-22 12:50:52.583926+1100 ABC[50296:3980653] 6.32.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60802000 started
2020-11-22 12:50:52.584441+1100 ABC[50296:3980653] 6.32.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2020-11-22 12:50:52.646141+1100 ABC[50296:3980695] 6.32.0 - [Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO. Follow the instructions at:
https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging
to ensure proper integration.
2020-11-22 12:50:52.646230+1100 ABC[50296:3980446] [Firebase/Crashlytics] Version 4.6.2
2020-11-22 12:50:52.857442+1100 ABC[50296:3980695] 6.32.0 - [Firebase/Analytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
2020-11-22 12:50:52.956128+1100 ABC[50296:3980695] 6.32.0 - [Firebase/Analytics][I-ACS023012] Analytics collection enabled
2020-11-22 12:50:53.176077+1100 ABC[50296:3980763] Connection 12: received failure notification
2020-11-22 12:50:53.176112+1100 ABC[50296:3980763] Connection 12: failed to connect 1:50, reason -1
2020-11-22 12:50:53.176124+1100 ABC[50296:3980763] Connection 12: encountered error(1:50)
2020-11-22 12:50:53.176712+1100 ABC[50296:3980696] Task .<1> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
2020-11-22 12:50:53.177000+1100 ABC[50296:3980763] Task .<1> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283b01cb0 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask .<1>"
), NSLocalizedDescription=The internet connection appears to be offline., NSErrorFailingURLStringKey=https://securetoken.googleapis.com/v1/token?key=xxx, NSErrorFailingURLKey=https://securetoken.googleapis.com/v1/token?key=xxx, _kCFStreamErrorDomainKey=1}
2020-11-22 12:50:53.179255+1100 ABC[50296:3980760] Connection 13: received failure notification
2020-11-22 12:50:53.179309+1100 ABC[50296:3980760] Connection 13: failed to connect 1:50, reason -1
2020-11-22 12:50:53.179390+1100 ABC[50296:3980760] Connection 13: encountered error(1:50)
2020-11-22 12:50:53.180142+1100 ABC[50296:3980760] Task .<1> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
2020-11-22 12:50:53.180295+1100 ABC[50296:3980760] Task .<1> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283b01bc0 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask .<1>"
), NSLocalizedDescription=The internet connection appears to be offline., NSErrorFailingURLStringKey=https://securetoken.googleapis.com/v1/token?key=xxx, NSErrorFailingURLKey=https://securetoken.googleapis.com/v1/token?key=xxx, _kCFStreamErrorDomainKey=1}
2020-11-22 12:50:53.202905+1100 ABC[50296:3980695] Connection 14: received failure notification
2020-11-22 12:50:53.202930+1100 ABC[50296:3980695] Connection 14: failed to connect 1:50, reason -1
2020-11-22 12:50:53.202945+1100 ABC[50296:3980695] Connection 14: encountered error(1:50)
2020-11-22 12:50:53.203526+1100 ABC[50296:3980695] Task <154CF1A0-E1CF-4797-869C-90D9C25AEA08>.<2> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
2020-11-22 12:50:53.203666+1100 ABC[50296:3980695] Task <154CF1A0-E1CF-4797-869C-90D9C25AEA08>.<2> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283b30cf0 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <154CF1A0-E1CF-4797-869C-90D9C25AEA08>.<2>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <154CF1A0-E1CF-4797-869C-90D9C25AEA08>.<2>"
), NSLocalizedDescription=The internet connection appears to be offline., NSErrorFailingURLStringKey=https://cdp.cloud.unity3d.com/v1/events, NSErrorFailingURLKey=https://cdp.cloud.unity3d.com/v1/events, _kCFStreamErrorDomainKey=1}
2020-11-22 12:50:53.520941+1100 ABC[50296:3980711] Connection 15: received failure notification
2020-11-22 12:50:53.520970+1100 ABC[50296:3980711] Connection 15: failed to connect 1:50, reason -1
2020-11-22 12:50:53.520984+1100 ABC[50296:3980711] Connection 15: encountered error(1:50)
2020-11-22 12:50:53.521838+1100 ABC[50296:3980776] Task .<1> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
2020-11-22 12:50:53.522225+1100 ABC[50296:3980776] Task .<1> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283b31920 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask .<1>"
), NSLocalizedDescription=The internet connection appears to be offline., NSErrorFailingURLStringKey=https://securetoken.googleapis.com/v1/token?key=xxx, NSErrorFailingURLKey=https://securetoken.googleapis.com/v1/token?key=xxx _kCFStreamErrorDomainKey=1}
2020-11-22 12:50:53.524067+1100 ABC[50296:3980711] Connection 16: received failure notification
2020-11-22 12:50:53.524089+1100 ABC[50296:3980711] Connection 16: failed to connect 1:50, reason -1
2020-11-22 12:50:53.524100+1100 ABC[50296:3980711] Connection 16: encountered error(1:50)
2020-11-22 12:50:53.524775+1100 ABC[50296:3980776] Task <211908E8-686F-4123-BA0C-E416789152BD>.<1> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
2020-11-22 12:50:53.525081+1100 ABC[50296:3980711] Task <211908E8-686F-4123-BA0C-E416789152BD>.<1> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283b01da0 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <211908E8-686F-4123-BA0C-E416789152BD>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <211908E8-686F-4123-BA0C-E416789152BD>.<1>"
), NSLocalizedDescription=The internet connection appears to be offline., NSErrorFailingURLStringKey=https://securetoken.googleapis.com/v1/token?key=xxx, NSErrorFailingURLKey=https://securetoken.googleapis.com/v1/token?key=xxx, _kCFStreamErrorDomainKey=1}
2020-11-22 12:50:53.526706+1100 ABC[50296:3980776] Connection 17: received failure notification
2020-11-22 12:50:53.526729+1100 ABC[50296:3980776] Connection 17: failed to connect 1:50, reason -1
2020-11-22 12:50:53.526741+1100 ABC[50296:3980776] Connection 17: encountered error(1:50)
2020-11-22 12:50:53.526927+1100 ABC[50296:3980776] Task .<1> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
2020-11-22 12:50:53.527080+1100 ABC[50296:3980776] Task .<1> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x283b30420 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask .<1>"
), NSLocalizedDescription=The internet connection appears to be offline., NSErrorFailingURLStringKey=https://securetoken.googleapis.com/v1/token?key=xxx, NSErrorFailingURLKey=https://securetoken.googleapis.com/v1/libc++abi.dylib: terminating with uncaught exception of type firebase::firestore::util::FirestoreInternalError
terminating with uncaught exception of type firebase::firestore::util::FirestoreInternalError

Steps to reproduce:


Try to use iOS app in airplane mode and save and load data from firebasestore offline. The issue happens 1 in 4 especially if you start your app when the phone has been offline for a while!

@dconeybe
Copy link

Hi @mojikashani. Thank you for reporting this issue and my apologies that you are being affected by this crash. Firestore should definitely not be crashing your app just because the device is in airplane mode. I am going to try to reproduce by creating a simple app that writes to Firestore and launching it a bunch of times while offline.

In the meantime, could you help by providing some or all of the additional information requested below?

  1. Do you have a minimal app whose source code you could share with me that I could use to reproduce the crash?
  2. Do you have a stack trace for the exception? The last line of the logs you provided mention a FirestoreInternalError; however, a full stack trace, if available, would help pinpoint the error.
  3. Can you reproduce with debug logging enabled and provide those logs? To do this, set FirebaseFirestore.LogLevel to LogLevel.Debug after creating the FirebaseFirestore instance.

@mojikashani
Copy link
Author

Hi @mojikashani. Thank you for reporting this issue and my apologies that you are being affected by this crash. Firestore should definitely not be crashing your app just because the device is in airplane mode. I am going to try to reproduce by creating a simple app that writes to Firestore and launching it a bunch of times while offline.

In the meantime, could you help by providing some or all of the additional information requested below?

  1. Do you have a minimal app whose source code you could share with me that I could use to reproduce the crash?
  2. Do you have a stack trace for the exception? The last line of the logs you provided mention a FirestoreInternalError; however, a full stack trace, if available, would help pinpoint the error.
  3. Can you reproduce with debug logging enabled and provide those logs? To do this, set FirebaseFirestore.LogLevel to LogLevel.Debug after creating the FirebaseFirestore instance.

Thanks @dconeybe , This issue is happening especially when I am updating a document with the new data in offline mode:
Also as you mentioned, I set the Firestore Log Level to Debug and here is the logs:

2020-11-24 18:01:01.924605+1100 ABC[718:108455] 6.32.0 - [Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction Locally write mutations: 3 changes (193 bytes):

  • Put [collection_parent: collection_id=users] (0 bytes)
  • Put [document_mutation: user_id=VGi8m8BgmbbjlcISTTFZZGfgBXm1 path=users/VGi8m8BgmbbjlcISTTFZZGfgBXm1 batch_id=1] (0 bytes)
  • Put [mutation: user_id=VGi8m8BgmbbjlcISTTFZZGfgBXm1 batch_id=1] (193 bytes)>
    2020-11-24 18:01:01.924798+1100 ABC[718:108455] 6.32.0 - [Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction NotifyLocalViewChanges: 0 changes (0 bytes):>
    2020-11-24 18:01:01.924915+1100 ABC[718:108455] 6.32.0 - [Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction NextMutationBatchAfterBatchID: 0 changes (0 bytes):>
    2020-11-24 18:01:01.927732+1100 ABC[718:108455] 6.32.0 - [Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction NextMutationBatchAfterBatchID: 0 changes (0 bytes):>
    2020-11-24 18:01:01.929140+1100 ABC[718:108455] 6.32.0 - [Firebase/Firestore][I-FST000001] WriteStream (116314088) start
    2020-11-24 18:01:01.929674+1100 ABC[718:108455] 6.32.0 - [Firebase/Firestore][I-FST000001] WatchStream (116313f88) start
    2020-11-24 18:01:01.930404+1100 ABC[718:108448] Connection 45: received failure notification
    2020-11-24 18:01:01.930484+1100 ABC[718:108448] Connection 45: failed to connect 1:50, reason -1
    2020-11-24 18:01:01.930532+1100 ABC[718:108448] Connection 45: encountered error(1:50)
    2020-11-24 18:01:01.933062+1100 ABC[718:108455] Task <37B23CC8-4AD8-41BA-9D32-BFFBC874FEF0>.<1> HTTP load failed, 0/0 bytes (error code: -1020 [1:50])
    2020-11-24 18:01:01.933800+1100 ABC[718:108448] Task <37B23CC8-4AD8-41BA-9D32-BFFBC874FEF0>.<1> finished with error [-1020] Error Domain=NSURLErrorDomain Code=-1020 "A data connection is not currently allowed." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x2812b25b0 {Error Domain=kCFErrorDomainCFNetwork Code=-1020 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <37B23CC8-4AD8-41BA-9D32-BFFBC874FEF0>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <37B23CC8-4AD8-41BA-9D32-BFFBC874FEF0>.<1>"
    ), NSLocalizedDescription=A data connection is not currently allowed., NSErrorFailingURLStringKey=https://securetoken.googleapis.com/v1/token?key=xxx, NSErrorFailingURLKey=https://securetoken.googleapis.com/v1/token?key=xxx, _kCFStreamErrorDomainKey=1}
    History added to levels.
    d__2:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
    d__8:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

libc++abi.dylib: terminating with uncaught exception of type firebase::firestore::util::FirestoreInternalError
terminating with uncaught exception of type firebase::firestore::util::FirestoreInternalError
(lldb)

2020-11-24 18:19:15.826904+1100 ABC[718:112276] Task <7F43826A-0F5A-407E-866B-C387B54D4B72>.<1> finished with error [-1001] Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2102, NSUnderlyingError=0x2812bb990 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <7F43826A-0F5A-407E-866B-C387B54D4B72>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <7F43826A-0F5A-407E-866B-C387B54D4B72>.<1>"
), NSLocalizedDescription=The request timed out., NSErrorFailingURLStringKey=https://securetoken.googleapis.com/v1/token?key=xxx, NSErrorFailingURLKey=https://securetoken.googleapis.com/v1/token?key=xxx, _kCFStreamErrorDomainKey=4}
2020-11-24 18:19:15.831518+1100 ABC[718:108454] 6.32.0 - [Firebase/Firestore][I-FST000001] WriteStream (116314088) Stream error: 'Unknown code(19): Network error (such as timeout, interrupted connection or unreachable host) has occurred.'
terminating with uncaught exception of type firebase::firestore::util::FirestoreInternalError
2020-11-24 18:19:25.623855+1100 ABC[718:108095] DEBUG: Searching for selector applicationDidEnterBackground: (FIRA95b8f943applicationDidEnterBackground:) on class GDTCORLifecycle
Searching for selector applicationDidEnterBackground: (FIRA95b8f943applicationDidEnterBackground:) on class GDTCORLifecycle
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

2020-11-24 18:19:25.624618+1100 ABC[718:108095] DEBUG: Found applicationDidEnterBackground: (FIRA95b8f943applicationDidEnterBackground:, 0x06bd3f78) on class GDTCORLifecycle (GDTCORLifecycle)
Found applicationDidEnterBackground: (FIRA95b8f943applicationDidEnterBackground:, 0x06bd3f78) on class GDTCORLifecycle (GDTCORLifecycle)
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

-> applicationWillResignActive()
Transaction added to levels.
d__3:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
d__8:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

Please let me know if there are simply ways to avoid the issue as well! Thanks a lot!

@dconeybe
Copy link

Thank you for the additional logs. The fatal FirestoreInternalError is a result of an assertion failure somewhere in Firestore's code base. Strangely, there does not appear to be any "message" associated with the error, thus making it very difficult to pinpoint what may be going wrong. If you happen to be able to find a message somewhere else in the logs or some other logs that would be very helpful.

From the logs you provided, specifically, the log line beginning with "WriteStream (116314088) Stream error", I can see that the call to WriteStream.Start() is failing here: https://github.com/firebase/firebase-ios-sdk/blob/0dbff8aa84aafebb6a0322cb4d08fa6da1dbc16a/Firestore/core/src/remote/stream.cc#L299, which means that the call to credentials_provider_->GetToken(...) failed. I scanned the code around that line but could not find anything that I thought would result in a FirestoreInternalError (i.e. a call to HARD_ASSERT()).

Currently, I'm using a Firestore project that does not require authentication to try to reproduce this issue. I have not yet been able to reproduce. I'll try using a project that requires authenticated users and report back.

If you have time, one thing that you could do to help (which I would do if I could reproduce the crash) is to add a bunch of log messages into Firestore's source code to try and figure out which HARD_ASSERT() is failing. When you export your Unity project to an Xcode project you can edit Firestore's source code that is pulled down by pod. I would start by adding LOG_WARN messages into Pods/FirebaseFirestore/Firestore/core/src/remote/stream.cc and Pods/FirebaseFirestore/Firestore/core/src/remote/write_stream.cc, specifically the methods Start(), Close(), and NotifyStreamClose().

@dconeybe
Copy link

Update: I was able to reproduce the crash but the logs aren't very helpful. Luckily, another user has reported the same crash against the C++ SDK and the logs there are much more useful: firebase/firebase-cpp-sdk#182. I will continue investigation.

@dconeybe
Copy link

I have found the bug and a fix for this issue is currently in code review. Please see firebase/firebase-cpp-sdk#182 (comment) for more details, including a hacky workaround. I will keep this issue opened until the fix is submitted and ready for release.

@dconeybe dconeybe added type: bug and removed needs-info Need information for the developer labels Nov 26, 2020
@mojikashani
Copy link
Author

Thanks a lot @dconeybe !
The workaround seems to be working😊
But I will keep an eye for the new release!👍

@dconeybe
Copy link

dconeybe commented Dec 1, 2020

Update: The fix has been submitted and will be included in the next release. I'm going to close this ticket since there are no more actions to be taken on my part. However, if you find that the next release does not fix this issue then please re-open this ticket and we'll investigate. Unfortunately, I do not have an ETA for the next release.

Note to Googlers: b/174146134 is the internal ticket filed for the issue. The fix is cl/344844086.

@dconeybe dconeybe closed this as completed Dec 1, 2020
@dconeybe
Copy link

dconeybe commented Dec 3, 2020

FYI The Firebase Unity SDK v7.0.0 was just released and contains the fix for this issue.

@firebase firebase locked and limited conversation to collaborators Jan 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants