I had just updated from 3.8.8 (757) to 3.8.9 (759) and on launching the application, it crashes instantly.
What device logs indicate
The cause of the crash is a database upgrade failure, caused by attempting to work on a debt that has been marked as closed.
I have attached the related part of the devices log at the end.
How to fix the issue as a user
Forcefully downgraded back to 3.8.8
(Optional - Restore from a backup if required)
Browse to the Debts page
Enable "Show All"
Reopen ALL Debts which are marked as "Closed" (have a Lock icon)
(Optional - Take a backup)
Close the app & Update
Relaunch, the migration will succeed
You can go back and mark the old Debts as "Closed"
Logs for Reference
org.totschnig.myexpenses.provider.TransactionDatabase$SQLiteUpgradeFailedException: Upgrade failed 168 -> 170
at org.totschnig.myexpenses.provider.TransactionDatabase.g(TransactionDatabase.java:4205)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.onUpgrade(FrameworkSQLiteOpenHelper.kt:15)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:416)
at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:340)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.d(FrameworkSQLiteOpenHelper.kt:13)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.e(FrameworkSQLiteOpenHelper.kt:64)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.a(FrameworkSQLiteOpenHelper.kt:24)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getReadableDatabase(FrameworkSQLiteOpenHelper.kt:10)
at org.totschnig.myexpenses.provider.TransactionProvider.query(TransactionProvider.java:2)
at android.content.ContentProvider.query(ContentProvider.java:1420)
at android.content.ContentProvider.query(ContentProvider.java:1516)
at android.content.ContentProvider$Transport.query(ContentProvider.java:277)
at android.content.ContentResolver.query(ContentResolver.java:1221)
at android.content.ContentResolver.query(ContentResolver.java:1152)
at android.content.ContentResolver.query(ContentResolver.java:1108)
at H1.a.run(Query.kt:13)
at app.cash.copper.flow.FlowContentResolver$mapToList$$inlined$transform$1$1$lambda$1.invokeSuspend(FlowContentResolver.kt:12)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:9)
at kotlinx.coroutines.S.run(DispatchedTask.kt:107)
at Z9.h$a.run(LimitedDispatcher.kt:4)
at ba.g.run(Tasks.kt:3)
at kotlinx.coroutines.scheduling.CoroutineScheduler$b.run(CoroutineScheduler.kt:93)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [D0{Cancelling}@b712e07, Dispatchers.Main.immediate]
Caused by: android.database.sqlite.SQLiteConstraintException: attempt to update sealed debt (code 1811 SQLITE_CONSTRAINT_TRIGGER)
at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(Native Method)
at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:892)
at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:756)
at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:67)
at androidx.sqlite.db.framework.FrameworkSQLiteDatabase.update(FrameworkSQLiteDatabase.kt:148)
at org.totschnig.myexpenses.provider.y.w(MoreDbUtils.kt:22)
at org.totschnig.myexpenses.provider.h.V(BaseTransactionDatabase.kt:92)
at org.totschnig.myexpenses.provider.TransactionDatabase.g(TransactionDatabase.java:4191)
... 21 more
Brief Intro
I had just updated from 3.8.8 (757) to 3.8.9 (759) and on launching the application, it crashes instantly.
What device logs indicate
The cause of the crash is a database upgrade failure, caused by attempting to work on a debt that has been marked as closed. I have attached the related part of the devices log at the end.
How to fix the issue as a user
Logs for Reference