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

Logging requests are made despite setting FirebaseDataCollectionDefaultEnabled to NO #8220

Closed
swrobel opened this issue Jun 9, 2021 · 17 comments

Comments

@swrobel
Copy link

swrobel commented Jun 9, 2021

Step 0: Are you in the right place?

  • For issues or feature requests related to the code in this repository
    file a Github issue.
    • If this is a feature request please use the Feature Request template.
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general (non-iOS) Firebase discussion, use the firebase-talk
    google group.
  • For backend issues, console issues, and other non-SDK help that does not fall under one
    of the above categories, reach out to
    Firebase Support.
  • Once you've read this section and determined that your issue is appropriate for
    this repository, please delete this section.

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 12.5
  • Firebase SDK version: 8.1 or 8.0? Not really sure. Pod versions below.
  • Installation method: CocoaPods
  • Firebase Component: Core/Messaging
  • React Native: 0.64.2
  • NPM packages:
    * @react-native-firebase/messaging: 12.0.0
    * @react-native-firebase/app: 12.0.0
  • Pods:
    * Firebase/CoreOnly (8.0.0)
    * Firebase/Messaging (8.0.0)
    * FirebaseCore (8.0.0)
    * FirebaseCoreDiagnostics (8.1.0)
    * FirebaseInstallations (8.1.0)
    * FirebaseMessaging (8.0.0)

I previously reported on this issue that turned out to be unrelated and opened a new issue as recommended

Network logs from Flipper:

Screen Shot 2021-06-08 at 2 07 42 PM

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

  1. Run app using XCode on a real device
  2. Log network requests using a tool like Flipper
  3. Note log requests roughly ever 30 seconds

Relevant Code:

AppDelegate.m

#import <Firebase.h>

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  if ([FIRApp defaultApp] == nil) {
    [self configureFirebase];
  }
}

- (void)configureFirebase
{
  NSString *filePath;
  if ([self isRelease]) {
    NSLog(@"[FIREBASE] Release mode.");
    filePath = [[NSBundle mainBundle] pathForResource:@"GoogleService-Info-Release" ofType:@"plist"];
  } else if ([self isInternal]) {
    NSLog(@"[FIREBASE] Internal mode.");
    filePath = [[NSBundle mainBundle] pathForResource:@"GoogleService-Info-Internal" ofType:@"plist"];
  } else {
    NSLog(@"[FIREBASE] Debug mode.");
    filePath = [[NSBundle mainBundle] pathForResource:@"GoogleService-Info-Debug" ofType:@"plist"];
  }
  
  FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath];
  [FIRApp configureWithOptions:options];
}

Info.plist

<key>FirebaseDataCollectionDefaultEnabled</key>
<string>NO</string>

Network request behavior is unchanged after adding this key to Info.plist. I have tried adding the same key to GoogleService-Info-Debug.plist and the behavior is also unchanged.

Solution:

It turns out the correct plist key is:

<key>FirebaseDataCollectionDefaultEnabled</key>
<false/>
@ryanwilson
Copy link
Member

ryanwilson commented Jun 9, 2021

Hi @swrobel, thanks for the detailed report and for creating a new issue. I'm personally unfamiliar with the RN side of things but am curious if you could try one thing to see what the local state is like. Can you please do the following:

  1. Enable logging by passing in -FIRDebugEnabled as an argument in Xcode
  2. After the configureWithOptions call can you please add the following:
NSLog(@"Firebase data collection state: %@", @([FIRApp defaultApp].isDataCollectionDefaultEnabled));

And then share the logs? I'm also curious to see what the debug logs show for other logs, either I-COR000031, I-COR000032, or I-COR000033 should appear. That'll tell us where the flag is being read from (user defaults, plist, or not at all) as logged in the getter:

- (BOOL)isDataCollectionDefaultEnabled {

@ryanwilson
Copy link
Member

Also, apologies for the trouble: this is not the expected behaviour. We'll try to get to the bottom of it quickly.

@maksymmalyhin
Copy link
Contributor

maksymmalyhin commented Jun 9, 2021

@swrobel Thank you for creating a separate issue.

I was trying to reproduce this issue with Messaging quickstart project, but with no success:

  • the request to the specified URL is not sent after fresh install even with the data collection enabled (it is expected eventually to be sent but not earlier than in 24 hours)
  • with FirebaseDataCollectionDefaultEnabled set to NO no telemetry is logged by FirebaseCore, so no requests are to be sent to the specified URL

Based on the above, it doesn't look Firebase SDK is actual a source of the issue by itself. The requests to firebaselogging-pa.googleapis.com/v1/firelog/legacy/batchlog in a native iOS project should be sent by GoogleDataTransport SDK. The GoogleDataTransport SDK is used as a transport layer by Firebase SDKs like Crashlytics, Performance, Core, etc. but also by some other Google SDKs, like ML Kit. Also the request may potentially be send from a JavaScript part of ReactNative.

Would it be possible to share the following:

  • Podfile.lock of your app to understand what SDK are installed
  • provide a sample app where the issue is reproducible for us to debug and scope done the issue

@swrobel
Copy link
Author

swrobel commented Jun 9, 2021

Would it be possible to share the following:

* Podfile.lock of your app to understand what SDK are installed

Here you go: https://gist.github.com/swrobel/f5292893142c6cd5f6754edf1a851b7e

* provide a sample app where the issue is reproducible for us to debug and scope done the issue

I'll work on this one. Thanks for your help!

@maksymmalyhin
Copy link
Contributor

@swrobel Thank you for sharing the Podfile.lock. From the first glance it looks like FirebaseCoreDiagnostics is the only SDK that uses GoogleDataTransport, so Ryan's comment to check if you can see the telemetry related log messages can give a clue idea if the requests are originated from Firebase.

@swrobel
Copy link
Author

swrobel commented Jun 9, 2021

  1. Enable logging by passing in -FIRLogDebug as an argument in Xcode

I added this here. If this isn't the right place, let me know. Apologies for my lack of Xcode knowledge, but such is React Native - giving us js devs sharp knives to run with.
Screen Shot 2021-06-09 at 2 19 27 PM

  1. After the configureWithOptions call can you please add the following:
NSLog(@"Firebase data collection state: %@", [FIRApp defaultApp].isDataCollectionDefaultEnabled);

This is erroring out when I build:

Screen Shot 2021-06-09 at 2 18 01 PM

@maksymmalyhin
Copy link
Contributor

maksymmalyhin commented Jun 9, 2021

Sorry, there was a typo in the comment. You should update the log to something like:

NSLog(@"Firebase data collection state: %@", @([FIRApp defaultApp].isDataCollectionDefaultEnabled));

I updated the original comment as well in case if someone else will try it.

@maksymmalyhin
Copy link
Contributor

Apologies, there was another typo in the comment. The place you are setting the launch argument is correct, but the argument should be -FIRDebugEnabled.

@swrobel
Copy link
Author

swrobel commented Jun 9, 2021

Relevant XCode logs (a few have had tokens/other potentially sensitive stuff removed):

2021-06-09 14:35:37.253018-0700 [3201:860057] [FIREBASE] Debug mode.
2021-06-09 14:35:37.258664-0700 [3201:860057] Firebase data collection state: 1
2021-06-09 14:35:37.367090-0700 [3201:860230] 8.0.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.
2021-06-09 14:35:37.378327-0700 [3201:860230] 8.0.0 - [Firebase/Core][I-COR000001] Configuring the default app.
2021-06-09 14:35:37.378727-0700 [3201:860230] 8.0.0 - [Firebase/Messaging][I-FCM002000] FIRMessaging library version 8.0.0
2021-06-09 14:35:37.378926-0700 [3201:860230] 8.0.0 - [GULReachability][I-REA902003] Monitoring the network status
2021-06-09 14:35:37.379061-0700 [3201:860230] 8.0.0 - [Firebase/Installations][I-FIS002000] -[FIRInstallationsIDController createGetInstallationItemPromise], appName: __FIRAPP_DEFAULT
2021-06-09 14:35:37.379235-0700 [3201:860230] 8.0.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.
2021-06-09 14:35:37.379652-0700 [3201:860230] 8.0.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
2021-06-09 14:35:37.380032-0700 [3201:860230] 8.0.0 - [Firebase/Core][I-COR000033] Data Collection flag is not set.
WARNING: Logging before InitGoogleLogging() is written to STDERR
2021-06-09 14:35:37.804007-0700 [3201:860233] 8.0.0 - [Firebase/Messaging][I-FCM023012] Provisioning profile has specifically provisioned devices, most likely a Dev profile.
2021-06-09 14:35:37.811471-0700 [3201:860233] 8.0.0 - [Firebase/Messaging][I-FCM023013] APNS Environment in profile: development
2021-06-09 14:35:37.811858-0700 [3201:860233] 8.0.0 - [Firebase/Installations][I-FIS002001] -[FIRInstallationsIDController installationWithValidAuthTokenForcingRefresh:0], appName: __FIRAPP_DEFAULT
2021-06-09 14:35:37.813172-0700 [3201:860233] 8.0.0 - [Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.
2021-06-09 14:35:37.813657-0700 [3201:860233] 8.0.0 - [Firebase/Messaging][I-FCM042001] Invalidating cached token due to Firebase App IID change from 1:*:ios:* to (null)
2021-06-09 14:35:37.813967-0700 [3201:860233] 8.0.0 - [Firebase/Messaging][I-FCM034012] Invalidating cached token for * (*) due to token is no longer fresh.
2021-06-09 14:35:37.814289-0700 [3201:860233] 8.0.0 - [Firebase/Installations][I-FIS002000] -[FIRInstallationsIDController createGetInstallationItemPromise], appName: __FIRAPP_DEFAULT
2021-06-09 14:35:37.814399-0700 [3201:860233] 8.0.0 - [Firebase/Installations][I-FIS002001] -[FIRInstallationsIDController installationWithValidAuthTokenForcingRefresh:0], appName: __FIRAPP_DEFAULT
2021-06-09 14:35:37.814561-0700 [3201:860233] 8.0.0 - [Firebase/Messaging][I-FCM042001] Invalidating cached token due to Firebase App IID change from 1:*:ios:* to (null)
2021-06-09 14:35:37.814890-0700 [3201:860233] 8.0.0 - [Firebase/Messaging][I-FCM034000] Fetch new token for authorizedEntity: *, scope: *
2021-06-09 14:35:37.815174-0700 [3201:860233] 8.0.0 - [Firebase/Installations][I-FIS002001] -[FIRInstallationsIDController installationWithValidAuthTokenForcingRefresh:0], appName: __FIRAPP_DEFAULT
2021-06-09 14:35:37.815741-0700 [3201:860233] 8.0.0 - [Firebase/Installations][I-FIS002000] -[FIRInstallationsIDController createGetInstallationItemPromise], appName: __FIRAPP_DEFAULT
2021-06-09 14:35:37.815855-0700 [3201:860233] 8.0.0 - [Firebase/Messaging][I-FCM040000] Register request to https://fcmtoken.googleapis.com/register content: *
2021-06-09 14:35:37.965376-0700 [3201:860230] 8.0.0 - [Firebase/Messaging][I-FCM034001] Token fetch successful, token: *, authorizedEntity: *, scope:*

Relevant Console logs:

14:31:09.620107-0700	[C23 DB2C000F-68C8-44BE-A8B4-19422F2CC93F firebaselogging-pa.googleapis.com:443 tcp, url hash: d70221f3, tls, context: com.apple.CFNetwork.NSURLSession.{9B873E3C-1C0D-4BCF-BB2D-7F4779DCA29F}{(null)}{Y}{2}, proc: A9B768F5-E965-384E-87E5-714689DC5B43] start
14:31:09.620256-0700	[C23 firebaselogging-pa.googleapis.com:443 initial path ((null))] event: path:start @0.000s
14:31:09.620335-0700	[C23 firebaselogging-pa.googleapis.com:443 waiting path (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: path:satisfied @0.000s, uuid: 483B03C2-1D53-4F58-83DE-E3ED0D7B1C51
14:31:09.620682-0700	[C23 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:start_dns @0.000s
14:31:09.626780-0700	[C23 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:receive_dns @0.006s
14:31:09.627893-0700	[C23 firebaselogging-pa.googleapis.com:443 failed resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:children_failed @0.007s
14:31:09.628361-0700	[C23 DB2C000F-68C8-44BE-A8B4-19422F2CC93F firebaselogging-pa.googleapis.com:443 tcp, url hash: d70221f3, tls] cancel
14:31:09.628401-0700	[C23 firebaselogging-pa.googleapis.com:443 tcp, url hash: d70221f3, tls] cancelled
14:31:39.625068-0700	[C24 96D1D1D6-AE6B-4B11-B078-F22DBA0682BB firebaselogging-pa.googleapis.com:443 tcp, url hash: d70221f3, tls, context: com.apple.CFNetwork.NSURLSession.{27EA3317-E6EA-4BC6-A85D-523BD6DD4060}{(null)}{Y}{2}, proc: A9B768F5-E965-384E-87E5-714689DC5B43] start
14:31:39.625252-0700	[C24 firebaselogging-pa.googleapis.com:443 initial path ((null))] event: path:start @0.000s
14:31:39.625377-0700	[C24 firebaselogging-pa.googleapis.com:443 waiting path (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: path:satisfied @0.000s, uuid: 42D4557D-3CFB-4343-89D0-AA50E2D51C8E
14:31:39.625583-0700	[C24 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:start_dns @0.000s
14:31:39.627002-0700	[C24 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:receive_dns @0.001s
14:31:39.631704-0700	[C24 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:receive_dns @0.006s
14:31:39.631867-0700	[C24 firebaselogging-pa.googleapis.com:443 failed resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:children_failed @0.006s
14:31:39.632368-0700	[C24 96D1D1D6-AE6B-4B11-B078-F22DBA0682BB firebaselogging-pa.googleapis.com:443 tcp, url hash: d70221f3, tls] cancel
14:31:39.632424-0700	[C24 firebaselogging-pa.googleapis.com:443 tcp, url hash: d70221f3, tls] cancelled
14:32:09.626312-0700	[C25 89B95891-0771-4477-8BF7-055F991CDD3C firebaselogging-pa.googleapis.com:443 tcp, url hash: d70221f3, tls, context: com.apple.CFNetwork.NSURLSession.{FF220F26-A241-46A0-8D6E-71196372089A}{(null)}{Y}{2}, proc: A9B768F5-E965-384E-87E5-714689DC5B43] start
14:32:09.626473-0700	[C25 firebaselogging-pa.googleapis.com:443 initial path ((null))] event: path:start @0.000s
14:32:09.626550-0700	[C25 firebaselogging-pa.googleapis.com:443 waiting path (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: path:satisfied @0.000s, uuid: 7A0E7BEC-F499-4EC7-97B4-BDD2A84EEF18
14:32:09.626739-0700	[C25 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:start_dns @0.000s
14:32:09.628437-0700	[C25 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:receive_dns @0.001s
14:32:09.633735-0700	[C25 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:receive_dns @0.007s
14:32:09.633927-0700	[C25 firebaselogging-pa.googleapis.com:443 failed resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:children_failed @0.007s
14:32:09.634459-0700	[C25 89B95891-0771-4477-8BF7-055F991CDD3C firebaselogging-pa.googleapis.com:443 tcp, url hash: d70221f3, tls] cancel
14:32:09.634507-0700	[C25 firebaselogging-pa.googleapis.com:443 tcp, url hash: d70221f3, tls] cancelled
14:32:39.628477-0700	[C26 103FE4D8-F707-4898-9BB0-98EAC2FBEC5B firebaselogging-pa.googleapis.com:443 tcp, url hash: d70221f3, tls, context: com.apple.CFNetwork.NSURLSession.{07D96DA9-7581-4016-9794-B5567821A49B}{(null)}{Y}{2}, proc: A9B768F5-E965-384E-87E5-714689DC5B43] start
14:32:39.628609-0700	[C26 firebaselogging-pa.googleapis.com:443 initial path ((null))] event: path:start @0.000s
14:32:39.628686-0700	[C26 firebaselogging-pa.googleapis.com:443 waiting path (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: path:satisfied @0.000s, uuid: 1674AA6D-66D4-4E82-BF66-B5D2C8E22688
14:32:39.628870-0700	[C26 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:start_dns @0.000s
14:32:39.636089-0700	[C26 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:receive_dns @0.007s
14:32:39.637140-0700	[C26 firebaselogging-pa.googleapis.com:443 failed resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:children_failed @0.007s
14:32:39.637469-0700	[C26 103FE4D8-F707-4898-9BB0-98EAC2FBEC5B firebaselogging-pa.googleapis.com:443 tcp, url hash: d70221f3, tls] cancel
14:32:39.637511-0700	[C26 firebaselogging-pa.googleapis.com:443 tcp, url hash: d70221f3, tls] cancelled
14:33:09.626808-0700	[C27 27274194-F959-47FD-8BC8-A8253F682C7C firebaselogging-pa.googleapis.com:443 tcp, url hash: d70221f3, tls, context: com.apple.CFNetwork.NSURLSession.{FCFEB796-7D13-41D4-8554-6E923151993F}{(null)}{Y}{2}, proc: A9B768F5-E965-384E-87E5-714689DC5B43] start
14:33:09.626902-0700	[C27 firebaselogging-pa.googleapis.com:443 initial path ((null))] event: path:start @0.000s
14:33:09.627129-0700	[C27 firebaselogging-pa.googleapis.com:443 waiting path (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: path:satisfied @0.000s, uuid: A9F44D44-13C8-49BC-8938-15CB7BA7F42B
14:33:09.627316-0700	[C27 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:start_dns @0.000s
14:33:09.628667-0700	[C27 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:receive_dns @0.001s
14:33:09.634613-0700	[C27 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:receive_dns @0.007s
14:33:09.634813-0700	[C27 firebaselogging-pa.googleapis.com:443 failed resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:children_failed @0.007s
14:33:09.635309-0700	[C27 27274194-F959-47FD-8BC8-A8253F682C7C firebaselogging-pa.googleapis.com:443 tcp, url hash: d70221f3, tls] cancel
14:33:09.635355-0700	[C27 firebaselogging-pa.googleapis.com:443 tcp, url hash: d70221f3, tls] cancelled
14:33:39.626609-0700	[C28 7EFFFB68-3B80-48C2-B575-77F29F1D9F0D firebaselogging-pa.googleapis.com:443 tcp, url hash: d70221f3, tls, context: com.apple.CFNetwork.NSURLSession.{18F3FA45-5FC5-414F-9FF9-162C24AFCF6B}{(null)}{Y}{2}, proc: A9B768F5-E965-384E-87E5-714689DC5B43] start
14:33:39.626756-0700	[C28 firebaselogging-pa.googleapis.com:443 initial path ((null))] event: path:start @0.000s
14:33:39.627469-0700	[C28 firebaselogging-pa.googleapis.com:443 waiting path (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: path:satisfied @0.000s, uuid: 7AF0F873-C47A-4C9C-8E76-92AE67FE1199
14:33:39.627908-0700	[C28 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:start_dns @0.000s
14:33:39.629719-0700	[C28 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:receive_dns @0.002s
14:33:39.633897-0700	[C28 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:receive_dns @0.007s
14:33:39.634016-0700	[C28 firebaselogging-pa.googleapis.com:443 failed resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:children_failed @0.007s
14:33:39.634529-0700	[C28 7EFFFB68-3B80-48C2-B575-77F29F1D9F0D firebaselogging-pa.googleapis.com:443 tcp, url hash: d70221f3, tls] cancel
14:33:39.634617-0700	[C28 firebaselogging-pa.googleapis.com:443 tcp, url hash: d70221f3, tls] cancelled
14:36:08.100343-0700	[C15 AA72EBA7-0944-47E5-98B6-C3138D3E01B3 firebaselogging-pa.googleapis.com:443 tcp, url hash: 7f854d63, tls, context: com.apple.CFNetwork.NSURLSession.{61591D14-F30C-41C6-8C1E-6CA529841FEA}{(null)}{Y}{2}, proc: A9B768F5-E965-384E-87E5-714689DC5B43] start
14:36:08.100522-0700	[C15 firebaselogging-pa.googleapis.com:443 initial path ((null))] event: path:start @0.000s
14:36:08.101095-0700	[C15 firebaselogging-pa.googleapis.com:443 waiting path (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: path:satisfied @0.003s, uuid: 19312135-2872-44FA-9C1C-5A66C4467851
14:36:08.101344-0700	[C15 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:start_dns @0.004s
14:36:08.104923-0700	[C15 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:receive_dns @0.008s
14:36:08.108922-0700	[C15 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:receive_dns @0.012s
14:36:08.109003-0700	[C15 firebaselogging-pa.googleapis.com:443 failed resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:children_failed @0.012s
14:36:08.109472-0700	[C15 AA72EBA7-0944-47E5-98B6-C3138D3E01B3 firebaselogging-pa.googleapis.com:443 tcp, url hash: 7f854d63, tls] cancel
14:36:08.109575-0700	[C15 firebaselogging-pa.googleapis.com:443 tcp, url hash: 7f854d63, tls] cancelled
14:36:37.695297-0700	[C16 371D109E-D533-4FB2-9D49-78F634E7D80F firebaselogging-pa.googleapis.com:443 tcp, url hash: 7f854d63, tls, context: com.apple.CFNetwork.NSURLSession.{0C65F631-5E5E-4285-BDC7-FDB55E82A1F8}{(null)}{Y}{2}, proc: A9B768F5-E965-384E-87E5-714689DC5B43] start
14:36:37.695429-0700	[C16 firebaselogging-pa.googleapis.com:443 initial path ((null))] event: path:start @0.000s
14:36:37.695507-0700	[C16 firebaselogging-pa.googleapis.com:443 waiting path (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: path:satisfied @0.000s, uuid: C2949A06-601B-45BE-BF76-A6115302D405
14:36:37.695664-0700	[C16 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:start_dns @0.000s
14:36:37.697146-0700	[C16 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:receive_dns @0.001s
14:36:37.698920-0700	[C16 firebaselogging-pa.googleapis.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:receive_dns @0.004s
14:36:37.699090-0700	[C16 firebaselogging-pa.googleapis.com:443 failed resolver (satisfied (Path is satisfied), interface: en0, ipv4, dns)] event: resolver:children_failed @0.004s
14:36:37.699629-0700	[C16 371D109E-D533-4FB2-9D49-78F634E7D80F firebaselogging-pa.googleapis.com:443 tcp, url hash: 7f854d63, tls] cancel
14:36:37.699702-0700	[C16 firebaselogging-pa.googleapis.com:443 tcp, url hash: 7f854d63, tls] cancelled

@maksymmalyhin
Copy link
Contributor

Thank you for sharing the logs. I can see a couple issue here:

  1. For some reason FirebaseDataCollectionDefaultEnabled cannot be read by FirebaseCore SDK in your app. I would suggest to double check if the flag is added to the Info.plist of the app target you are testing and is not stripped by any script, etc.
  2. The endpoint firebaselogging-pa.googleapis.com/v1/firelog/legacy/batchlog cannot be reached from your device. I guess it's the device network configuration issue. I wonder if it's intentional (e.g. a Network Conditioner profile enabled)?
  3. GoogleDataTransport retry is looks quite aggressive. This is something we need to look into in more details from our end.

Could you please check the first issue on your end. Disabling the data collection should make the other two irrelevant for your case.

@swrobel
Copy link
Author

swrobel commented Jun 9, 2021

  • For some reason FirebaseDataCollectionDefaultEnabled cannot be read by FirebaseCore SDK in your app. I would suggest to double check if the flag is added to the Info.plist of the app target you are testing and is not stripped by any script, etc.

There's just the one Info.plist, shared across all targets. I have other values in it that seem to be read just fine. I can't think of anything that would be stripping it - anything specific to look for?

  • The endpoint firebaselogging-pa.googleapis.com/v1/firelog/legacy/batchlog cannot be reached from your device. I guess it's the device network configuration issue. I wonder if it's intentional (e.g. a Network Conditioner profile enabled)?

That's my pihole, doing what it's supposed to do 😄

@paulb777
Copy link
Member

Thanks @swrobel. We'll continue investigating.

In the meantime, are you able to debug what happens if you set a breakpoint at https://github.com/firebase/firebase-ios-sdk/blob/master/FirebaseCore/Sources/FIRApp.m#L820

@swrobel
Copy link
Author

swrobel commented Jun 10, 2021

OK, this is interesting... It seems from debugging that since the Plist value is a string and Line 822 is checking whether it's a number, then line 823 is never hit.
Screen Shot 2021-06-09 at 5 29 34 PM
Or it's possible I just don't know what I'm talking about here...

@paulb777
Copy link
Member

Defining the value in the Info.plist as a Boolean works for me:

Screen Shot 2021-06-09 at 6 19 11 PM

Screen Shot 2021-06-09 at 6 19 47 PM

@swrobel
Copy link
Author

swrobel commented Jun 10, 2021

@paulb777 thanks! It turns out I had the wrong plist format when I was setting it to a string value of NO. This works correctly:

<key>FirebaseDataCollectionDefaultEnabled</key>
<false/>

It's also reflected in the logs that the value sets correctly (as opposed to state: 1 in my prior logs):

2021-06-10 08:45:43.365612-0700 [5041:1256013] Firebase data collection state: 0

However, despite the correct value, the network requests to firebaselogging-pa.googleapis.com/v1/firelog/legacy/batchlog continue 😞

@maksymmalyhin
Copy link
Contributor

@swrobel It's great that this part of issue was resolved for you! If you had data collection enabled the app may have stored some telemetry events. GoogleDataTransport will attempt to upload them until they are sent successfully or expire in around 7 days. If you re-install the app with disabled data collection, the events will not be logged, so no network requests are expected.

Could you please try re-installing the app or moving the device time forward to confirm it's working as expected for you?

@swrobel
Copy link
Author

swrobel commented Jun 10, 2021

This does indeed seem to have resolved the issue. I will say that I find it odd that the default behavior is to log, but I'm at least glad it can be disabled with certainty. I'm not sure why it took a few more debug builds in Xcode to get the requests to stop, but they have indeed stopped so I'm satisfied to close this one. I really appreciate all of the help from everyone here! 🙌🏼

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

6 participants