firebase-ios-sdk: Could not reach Cloud Firestore backend

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 10.3
  • Firebase SDK version: 6.7.0
  • Firebase Component: Firestore
  • Component version: 1.4.5

Podfile:

target 'MyTarget' do

  platform :ios, '12.2'

  use_frameworks!

  inhibit_all_warnings!

  pod 'Firebase/Core'
  pod 'Firebase/Auth'
  pod 'Firebase/Analytics'
  pod 'Firebase/AdMob'
  pod 'Firebase/Storage'
  pod 'FirebaseUI/Storage'
  pod 'Firebase/Firestore'
  pod 'Fabric', '~> 1.10.2'
  pod 'Crashlytics', '~> 3.13.4'
  pod 'Firebase/AdMob'
end

[REQUIRED] Step 3: Describe the problem

I’ve been having all sorts of intermittent issues for the last couple days, but now the problem occurs 100% of the time on multiple real devices and the simulator. I’m just launching my app and doing anonymous auth, which generates the following errors, and I’m unable to load any collections/documents.

[Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction Start LevelDB: 0 changes (0 bytes):>
[Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction Start MutationQueue: 0 changes (0 bytes):>
[Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction NextMutationBatchAfterBatchID: 0 changes (0 bytes):>
[Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction NextMutationBatchAfterBatchID: 0 changes (0 bytes):>
[Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction NextMutationBatchAfterBatchID: 0 changes (0 bytes):>
[Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction NextMutationBatchAfterBatchID: 0 changes (0 bytes):>
[Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction NextMutationBatchAfterBatchID: 0 changes (0 bytes):>
[Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction NextMutationBatchAfterBatchID: 0 changes (0 bytes):>
[Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction NextMutationBatchAfterBatchID: 0 changes (0 bytes):>
[Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction NextMutationBatchAfterBatchID: 0 changes (0 bytes):>
[Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction NextMutationBatchAfterBatchID: 0 changes (0 bytes):>
[Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction NextMutationBatchAfterBatchID: 0 changes (0 bytes):>
[Firebase/Firestore][I-FST000001] WriteStream (13fd73e88) start
[Firebase/Auth][I-AUT000002] Token auto-refresh enabled.
[Firebase/Auth][I-AUT000004] Token auto-refresh scheduled in 00:00 for the new token.
[Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction Allocate query: 0 changes (0 bytes):>
[Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction ExecuteQuery: 0 changes (0 bytes):>
[Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction RemoteDocumentKeysForTarget: 0 changes (0 bytes):>
[Firebase/Firestore][I-FST000001] WatchStream (13fd73d78) start
[Firebase/Firestore][I-FST000001] WriteStream (13fd73e88) Stream error
[Firebase/Firestore][I-FST000001] WriteStream (13fd73e88) backoff
[Firebase/Firestore][I-FST000001] WriteStream (13fd73e88) start
[BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C3.1:2][0x13fd94700] get output frames failed, state 8196
[BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C3.1:2][0x13fd94700] get output frames failed, state 8196
[Firebase/Auth][I-AUT000003] Token auto-refresh re-scheduled in 01:00 because of error on previous refresh attempt.
[Firebase/Firestore][I-FST000001] WatchStream (13fd73d78) Stream error
[Firebase/Firestore][I-FST000001] Could not reach Cloud Firestore backend. Connection failed 1 times. Most recent error: An internal error has occurred, print and inspect the error details for more information.
 This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.

Relevant Code:

FirebaseApp.configure()
FirebaseConfiguration.shared.setLoggerLevel(.max)
GADMobileAds.sharedInstance().start(completionHandler: nil)

 Auth.auth().signInAnonymously() { (authResult, error) in
     if let error = error {
        print("Anonymous auth failed with error: ", error)
      } else {
         print("Anonymous auth succeeded.")
      }
}

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 42 (13 by maintainers)

Most upvoted comments

That may have been a red herring… I think I figured it out! If you still have the sample app I sent you are you still getting that error? I believe the issue was API restriction settings for iOS. I had chosen a bunch of them, like Firestore, Identity Toolkit, etc., but apparently something there should have been checked that wasn’t… I just disabled API restrictions and it seems to be working now.