1

I'm using cwac-saferoom version 1.0.4 And some of the devices are getting this issue right after updating the app to a new version.

Fatal Exception: java.lang.RuntimeException: Exception while computing database live data. at androidx.room.RoomTrackingLiveData$1.run(SourceFile:6) 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)

Another part of logs from the sqlcipher itself is :

Caused by net.sqlcipher.database.SQLiteException: file is not a database: , while compiling: select count(*) from sqlite_master; at net.sqlcipher.database.SQLiteCompiledSql.native_compile(SourceFile) at net.sqlcipher.database.SQLiteCompiledSql.compile(SourceFile:3) at net.sqlcipher.database.SQLiteCompiledSql.(SourceFile:12) at net.sqlcipher.database.SQLiteProgram.(SourceFile:18) at net.sqlcipher.database.SQLiteQuery.(SourceFile:1) at net.sqlcipher.database.SQLiteDirectCursorDriver.query(SourceFile:9) at net.sqlcipher.database.SQLiteDatabase.rawQueryWithFactory(SourceFile:5) at net.sqlcipher.database.SQLiteDatabase.rawQuery(SourceFile:1) at net.sqlcipher.database.SQLiteDatabase.keyDatabase(SourceFile:6) at net.sqlcipher.database.SQLiteDatabase.openDatabaseInternal(SourceFile:4) at net.sqlcipher.database.SQLiteDatabase.openDatabase(SourceFile:10) at net.sqlcipher.database.SQLiteDatabase.openOrCreateDatabase(SourceFile:8) at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SourceFile:14) at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SourceFile:2) at com.commonsware.cwac.saferoom.Helper$OpenHelper.getWritableSupportDatabase(SourceFile:2) at com.commonsware.cwac.saferoom.Helper.getWritableDatabase(SourceFile:5) at androidx.room.RoomDatabase.createInvalidationTracker(SourceFile:25) createOpenHelper inTransaction at androidx.room.RoomDatabase.assertNotSuspendingTransaction(SourceFile:3) at androidx.room.RoomDatabase.createInvalidationTracker(SourceFile:18) createOpenHelper query at androidx.room.util.DBUtil.query(SourceFile:1) at com.myapp.MainActivity$onResume$2.onChanged(SourceFile:1) at com.myapp.MainActivity$onResume$2.call(SourceFile:1) at androidx.room.RoomTrackingLiveData$1.run(SourceFile:5) 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)

live-love
  • 48,840
  • 22
  • 240
  • 204
MaTriXy
  • 1,659
  • 1
  • 20
  • 27
  • What is different about the new app version compared to the previous one? Are you using a new version of SafeRoom, and if so, what was the old version? Are you upgrading your database schema? BTW, when posting stack traces here, you might want to de-obfuscate them. – CommonsWare Jun 05 '19 at 10:25
  • Had an older version of saferoom - 1.0.2 and moved to 1.0.4 3 days ago. At first i tried Migrating to the New Format which yielded `Caused by net.sqlcipher.database.SQLiteException: file is not a database: , while compiling: select count(*) from sqlite_master;` Trying to avoid it = i just moved to a new file name and had the db created from scratch. Still got the same results - 1 issue is the file is not a database and the second one is this – MaTriXy Jun 05 '19 at 20:44
  • 1
    1.0.2 and 1.0.4 use the same database format -- the database format change occurred between 0.x and 1.0.0. Beyond that, I don't have much to go on. "not an error" is a generic message from SQLite (not even SQLCipher, let alone SafeRoom). If you work out a reproducible test case, file an issue with it on the SafeRoom repo, and I can take a look at it. – CommonsWare Jun 05 '19 at 20:54
  • Yes, i had to migrate from 0.x to 1.x and since then the issues appeared. But since then i created a new name for the db without migration and i still get the issues stated. I will try to create a proper test case. – MaTriXy Jun 06 '19 at 06:07

1 Answers1

0

safeRoom is retired and no longer supported. Consider using sqlcipher.

https://github.com/sqlcipher/android-database-sqlcipher#using-sqlcipher-for-android-with-room

live-love
  • 48,840
  • 22
  • 240
  • 204