Signal-Android icon indicating copy to clipboard operation
Signal-Android copied to clipboard

Signal crashes on restoring backup

Open asdfjkl opened this issue 10 months ago • 7 comments

  • [x] I have searched open and closed issues for duplicates
  • [x] I am submitting a bug report for existing functionality that does not work as intended
  • [x] I have read https://github.com/signalapp/Signal-Android/wiki/Submitting-useful-bug-reports
  • [x] This isn't a feature request or a discussion topic

Bug description

Signal crashes on restoring a (valid) backup file. In particular when starting restoring from a file backup, messages seems to be processed and imported correctly. However afterwards, Signal crashes repeatedly on startup and cannot be started anymore, i.e. Android reports that the app is crashing repeatedly responding.

I've verified that the backup is intact with 3rd party tools (signal-backup-tools). I've also verified that the passphrase is correct; in particular I was able to extract all messages with signal-backup-tools (https://github.com/bepaald/signalbackup-tools) to text format and verified that all information is present. I've also tried to (re)write the backup using backup-tools in order to check that the backup file is not corrupted.

The database version as reported from signal-backup-tools: 136 Signal-Version: 7.2.4

The backup is from 2022; so I suspect that there is some issues when handling such "old" backups. The backup contains personal information, but I am willing to help w.r.t. debugging this issue in any way I can

Steps to reproduce

  • Install Signal from scratch from the Play Store
  • Choose restore account from file backup
  • Messages are processed, but afterwards Signal won't start anymore. Only wiping/re-installing Signal helkps

Actual result: Signal crashes and can't be started anymore Expected result: Should restore the backup and start as expected

Screenshots

unfortunately I have no screenshot

Device info

Device: Pixel 6a Android version: 14 Signal version: 7.2.4

Link to debug log

signal-log-1712506609190.zip attached to this report

asdfjkl avatar Apr 07 '24 19:04 asdfjkl

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 07 '24 02:06 stale[bot]

any news on this? I think this should not be closed, as there is apparently an issue with old backups, likely affecting other users as well.

asdfjkl avatar Jun 09 '24 08:06 asdfjkl

Hey I am also having this issue. Device : Samsung Galaxy S21 FE. Backup Date : June 2022

I decided to give Signal one more try after a couple of years, and now restore won't work. Immediately after restore the app crashes. Tried restoring different backups I had, same result.

itsluminous avatar Aug 15 '24 21:08 itsluminous

Are y'all able to capture logs with adb logcat or some other tool to see what the crash is? The OP log link doesn't have any crash data in it.

cody-signal avatar Aug 16 '24 15:08 cody-signal

@cody-signal I have attached my logs here : crash_logs.zip To me it looks like a particular DB migration is failing:

08-17 03:03:08.556 13816 18959 I SignalDatabaseMigration: Successfully completed migration for version 228 in 1 ms
08-17 03:03:08.556 13816 18959 I SignalDatabaseMigration: Running migration for version 229: V229_MarkMissedCallEventsNotified. Foreign keys: false
08-17 03:03:08.556 13816 18959 E SQLiteLog: (267) statement aborts at 10: [UPDATE message
08-17 03:03:08.556 13816 18959 E SQLiteLog: SET notified = 1
08-17 03:03:08.556 13816 18959 E SQLiteLog: WHERE (type = 3) OR (type = 8)] database disk image is malformed
08-17 03:03:08.627 13816 18959 E SqlCipherErrorHandler: Database 'signal.db' corrupted!
08-17 03:03:08.627 13816 18959 E SqlCipherErrorHandler: [sqlite] FullCode: 267 | ErrorCode: 11 | ExtendedErrorCode: 1 | Message: database disk image is malformed | ExtraMessage: null
08-17 03:03:08.627 13816 18959 E SqlCipherErrorHandler: Diagnostic results:
08-17 03:03:08.627 13816 18959 E SqlCipherErrorHandler:   ===== PRAGMA integrity_check (same-connection) =====
08-17 03:03:08.627 13816 18959 E SqlCipherErrorHandler: ok
08-17 03:03:08.627 13816 18959 E SqlCipherErrorHandler: 
08-17 03:03:08.627 13816 18959 E SqlCipherErrorHandler: ===== PRAGMA cipher_integrity_check (same-connection) =====
08-17 03:03:08.627 13816 18959 E SqlCipherErrorHandler: 
08-17 03:03:08.627 13816 18959 W SearchTable: [fullyResetTables] Dropping tables and triggers...
08-17 03:03:08.629 13816 18959 W SearchTable: [fullyResetTables] Recreating table...
08-17 03:03:08.630 13816 18959 W SearchTable: [fullyResetTables] Recreating triggers...
08-17 03:03:08.632 13816 18959 I Job     : [JOB::769064ee-dc56-4e35-9288-a26a4808ea60][RebuildMessageSearchIndexJob] onSubmit() (Time Since Submission: 1 ms, Lifespan: Immortal, Run Attempt: 1/3, Queue: RebuildMessageSearchIndex)
08-17 03:03:08.632 13816 18959 W SearchTable: [fullyResetTables] Done. Index will be rebuilt asynchronously)
08-17 03:03:08.633 13816 18959 I JobManager: onConstraintMet(DataRestoreConstraint)
08-17 03:03:08.633 13816 14074 I JobRunner: [JOB::769064ee-dc56-4e35-9288-a26a4808ea60][RebuildMessageSearchIndexJob][3] Running job. (Time Since Submission: 2 ms, Lifespan: Immortal, Run Attempt: 1/3, Queue: RebuildMessageSearchIndex)
08-17 03:03:08.634 13816 14042 I JobSchedulerScheduler: JobScheduler enqueue of  (0)
08-17 03:03:08.638 13816 14074 I SearchTable: Re-indexing. Operating on ID's 1-4686 in steps of 10000.
08-17 03:03:08.638 13816 14074 I SearchTable: Reindexing ID's [1, 10001)
08-17 03:03:08.640  1526  3302 D FreecessController: org.thoughtcrime.securesms(10778) is important[18]
08-17 03:03:08.641 13816 13816 E SignalUncaughtException: java.lang.IllegalStateException: Cannot perform this operation because there is no current transaction.
08-17 03:03:08.641 13816 13816 E SignalUncaughtException: 	at net.zetetic.database.sqlcipher.SQLiteSession.throwIfNoTransaction(SQLiteSession.java:950)
08-17 03:03:08.641 13816 13816 E SignalUncaughtException: 	at net.zetetic.database.sqlcipher.SQLiteSession.endTransaction(SQLiteSession.java:402)
08-17 03:03:08.641 13816 13816 E SignalUncaughtException: 	at net.zetetic.database.sqlcipher.SQLiteDatabase.endTransaction(SQLiteDatabase.java:572)
08-17 03:03:08.641 13816 13816 E SignalUncaughtException: 	at org.signal.core.util.SQLiteDatabaseExtensionsKt.withinTransaction(SQLiteDatabaseExtensions.kt:23)
08-17 03:03:08.641 13816 13816 E SignalUncaughtException: 	at org.thoughtcrime.securesms.database.helpers.SignalDatabaseMigrations.migrate(SignalDatabaseMigrations.kt:214)
08-17 03:03:08.641 13816 13816 E SignalUncaughtException: 	at org.thoughtcrime.securesms.database.SignalDatabase.onUpgrade(SignalDatabase.kt:176)
08-17 03:03:08.641 13816 13816 E SignalUncaughtException: 	at org.thoughtcrime.securesms.database.SignalDatabase$Companion.runPostBackupRestoreTasks(SignalDatabase.kt:289)
08-17 03:03:08.641 13816 13816 E SignalUncaughtException: 	at org.thoughtcrime.securesms.restore.RestoreRepository$restoreBackupAsynchronously$2.invokeSuspend(RestoreRepository.kt:64)
08-17 03:03:08.641 13816 13816 E SignalUncaughtException: 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
08-17 03:03:08.641 13816 13816 E SignalUncaughtException: 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
08-17 03:03:08.641 13816 13816 E SignalUncaughtException: 	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
08-17 03:03:08.641 13816 13816 E SignalUncaughtException: 	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
08-17 03:03:08.641 13816 13816 E SignalUncaughtException: 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
08-17 03:03:08.641 13816 13816 E SignalUncaughtException: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:811)
08-17 03:03:08.641 13816 13816 E SignalUncaughtException: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:715)
08-17 03:03:08.641 13816 13816 E SignalUncaughtException: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:702)
08-17 03:03:08.641 13816 13816 E SignalUncaughtException: 	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@f254568, Dispatchers.Main.immediate]
08-17 03:03:08.646 13816 13816 I JobManager: Successfully flushed.

itsluminous avatar Aug 16 '24 21:08 itsluminous

something that may help in debugging -

  • The migration 229 was added in 7.6.0
  • I downloaded 7.5.2 and after restore I did not get any error. I could still not use the app as it refused to send otp for verification (got error - could not connect to service).
  • Then I downloaded 7.6.0 and got the same issue of signal crashing after db restore.

itsluminous avatar Aug 16 '24 22:08 itsluminous

Thanks for the additional information and the troubleshooting steps, we'll do our best to figure this out.

cody-signal avatar Aug 19 '24 13:08 cody-signal