question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Instant app crash on opening, SQLiteException: file is not a database

See original GitHub issue

Avoid duplicates

  • Bug is not mentioned in the FAQ
  • Bug is specific for Android only, for general issues / questions that apply to iOS and Android please raise them in the documentation repository
  • Bug is not already reported in another issue

Describe the bug

I click on the app icon/select “open app” in exposure settings to open the app. Main activity is shortly visible, then app crashes. No error message displayed (This differs from other bug reports). After a few tries Android suggests to uninstall the App.

Expected behaviour

No crash expected. In case it happened the app could recover by re-initializing the missing/corrupt database.

Steps to reproduce the issue

Simply open the app. The app worked fine since it was released and got auto-updated each time new releases had been available. No specific action required to break it.

Technical details

  • Mobile device: ZTE Axon 9 Pro
  • Android version: 9, Security Patch level July 1, 2020
  • App Version: 1.3.1
  • Prioritized Background Activity: On
  • Battery Power saver options turned off, “Adaptive Battery” off, CWA set as “Don’t optimize”

Possible Fix

unclear. Will try re-installing the app

Additional context

2020-10-07 11:47:35.801 2898-16555/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=de.rki.coronawarnapp/.ui.LauncherActivity bnds=[290,1500][540,1814]} from uid 10030
2020-10-07 11:47:35.824 2898-16555/? I/ZTEAppProfile: apk (de.rki.coronawarnapp) at top
2020-10-07 11:47:35.825 12616-12616/? I/i.coronawarnap: GetResourceLocales CollectLocales 
2020-10-07 11:47:35.826 12616-12616/? I/chatty: uid=10239(de.rki.coronawarnapp) identical 1 line
2020-10-07 11:47:35.826 12616-12616/? I/i.coronawarnap: GetResourceLocales CollectLocales 
2020-10-07 11:47:35.829 12616-12616/? I/i.coronawarnap: GetResourceLocales CollectLocales 
2020-10-07 11:47:35.837 2898-3257/? I/AutoScreenEnhacementManagerService: onCreate : ComponentInfo{de.rki.coronawarnapp/de.rki.coronawarnapp.ui.LauncherActivity}
2020-10-07 11:47:35.841 2898-3257/? I/AutoScreenEnhacementManagerService: onStart : ComponentInfo{de.rki.coronawarnapp/de.rki.coronawarnapp.ui.LauncherActivity}
2020-10-07 11:47:35.844 2898-3257/? I/AutoScreenEnhacementManagerService: onResume : ComponentInfo{de.rki.coronawarnapp/de.rki.coronawarnapp.ui.LauncherActivity}
2020-10-07 11:47:35.863 2898-16555/? I/ActivityManager: START u0 {cmp=de.rki.coronawarnapp/.ui.main.MainActivity} from uid 10239
2020-10-07 11:47:35.879 2898-3257/? I/AutoScreenEnhacementManagerService: onPause : ComponentInfo{de.rki.coronawarnapp/de.rki.coronawarnapp.ui.LauncherActivity}
2020-10-07 11:47:35.882 2898-16555/? I/ZTEAppProfile: apk (de.rki.coronawarnapp) at top
2020-10-07 11:47:35.901 2898-3257/? I/AutoScreenEnhacementManagerService: onCreate : ComponentInfo{de.rki.coronawarnapp/de.rki.coronawarnapp.ui.main.MainActivity}
2020-10-07 11:47:35.911 2898-3257/? I/AutoScreenEnhacementManagerService: onStart : ComponentInfo{de.rki.coronawarnapp/de.rki.coronawarnapp.ui.main.MainActivity}
2020-10-07 11:47:35.962 2898-3257/? I/AutoScreenEnhacementManagerService: onResume : ComponentInfo{de.rki.coronawarnapp/de.rki.coronawarnapp.ui.main.MainActivity}
2020-10-07 11:47:36.023 2898-2926/? I/ActivityManager: Displayed de.rki.coronawarnapp/.ui.main.MainActivity: +142ms (total +205ms)
2020-10-07 11:47:36.038 2898-3257/? I/AutoScreenEnhacementManagerService: onStop : ComponentInfo{de.rki.coronawarnapp/de.rki.coronawarnapp.ui.LauncherActivity}
2020-10-07 11:47:36.038 2898-3257/? I/AutoScreenEnhacementManagerService: onDestroy : ComponentInfo{de.rki.coronawarnapp/de.rki.coronawarnapp.ui.LauncherActivity}
2020-10-07 11:47:36.183 720-1237/? W/SurfaceFlinger: Attempting to set client state on removed layer: Splash Screen de.rki.coronawarnapp#0
2020-10-07 11:47:36.183 720-1237/? W/SurfaceFlinger: Attempting to destroy on removed layer: Splash Screen de.rki.coronawarnapp#0
2020-10-07 11:47:36.343 12616-12616/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: de.rki.coronawarnapp, PID: 12616
    net.sqlcipher.database.SQLiteException: file is not a database: , while compiling: select count(*) from sqlite_master;
        at net.sqlcipher.database.SQLiteCompiledSql.native_compile(Native Method)
        at net.sqlcipher.database.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:3)
        at net.sqlcipher.database.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:10)
        at net.sqlcipher.database.SQLiteProgram.<init>(SQLiteProgram.java:17)
        at net.sqlcipher.database.SQLiteQuery.<init>(SQLiteQuery.java:1)
        at net.sqlcipher.database.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:9)
        at net.sqlcipher.database.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:5)
        at net.sqlcipher.database.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1)
        at net.sqlcipher.database.SQLiteDatabase.keyDatabase(SQLiteDatabase.java:6)
        at net.sqlcipher.database.SQLiteDatabase.openDatabaseInternal(SQLiteDatabase.java:4)
        at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:10)
        at net.sqlcipher.database.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:8)
        at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:14)
        at net.sqlcipher.database.SupportHelper.getWritableDatabase(SupportHelper.java:1)
        at androidx.room.RoomDatabase.inTransaction(RoomDatabase.java:1)
        at androidx.room.RoomDatabase.assertNotSuspendingTransaction(RoomDatabase.java:1)
        at androidx.room.SharedSQLiteStatement.createNewStatement(SharedSQLiteStatement.java:4)
        at androidx.room.SharedSQLiteStatement.acquire(SharedSQLiteStatement.java:4)
        at de.rki.coronawarnapp.storage.tracing.TracingIntervalDao_Impl$4.call(TracingIntervalDao_Impl.java:3)
        at androidx.room.CoroutinesRoom$Companion$execute$2.invokeSuspend(CoroutinesRoom.kt:2)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:2)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:18)
        at androidx.room.TransactionExecutor$1.run(TransactionExecutor.java:1)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)
2020-10-07 11:47:36.345 2898-11086/? W/ActivityManager:   Force finishing activity de.rki.coronawarnapp/.ui.main.MainActivity
2020-10-07 11:47:36.365 2898-3224/? W/InputDispatcher: channel '99af9b1 de.rki.coronawarnapp/de.rki.coronawarnapp.ui.main.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
2020-10-07 11:47:36.365 2898-3224/? E/InputDispatcher: channel '99af9b1 de.rki.coronawarnapp/de.rki.coronawarnapp.ui.main.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
2020-10-07 11:47:36.369 2898-16555/? I/ActivityManager: Process de.rki.coronawarnapp (pid 12616) has died: vis  +99TOP 
2020-10-07 11:47:36.369 2898-16555/? I/ZTEPoint_AI_AUTOSTART_CONTROL: died processName: de.rki.coronawarnapp
2020-10-07 11:47:36.369 2898-11913/? I/WindowManager: WIN DEATH: Window{99af9b1 u0 de.rki.coronawarnapp/de.rki.coronawarnapp.ui.main.MainActivity}
2020-10-07 11:47:36.369 2898-11913/? W/InputDispatcher: Attempted to unregister already unregistered input channel '99af9b1 de.rki.coronawarnapp/de.rki.coronawarnapp.ui.main.MainActivity (server)'
2020-10-07 11:47:36.373 720-1489/? W/SurfaceFlinger: Attempting to set client state on removed layer: de.rki.coronawarnapp/de.rki.coronawarnapp.ui.main.MainActivity#0
2020-10-07 11:47:36.373 720-1489/? W/SurfaceFlinger: Attempting to destroy on removed layer: de.rki.coronawarnapp/de.rki.coronawarnapp.ui.main.MainActivity#0
2020-10-07 11:47:36.374 720-1489/? W/SurfaceFlinger: Attempting to destroy on removed layer: AppWindowToken{188a128 token=Token{936f34b ActivityRecord{bae7c1a u0 de.rki.coronawarnapp/.ui.main.MainActivity t11011}}}#0

edit: 7.10., made clear that battery saving options are turned off

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
stephankncommented, Oct 29, 2020

@heinezen Thanks for coming back on this issue. After a closer examination of the timeline it turned out that it failed actually with 1.3.0, but then app updated on same day to 1.5.0 and I got a different error for probably the same issue in #1469. I deleted CWA data. Now at 1.5.1 and it has not crashed since. As it did run for months previously without an issue nothing of statistical significance.

As the fix for the supposed root cause is in and with 1.5.1 the remaining implementation issue is fixed as well, I will close this issue also.

1reaction
daimpicommented, Oct 15, 2020

@KommX

It’s too bad, that I’ll have to reset the app. Hopefully, the test result will be negative anyways, so that no possibility to warn other people will be lost.

Even if you reset the CWA data in the app, as long as you don’t uninstall/reinstall it, your keys will still be saved in the Google Exposure Notification Framework (ENF). So if your result turns out positive, you can still request a Tele-tan from the hotline and share your keys to warn others.

Read more comments on GitHub >

github_iconTop Results From Across the Web

file is encrypted or is not a database: , while compiling
Can anyone tell me why the DB is not being opened? ... SQLiteException: file is not a database: , while compiling: select count()...
Read more >
Why do my apps keep crashing on Android, How to fix it
To do this, go to Settings -> Apps and select the app that keeps crashing. Tap on the app's name and then tap...
Read more >
SQLiteDatabase | Android Developers
If the application using SQLite crashes in the middle of a transaction when the MEMORY journaling mode is set, then the database file...
Read more >
Bug - Error when submitting app to Google Play - Unity Forum
RuntimeException: android.database.sqlite.SQLiteException: no such table: media_store_extension (code 1) I can still submit the app, ...
Read more >
Result and Error Codes - SQLite
There are only a few non-error result codes: SQLITE_OK, SQLITE_ROW, ... the file being opened does not appear to be an SQLite database...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found