Firebase-ios-sdk: Cannot connect to Firebase / Crashlytics from iPad

Created on 27 Nov 2019  路  8Comments  路  Source: firebase/firebase-ios-sdk

Step 2: Describe your environment

  • Xcode version: 11.1
  • Firebase SDK version: 6.13.0
  • Firebase Component: Analytics, Crashlytics
  • Component version: Crashlytics 3.14.0

Step 3: Describe the problem

Steps to reproduce:

When building my application for the simulator, it would appear there is no problem connecting to the Firebase / Crashlytics services. However, when targeting a device, I am unable to connect. The (scrubbed) log looks like the following:

2019-11-27 10:06:30.024555  - <AppMeasurement>[I-ACS036001] Analytics screen reporting is disabled. UIViewController transitions will not be logged.
2019-11-27 10:06:30.606604 6.13.0 - [Firebase/Core][I-COR000001] Configuring the default app.
2019-11-27 10:06:30.624930 [Crashlytics] Version 3.14.0 (144)
2019-11-27 10:06:30.625351 [Crashlytics] Running on iPad6,7, 13.1.3 (17A878)
2019-11-27 10:06:30.627119 [Crashlytics:Crash] Last launch failed: this may indicate a crash shortly after app launch.
2019-11-27 10:06:30.647579 [Answers] Initialized
2019-11-27 10:06:30.649901 [Fabric] Initialized with kit versions: {
2019-11-27 10:06:30.617525 6.13.0 - [Firebase/Analytics][I-ACS005000] The AdSupport Framework is not currently linked. Some features will not function properly. Learn more at http://goo.gl/9vSsPb
2019-11-27 10:06:30.887183 6.13.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60106000 started
2019-11-27 10:06:30.899510 6.13.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2019-11-27 10:06:30.920363 6.13.0 - [Firebase/Analytics][I-ACS023009] Debug logging enabled
2019-11-27 10:06:30.924184 6.13.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
2019-11-27 10:06:30.993421 [GoogleDataTransport][I-GDTCOR000002] There was an error uploading events: Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={NSUnderlyingError=0x1363c7d50 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=https://firebaselogging.googleapis.com/v0cc/log/batch, NSErrorFailingURLKey=https://firebaselogging.googleapis.com/v0cc/log/batch, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=61, NSLocalizedDescription=Could not connect to the server.}
2019-11-27 10:06:31.029315 6.13.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
2019-11-27 10:06:31.029832 6.13.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
2019-11-27 10:06:31.030144 6.13.0 - [Firebase/InstanceID][I-IID009000] No keypair info is found with tag com.google.iid-|K|
2019-11-27 10:06:31.030313 6.13.0 - [Firebase/InstanceID][I-IID009006] There's no legacy keypair so no need to do migration.
2019-11-27 10:06:31.030613 6.13.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
2019-11-27 10:06:31.030916 6.13.0 - [GULReachability][I-REA902003] Monitoring the network status
2019-11-27 10:06:31.083383 6.13.0 - [Firebase/Analytics][I-ACS029017] Configuration was not found in database. The configuration will be fetched from the network when necessary
2019-11-27 10:06:31.085209 6.13.0 - [Firebase/Analytics][I-ACS023016] Analytics is ready to receive events
2019-11-27 10:06:31.099219 6.13.0 - [Firebase/Analytics][I-ACS023080] Setting user property. Name, value: _sid, 1574877991
2019-11-27 10:06:31.103079 6.13.0 - [Firebase/Analytics][I-ACS023087] User property set. Name, value: _sid, 1574877991
2019-11-27 10:06:31.116010 6.13.0 - [Firebase/Analytics][I-ACS023080] Setting user property. Name, value: _sno, 7
2019-11-27 10:06:31.118925 6.13.0 - [Firebase/Analytics][I-ACS023087] User property set. Name, value: _sno, 7
2019-11-27 10:06:31.138358 6.13.0 - [Firebase/Analytics][I-ACS023051] Logging event: origin, name, params: auto, _s, {
2019-11-27 10:06:33.141945 [Fabric] failed to download settings Error Domain=FABNetworkError Code=-6 "(null)" UserInfo={retryLimit=1, NSErrorFailingURLStringKey=https://settings.crashlytics.com/spi/v2/platforms/ios/apps/my.app.bundle.id/settings?build_version=0.0.0&display_version=1.1.0&source=1}
2019-11-27 10:06:39.198848 [Crashlytics:Crash:Reports] Submitting report
2019-11-27 10:06:39.199089 [Crashlytics:Crash:Reports] Submitting async /var/mobile/Containers/Data/Application/00000000-0000-0000-0000-000000000000/Library/Caches/com.crashlytics.data/my.app.bundle.id/v3/prepared/00000000-0000-0000-0000-000000000000.multipartmime
2019-11-27 10:06:39.232202 [Crashlytics:Crash:Client] A task currently exists for this upload, skipping
2019-11-27 10:06:45.311619 6.13.0 - [GULReachability][I-REA902004] Network status has changed. Code:2, status:Connected
2019-11-27 10:06:45.312185 6.13.0 - [GoogleUtilities/AppDelegateSwizzler][I-SWZ001008] Successfully created App Delegate Proxy automatically. To disable the proxy, set the flag GoogleUtilitiesAppDelegateProxyEnabled to NO (Boolean) in the Info.plist
2019-11-27 10:06:45.319765 6.13.0 - [Firebase/Analytics][I-ACS033003] Scheduling user engagement timer
2019-11-27 10:06:45.320627 6.13.0 - [Firebase/Analytics][I-ACS002002] Engagement timer scheduled to fire in approx. (s): 3600
2019-11-27 10:06:45.320843 6.13.0 - [Firebase/Analytics][I-ACS023072] Event logged. Event name, event params: _s, {
2019-11-27 10:06:45.321213 6.13.0 - [Firebase/Analytics][I-ACS002002] Measurement timer scheduled to fire in approx. (s): 1.403825044631958
2019-11-27 10:06:45.321458 6.13.0 - [Firebase/Analytics][I-ACS023028] Upload task scheduled to be executed in approx. (s): 1.403825044631958
2019-11-27 10:06:45.321648 6.13.0 - [Firebase/Analytics][I-ACS032003] iAd framework is not linked. Search Ad Attribution Reporter is disabled.
2019-11-27 10:06:45.321799 6.13.0 - [Firebase/Analytics][I-ACS002003] Measurement timer canceled
2019-11-27 10:06:45.322059 6.13.0 - [Firebase/Analytics][I-ACS002002] Measurement timer scheduled to fire in approx. (s): 1.228907942771912
2019-11-27 10:06:45.322079 6.13.0 - [Firebase/Analytics][I-ACS023028] Upload task scheduled to be executed in approx. (s): 1.228907942771912
2019-11-27 10:06:45.322365 6.13.0 - [Firebase/Analytics][I-ACS023012] Analytics enabled
2019-11-27 10:06:46.675298 6.13.0 - [Firebase/Analytics][I-ACS002001] Measurement timer fired
2019-11-27 10:06:46.675772 6.13.0 - [Firebase/Analytics][I-ACS002003] Measurement timer canceled
2019-11-27 10:06:46.675956 6.13.0 - [Firebase/Analytics][I-ACS023033] Starting data upload
2019-11-27 10:06:46.676101 6.13.0 - [Firebase/Analytics][I-ACS023037] No data to upload
2019-11-27 10:06:46.676427 6.13.0 - [Firebase/Analytics][I-ACS023126] Fetching configuration from the server
2019-11-27 10:06:46.676704 6.13.0 - [Firebase/Analytics][I-ACS900001] Downloading data. Host: https://app-measurement.com/config/app/XXXXX?platform=ios&app_instance_id=XXXXX&gmp_version=60106
2019-11-27 10:06:47.186178 6.13.0 - [Firebase/Analytics][I-ACS901017] Encounter network error. Code, error: -1004, Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x157398fa0 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <00000000-0000-0000-0000-000000000000>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
2019-11-27 10:06:47.189320 6.13.0 - [Firebase/Analytics][I-ACS023127] Fetched configuration. Status code: 0
2019-11-27 10:06:47.189592 6.13.0 - [Firebase/Analytics][I-ACS023128] Unable to get the configuration from server. Network request failed. Code, Error: 0, Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x157398fa0 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <00000000-0000-0000-0000-000000000000>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
2019-11-27 10:06:47.190814 6.13.0 - [Firebase/Analytics][I-ACS023129] Network fetch failed. Will retry later. Code, error: 0, Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x157398fa0 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <00000000-0000-0000-0000-000000000000>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
2019-11-27 10:06:47.191829 6.13.0 - [Firebase/Analytics][I-ACS002002] Measurement timer scheduled to fire in approx. (s): 1798.90881896019
2019-11-27 10:06:47.192048 6.13.0 - [Firebase/Analytics][I-ACS023028] Upload task scheduled to be executed in approx. (s): 1798.90881896019
2019-11-27 10:07:00.869685 [GoogleDataTransport][I-GDTCOR000002] There was an error uploading events: Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={NSUnderlyingError=0x1363c76f0 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=https://firebaselogging.googleapis.com/v0cc/log/batch, NSErrorFailingURLKey=https://firebaselogging.googleapis.com/v0cc/log/batch, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=61, NSLocalizedDescription=Could not connect to the server.}

Relevant Code:

My initialization code is nothing special. The extra lines to increase logging have no effect on the behavior of the SDK, just its console output:

CrashlyticsKit.delegate = self;

[FIRConfiguration.sharedInstance setLoggerLevel:FIRLoggerLevelMax];
[[Fabric sharedSDK] setDebug:YES];

[FIRApp configure];
[Fabric with:@[[Crashlytics class]]];
analytics crashlytics

Most helpful comment

The Pi-hole list was out-of-the-box, so I鈥檓 guessing this will be an issue for all default installations. Fortunately the audit log on the device shows you which addresses are blocked and there鈥檚 a single button to whitelist them, so it鈥檚 easy enough to rectify.

The biggest challenge is that the Pi-hole otherwise works so well in the background that I鈥檇 forgotten I had one.

All 8 comments

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

It is worth mentioning that other network related activities on the same device and in the same app (e.g. syncing user documents) succeed.

@fosterbrereton thanks for the report, seems like a strange issue.

It looks like all Firebase calls are blocked, a few questions to help track this down:

  • Are there any network blockers, conditioners, a VPN, or custom DNS on the device?
  • Do you have another device to test with, and does that work?
  • Are the iPad and your machine that the simulator is running on on the same network?

Thanks, hopefully we can track this down quickly for you.

Hi Ryan, thanks for getting back to me and happy Thanksgiving!

  • the device doesn鈥檛 have any network conditioners running. I do work from home and have a hardware VPN to my office, but the iPad connects to my LAN via WiFi and does not go through the company VPN.
  • unfortunately I don鈥檛 have another device to test with. Next week I鈥檒l try to recruit someone else from the office to help me test this build.
  • I think this answer is a bit complicated. As I mentioned my iPad when stand-alone is on my local LAN. My dev machine is always hard wired through my company VPN. I was under the impression that while my device is being debugged on my dev machine, it is piggybacking on the dev machine鈥檚 network connection and is not using its WiFi connection. The logs I鈥檓 getting are when the iPad is connected to the dev machine. However the simulator is also on the same dev machine, where there appears to be no problem connecting to Firebase.

馃う鈥嶁檪 i just remembered my LAN has a Pi Hole. Let me see if there鈥檚 something in that setup that may be preventing connections.

That appears to be it - several addresses were blacklisted on my Pi-hole. Whitelisting them appears to have resolved the issue.

  • app-measurement.com
  • firebaselogging.googleapis.com
  • reports.crashlytics.com
  • settings.crashlytics.com
  • e.crashlytics.com

Thank you for helping me through my false alarm!

Great, happy to hear! I'm curious, was there a master list of sources for Pi-hole or is that a custom one you had? Just in case it comes up in the future and I can easily point to it 馃檪

We ran into a similar thing in a hackathon once with a VPN preventing access to connections, so it's not the first time this has happened 馃槄

Happy Thanksgiving and have a great weekend!

The Pi-hole list was out-of-the-box, so I鈥檓 guessing this will be an issue for all default installations. Fortunately the audit log on the device shows you which addresses are blocked and there鈥檚 a single button to whitelist them, so it鈥檚 easy enough to rectify.

The biggest challenge is that the Pi-hole otherwise works so well in the background that I鈥檇 forgotten I had one.

Thanks for the info, that's very helpful! I'll make sure to share with the rest of the team to help with debugging similar issues in the future.

Was this page helpful?
0 / 5 - 0 ratings