Firebase-ios-sdk: Failed to open database

Created on 9 Jul 2019  ·  19Comments  ·  Source: firebase/firebase-ios-sdk

Xcode version: 10.2
Firebase SDK version: 6.3.0
Firebase Component: Analytics and RemoteConfig
Component version:

I call '[FIRApp configure]' method to init Firebase Analytics. An error is as follows:

2019-07-09 16:47:57.029624+0800 test[32400:4248844] - [I-ACS036002] Analytics screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable screen reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean) in the Info.plist
2019-07-09 16:47:57.595689+0800 test[32400:4248874] 6.3.0 - [Firebase/Analytics][I-ACS024000] Debug mode is on
2019-07-09 16:47:57.596095+0800 test[32400:4248874] 6.3.0 - [Firebase/Analytics][I-ACS025028] AdMob and Firebase are in use in this app, but are not linked. For analytics data consistency and integrity, it is highly recommended that you link your AdMob app to the corresponding Firebase app and re-download the GoogleServices-Info.plist file. See https://support.google.com/admob/answer/6383165 for more information.
Tiles 2[32400:4248874] 6.3.0 - [Firebase/RemoteConfig][I-RCN000062] Loading database at path /var/mobile/Containers/Data/Application/9BF108D1-9BC0-4B7C-A852-E75430A6D64E/Library/Application Support/Google/RemoteConfig/RemoteConfig.sqlite3
2019-07-09 16:47:57.600483+0800 test[32400:4248885] 6.3.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60002000 started
2019-07-09 16:47:57.600514+0800 test[32400:4248885] 6.3.0 - [Firebase/Analytics][I-ACS023008] To disable debug logging set the following application argument: -noFIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2019-07-09 16:47:57.600982+0800 test[32400:4248885] 6.3.0 - [Firebase/Analytics][I-ACS023009] Debug logging enabled
2019-07-09 16:47:57.608241+0800 test[32400:4248926] 6.3.0 - [Firebase/InstanceID][I-IID008009] Deleted checkin plist file.
o Tiles 2[32400:4248925] 6.3.0 - [Firebase/Analytics][I-ACS034002] Failed to recreate database file. Error: Error Domain=com.google.gmp.measurement.ErrorDomain Code=3 "Database operation "prepare statement" failed with sqlite code 0 and error message "not an error"" UserInfo={NSLocalizedDescription=Database operation "prepare statement" failed with sqlite code 0 and error message "not an error", APMMonitorContext=prepare statement,0,A,3}
2019-07-09 16:47:57.614658+0800 test[32400:4248926] 6.3.0 - [Firebase/Analytics][I-ACS012001] Failed to open database (Init)
2019-07-09 16:47:57.617465+0800 test[32400:4248885] 6.3.0 - [Firebase/Analytics][I-ACS034002] Failed to recreate database file. Error: Error Domain=com.google.gmp.measurement.ErrorDomain Code=3 "Database operation "prepare statement" failed with sqlite code 0 and error message "not an error"" UserInfo={NSLocalizedDescription=Database operation "prepare statement" failed with sqlite code 0 and error message "not an error", APMMonitorC2019-07-09 16:47:57.618645+0800 test[32400:4248885] 6.3.0 - [Firebase/Analytics][I-ACS012001] Failed to open database (Init)
2019-07-09 16:47:57.620761+0800 test[32400:4248926] 6.3.0 - [Firebase/Analytics][I-ACS023011] Failed to start Analytics. Analytics is disabled
2019-07-09 16:47:57.620805+0800 test[32400:4248926] 6.3.0 - [Firebase/Analytics][I-ACS023013] Analytics disabled
2019-07-09 16:47:57.633443+0800 test[32400:4248885] 6.3.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
16:47:57.634925+0800 test[32400:4248885] 6.3.0 - [Firebase/RemoteConfig][I-RCN000067] Successfully set configSettings. Developer Mode: true, Minimum Fetch Interval:43200.000000, Fetch timeout:60.000000
2019-07-09 16:47:57.636692+0800 test[32400:4248885] 6.3.0 - [Firebase/RemoteConfig][I-RCN000039] Starting requesting token.
2019-07-09 16:47:57.637800+0800 test[32400:4248885] 6.3.0 - [Firebase/InstanceID][I-IID007006] Checkin parameters: {
2019-07-09 16:47:57.866422+0800 test[32400:4248927] 6.3.0 - [Firebase/InstanceID][I-IID005004] Checkin is in progress
2019-07-09 16:47:57.988922+0800 test[32400:4248877] 6.3.0 - [Firebase/InstanceID][I-IID007002] Invalid last checkin timestamp 2019-07-09 08:47:57 +0000 in future.
2019-07-09 16:47:57.988986+0800 test[32400:4248877] 6.3.0 - [Firebase/InstanceID][I-IID007003] Checkin successful with authId: 4993161769659919742, digest: zJQp61hrUahryItG1D/wIw==, lastCheckinTimestamp: 1562662077000
2019-07-09 16:47:57.989027+0800 test[32400:4248877] 6.3.0 - [Firebase/InstanceID][I-IID005004] Successfully got checkin credentials
2019-07-09 16:47:57.990063+0800 test[32400:4248877] 6.3.0 - [Firebase/InstanceID][I-IID008010] Checkin plist file is saved
2019-07-09 16:47:57.991424+0800 test[32400:4248885] 6.3.0 - [Firebase/InstanceID][I-IID023002] Couldn't delete item from Keychain OSStatus: -25300 with the keychain query {
2019-07-09 16:47:58.587244+0800 test[32400:4248873] 6.3.0 - [Firebase/Analytics][I-ACS034002] Failed to recreate database file. Error: Error Domain=com.google.gmp.measurement.ErrorDomain Code=3 "Database operation "prepare statement" failed with sqlite code 0 and error message "not an error"" UserInfo={NSLocalizedDescription=Database operation "prepare statement" failed with sqlite code 0 and error message "not an error", APMMonitorContext=prepare2019-07-09 16:47:58.588348+0800 test[32400:4248873] 6.3.0 - [Firebase/Analytics][I-ACS012001] Failed to open database (Init)
2019-07-09 16:47:58.589633+0800 test[32400:4248873] 6.3.0 - [Firebase/Analytics][I-ACS034002] Failed to recreate data2019-07-09 16:47:58.590312+0800 test[32400:4248873] 6.3.0 - [Firebase/Analytics][I-ACS012001] Failed to open database (Init)
2019-07-09 16:47:58.590908+0800 test[32400:4248873] 6.3.0 - [Firebase/Analytics][I-ACS023011] Failed to start Analytics. Analytics is disabled
2019-07-09 16:47:58.590948+0800 test[32400:4248873] 6.3.0 - [Firebase/Analytics][I-ACS023013] Analytics disabled
2019-07-09 16:48:15.193498+0800 test[32400:4248928] 6.3.0 - [Firebase/Analytics][I-ACS031010] Tracking view controller. Class, ID: RootViewController, -9213171355309940531
2019-07-09 16:48:15.193545+0800 test[32400:4248928] 6.3.0 - [Firebase/Analytics][I-ACS031013] Screen view event not logged. App is not active.
2019-07-09 16:48:15.194425+0800 test[32400:4248930] 6.3.0 - [Firebase/InstanceID][I-IID013002] Removed cached checkin preferences from Keychain because this is a fresh install.
2019-07-09 16:48:15.194565+0800 test[32400:4248930] 6.3.0 - [Firebase/InstanceID][I-IID013006] App reset detected. Will delete server registrations.
2019-07-09 16:48:15.198935+0800 test[32400:4248930] 6.3.0 - [Firebase/InstanceID][I-IID023002] Couldn't delete item from Keychain OSStatus: -25300 with the keychain query {
2019-07-09 16:48:15.226078+0800 test[32400:4249124] 6.3.0 - [Firebase/InstanceID][I-IID021000] Unregister request to https://fcmtoken.googleapis.com/register content: X-osv=12.2&device=5199268620561638884&plat=2&app=com.xxx.test&app_ver=3.8.0&X-cliv=fiid-(null)&delete=true
2019-07-09 16:48:15.227033+0800 test[32400:4249124] 6.3.0 - [Firebase/InstanceID][I-IID023002] Couldn't delete item from Keychain OSStatus: -25300 with the keychain query {
2019-07-09 16:48:15.227075+0800 test[32400:4249124] 6.3.0 - [Firebase/InstanceID][I-IID023002] Couldn't delete item from Keychain OSStatus: -25300 with the keychain query {
2019-07-09 16:48:15.229869+0800 test[32400:4249124] 6.3.0 - [Firebase/Analytics][I-ACS025026] Deferring to Firebase for event data collection
2019-07-09 16:48:15.361750+0800 test[32400:4248925] 6.3.0 - [Firebase/InstanceID][I-IID014000] Fetch new token for authorizedEntity: 9477921910, scope: *
2019-07-09 16:48:15.362071+0800 test[32400:4248925] 6.3.0 - [Firebase/InstanceID][I-IID014000] Fetch new token for authorizedEntity: 9477921910, scope: *
2019-07-09 16:48:15.535945+0800 test[32400:4248930] 6.3.0 - [Firebase/InstanceID][I-IID014007] Successfully deleted GCM server registrations on app reset
2019-07-09 16:48:15.537745+0800 test[32400:4248850] 6.3.0 - [Firebase/InstanceID][I-IID020000] Register request to https://fcmtoken.googleapis.com/register content: X-osv=12.2&device=4993161769659919742&X-scope=&plat=2&app=com.xxx.test&app_ver=3.8.0&X-cliv=fiid-(null)&sender=9477921910&X-subtype=9477921910&appid=cm03d0RhXi8&gmp_app_id=1:9477921910:ios:781165feeae460b3
2019-07-09 16:48:15.925524+0800 test[32400:4248925] 6.3.0 - [Firebase/InstanceID][I-IID020000] Register request to https://fcmtoken.googleapis.com/register content: X-osv=12.2&device=4993161769659919742&X-scope=
&plat=2&app=com.xxx.test&app_ver=3.8.0&X-cliv=fiid-(null)&sender=9477921910&X-subtype=9477921910&appid=cm03d0RhXi8&gmp_app_id=1:9477921910:ios:781165feeae460b3
2019-07-09 16:48:15.925783+0800 test[32400:4248925] 6.3.0 - [Firebase/InstanceID][I-IID023002] Couldn't delete item from Keychain OSStatus: -25300 with the keychain query {
2019-07-09 16:48:15.927450+0800 test[32400:4248930] 6.3.0 - [Firebase/InstanceID][I-IID014001] Token fetch successful, token: cm03d0RhXi8:APA91bFL5dPAToKfX8UpoOPG0q3OVyV4s08ANdD18g27836hnBFPGc5maL0mg_-_ujLdKZ4nrUNUVSLr57T7kek8_W1W-99WB7CZ9VVIXu5W3iD3sjjiLpJe1kpHJhrRNv9_RJeVYA73, authorizedEntity: 9477921910, scope:*
7-09 16:48:15.927559+0800 test[32400:4248930] 6.3.0 - [Firebase/RemoteConfig][I-RCN000022] Success to get iid : cm03d0RhXi8.
2019-07-09 16:48:15.928943+0800 test[32400:4248925] 6.3.0 - [Firebase/RemoteConfig][I-RCN000024] Success to get device authentication ID: 4993161769659919742, security token: 5995301088327687490.
2019-07-09 16:48:15.928996+0800 test[32400:4248925] 6.3.0 - [Firebase/RemoteConfig][I-RCN000060] Fetch with user properties completed.
2019-07-09 16:48:15.984910+0800 test[32400:4249161] 6.3.0 - [Firebase/RemoteConfig][I-RCN000061] Fetch with user properties initiated.
2019-07-09 16:48:15.985976+0800 test[32400:4248928] 6.3.0 - [Firebase/RemoteConfig][I-RCN000040] Start config fetch.
2019-07-09 16:48:15.986154+0800 test[32400:4248928] 6.3.0 - [Firebase/RemoteConfig][I-RCN000061] Making remote config fetch.
2019-07-09 16:48:15.986285+0800 test[32400:4248928] 6.3.0 - [Firebase/RemoteConfig][I-RCN000046] Making config request: https://firebaseremoteconfig.googleapis.com/v1/projects/piano-tiles2/namespaces/firebase:fetch?key=AIzaSyCF-Lrov4eReyJun15yi98lwCaHOoOf8Ek
FireBaseUtils.mm:54 Remote instance ID token: cm03d0RhXi8:APA91bFL5dPAToKfX8UpoOPG0q3OVyV4s08ANdD18g27836hnBFPGc5maL0mg_-_ujLdKZ4nrUNUVSLr57T7kek8_W1W-99WB7CZ9VVIXu5W3iD3sjjiLpJe1kpHJhrRNv9_RJeVYA73
248927] 6.3.0 - [Firebase/InstanceID][I-IID014001] Token fetch successful, token: cm03d0RhXi8:APA91bFL5dPAToKfX8UpoOPG0q3OVyV4s08ANdD18g27836hnBFPGc5maL0mg_-_ujLdKZ4nrUNUVSLr57T7kek8_W1W-99WB7CZ9VVIXu5W3iD3sjjiLpJe1kpHJhrRNv9_RJeVYA73, authorizedEntity: 942019-07-09 16:48:16.059569+0800 test[32400:4248927] 6.3.0 - [Firebase/InstanceID][I-IID003010] Successfully fetched default token.
2019-07-09 16:48:16.059601+0800 test[32400:4248927] 6.3.0 - [Firebase/InstanceID][I-IID003008] Got default token cm03d0RhXi8:APA91bFL5dPAToKfX8UpoOPG0q3OVyV4s08ANdD18g27836hnBFPGc5maL0mg_-_ujLdKZ4nrUNUVSLr57T7kek8_W1W-99WB7CZ9VVIXu5W3iD3sjjiLpJe1kpHJhrRNv9_RJeVYA73
no Tiles 2[32400:4249161] 6.3.0 - [Firebase/RemoteConfig][I-RCN000050] config fetch completed. Error: nil StatusCode: 200
2019-07-09 16:48:16.528409+0800 test[32400:4249161] 6.3.0 - [Firebase/RemoteConfig][I-RCN000059] Updating config content from Response for namespace:firebase:__FIRAPP_DEFAULT with state: UPDATE
2019-07-09 16:48:16.528449+0800 test[32400:4249161] 6.3.0 - [Firebase/RemoteConfig][I-RCN000058] Update config in DB for namespace:firebase:__FIRAPP_DEFAULT
2019-07-09 16:48:16.531010+0800 test[32400:4249161] 6.3.0 - [Firebase/RemoteConfig][I-RCN000056] Updating metadata with fetch result.
FireBaseUtils.mm:39 Config fetched!
2019-07-09 16:48:16.822858+0800 test[32400:4248924] 6.3.0 - [Firebase/RemoteConfig][I-RCN000069] Config activated.
2019-07-09 16:48:16.823293+0800 test[32400:4248924] 6.3.0 - [Firebase/Analytics][I-ACS011005] Unable to query for conditional user properties. Analytics is disabled
2019-07-09 16:48:17.064430+0800 test[32400:4248925] 6.3.0 - [Firebase/Analytics][I-ACS023049] Analytics is disabled. Event not logged
2019-07-09 16:48:17.610177+0800 test[32400:4248873] 6.3.0 - [Firebase/Analytics][I-ACS023049] Analytics is disabled. Event not logged
2019-07-09 16:48:17.625250+0800 test[32400:4248926] 6.3.0 - [Firebase/Analytics][I-ACS023049] Analytics is disabled. Event not logged
2019-07-09 16:48:20.797995+0800 test[32400:4248927] 6.3.0 - [Firebase/Analytics][I-ACS023049] Analytics is disabled. Event not logged
2019-07-09 16:48:21.339176+0800 test[32400:4249161] 6.3.0 - [Firebase/Analytics][I-ACS023049] Analytics is disabled. Event not logged
2019-07-09 16:48:24.517753+0800 test[32400:4249301] 6.3.0 - [Firebase/Core][I-COR000020] Error posting to Clearcut: Error Domain=NSURLErrorDomain Code=-1200 "发生了 SSL 错误,无法建立与该服务器2019-07-09 16:50:26.150364+0800 test[32400:4248931] 6.3.0 - [Firebase/Analytics][I-ACS031010] Tracking view controller. Class, ID: ALAppLovinVideoViewController, -9213171355309940530
2019-07-09 16:50:26.150525+0800 test[32400:4248931] 6.3.0 - [Firebase/Analytics][I-ACS031006] View controller already tracked. Class, ID: ALAppLovinVideoViewController, -9213171355309940530
2019-07-09 16:50:26.150773+0800 test[32400:4248931] 6.3.0 - [Firebase/Analytics][I-ACS023049] Analytics is disabled. Event not logged
2019-07-09 16:51:04.346117+0800 test[32400:4250636] 6.3.0 - [Firebase/Analytics][I-ACS031010] Tracking view controller. Class, ID: RootViewController, -9213171355309940531
2019-07-09 16:51:04.346278+0800 test[32400:4250636] 6.3.0 - [Firebase/Analytics][I-ACS031006] View controller already tracked. Class, ID: RootViewController, -9213171355309940531
2019-07-09 16:51:04.346391+0800 test[32400:4250187] 6.3.0 - [Firebase/Analytics][I-ACS023049] Analytics is disabled. Event not logged
2019-07-09 16:51:04.666266+0800 test[32400:4250187] 6.3.0 - [Firebase/Analytics][I-ACS023049] Analytics is disabled. Event not logged
2019-07-09 16:51:05.713837+0800 test[32400:4250645] 6.3.0 - [Firebase/Analytics][I-ACS023049] Analytics is disabled. Event not logged
2019-07-09 16:51:06.217170+0800 test[32400:4250691] 6.3.0 - [Firebase/Analytics][I-ACS031010] Tracking view controller. Class, ID: GADFullScreenAdViewController, -9213171355309940529
2019-07-09 16:51:06.217661+0800 test[32400:4250691] 6.3.0 - [Firebase/Analytics][I-ACS001009] Ad unit exposure not logged. Exposure time was less than 1 sec
2019-07-09 16:51:06.217725+0800 test[32400:4250691] 6.3.0 - [Firebase/Analytics]2019-07-09 16:51:06.217779+0800 test[32400:4250691] 6.3.0 - [Firebase/Analytics][I-ACS031006] View controller already tracked. Class, ID: GADFullScreenAdViewController, -92132019-07-09 16:51:06.218487+0800 test[32400:4250645] 6.3.0 - [Firebase/Analytics][I-ACS031009] Set screen name and screen class: RootViewController/Rewarded, GADFullScreenAdViewController
s 2[32400:4250645] 6.3.0 - [Firebase/Analytics][I-ACS001009] Ad unit exposure not logged. Exposure time was less than 1 sec
2019-07-09 16:51:06.218633+0800 test[32400:4250645] 6.3.0 - [Firebase/Analytics][I-ACS001006] Ad exposure not logged. Expo2019-07-09 16:51:06.218781+0800 test[32400:4250645] 6.3.0 - [Firebase/Analytics][I-ACS023049] Analytics is disabled. Event not logged
2019-07-09 16:51:06.218837+0800 test[32400:4250645] 6.3.0 - [Firebase/Analytics][I-ACS023049] Analytics is disabled. Event not logged
2019-07-09 16:51:07.378418+0800 test[32400:4250636] 6.3.0 - [Firebase/Analytics][I-ACS023049] Analytics is disabled. Event not logged
2019-07-09 16:51:16.361487+0800 test[32400:4250691] 6.3.0 - [Firebase/Analytics][I-ACS023049] Analytics is disabled. Event not logged
2019-07-09 16:51:36.831209+0800 test[32400:4250692] 6.3.0 - [Firebase/Analytics][I-ACS023049] Analytics is disabled. Event not logged
2019-07-09 16:52:04.312934+0800 test[32400:4250636] 6.3.0 - [Firebase/Analytics][I-ACS031010] Tracking view controller. Class, ID: RootViewController, -9213171355309940531
2019-07-09 16:52:04.313109+0800 test[32400:4250636] 6.3.0 - [Firebase/Analytics][I-ACS031006] View controller already tracked. Class, ID: RootViewController, -9213171355309940531
2019-07-09 16:52:04.313637+0800 test[32400:4250636] 6.3.0 - [Firebase/Analytics][I-ACS023049] Analytics is disabled. Event not logged
2019-07-09 16:52:04.313768+0800 test[32400:4250982] 6.3.0 - [Firebase/Analytics][I-ACS023049] Analytics is disabled. Event not logged
2019-07-09 16:52:04.313869+0800 test[32400:4250982] 6.3.0 - [Firebase/Analytics][I-ACS023049] Analytics is disabled. Event not logged
2019-07-09 16:52:04.313986+0800 test[32400:4250982] 6.3.0 - [Firebase/Analytics][I-ACS001009] Ad unit exposure not logged. Exposure time was less than 1 sec
2019-07-09 16:52:04.314055+0800 test[32400:4250982] 6.3.0 - [Firebase/Analytics][I-ACS001006] Ad exposure not logged. Exposure time was less than 1 sec
2019-07-09 16:52:11.848636+0800 test[32400:4251164] 6.3.0 - [Firebase/Analytics][I-ACS023049] Analytics is disabled. Event not logged

analytics

Most helpful comment

sorry,Can you describe in detail how to update my sqlite version @allenktv @yanfangl

All 19 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.

Is this reproducible on multiple devices? I wonder if it's a permission or space issue on the device?

Opened b/137094514 to track internally.

Is this reproducible on multiple devices? I wonder if it's a permission or space issue on the device?

Opened b/137094514 to track internally.

I repetition this error on multiple devices.
device: iPhone 6S & iPhone X
version: iOS 12.0

I'm trying to run it on iOS 11,it works. I think something wrong on iOS 12.0

For firebase analytics IOS, I have the same problem. I can run it on IOS 10.0 but get failed to open database on IOS 12.0. So I am not sure whether the app package can work for the users with IOS 12.0 .
Is there any progress?

Does this happen every time on 12.0 devices? And also does this happen in 12.1?

Does this happen every time on 12.0 devices? And also does this happen in 12.1?

This problem occurs in iOS 12.3.1.

This project uses the cocos engine, which works fine when the reference to the sqlite3.h and sqlite3.c files in the cocos is removed. Is there any conflict between these two files and firebase analytics?

@yanfangl There could be an issue if those files have alternate implementations of the iOS sqlite system library implementation. Do you see any duplicate symbol warnings logged at load time in the Xcode console?

The sqlite version is 3.8.1 in sqlite3.c. When the version is upgraded to 3.29, it works fine. Thank you all.

For firebase analytics IOS, I have the same problem. I can run it on IOS 10.0 but get failed to open database on IOS 12.0. So I am not sure whether the app package can work for the users with IOS 12.0 .
Is there any progress?
me too

it can run in iOS11.0.1 and iOS9.3 but failed in iOS 12.2

@Liulinzhe17 As the previous comments suggest, please try upgrading your sqlite version to the latest one

sorry,Can you describe in detail how to update my sqlite version @allenktv @yanfangl

Check which sqlite version you have linked in Xcode under "Link Binary With Libraries" and use libsqlite3.0.tbd (or whatever the newest version on Xcode is).

me too sorry,Can you describe in detail how to update my sqlite version

@kule123 check in the target's Build Phases under Link Binary with Libraries.

Screen Shot 2019-08-28 at 10 11 07 AM

sorry, I try it
but dont solve this qustion

I am getting the same issue. How to fix this issue..
I am not using WCDB in my project.
It is getting error for iOS 12 devices.. Upto iOS 11 it is working fine

Was this page helpful?
0 / 5 - 0 ratings