Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signal crashes on DB error when migrating from very old version to 7.33 #7089

Open
2 tasks done
Tossrock opened this issue Nov 19, 2024 · 2 comments
Open
2 tasks done
Labels

Comments

@Tossrock
Copy link

Using a supported version?

  • I have searched searched open and closed issues for duplicates.
  • I am using Signal-Desktop as provided by the Signal team, not a 3rd-party package.

Overall summary

I recently revived an old Windows machine that had a Signal install on it. Opening Signal worked fine, and the old messages were still there. However, it showed a "This version is out of date, download at Signal.org" type banner and would not connect (as expected).

Once I downloaded 7.33 and tried to run it, the app crashes on startup with 100% reproducibility, citing a DB error:

Database startup error:

SqliteError: out of memory
    at Database.pragma ([REDACTED]\node_modules\@signalapp\better-sqlite3\lib\methods\pragma.js:11:31)
    at getUserVersion ([REDACTED]\ts\sql\util.js:142:13)
    at migrateSchemaVersion ([REDACTED]\ts\sql\Server.js:415:54)
    at openAndMigrateDatabase ([REDACTED]\ts\sql\Server.js:447:5)
    at openAndSetUpSQLCipher ([REDACTED]\ts\sql\Server.js:469:14)
    at initialize ([REDACTED]\ts\sql\Server.js:516:10)
    at MessagePort.<anonymous> ([REDACTED]\ts\sql\mainWorker.js:69:41)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20)
    at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)

App Version: 7.33.0
OS: win32

There are also the following lines in main.log:

{"level":40,"time":"2024-11-19T01:36:48.294Z","msg":"MainSQL: Database log code=26: file is not a database in \"PRAGMA journal_mode = WAL\""}
{"level":30,"time":"2024-11-19T01:36:48.295Z","msg":"MainSQL: migrateDatabase: Migration without cipher change failed"}
{"level":40,"time":"2024-11-19T01:36:48.295Z","msg":"MainSQL: Database log code=7: statement aborts at 2: [PRAGMA user_version] out of memory"}

Based on the log message, it seems possible the journal mode changed to WAL sometime between whatever ~2022 version I had installed, and now? And the migration tooling is unable to gracefully handle that case? Just speculating.

Steps to reproduce

  1. Have a very old install of Signal (circa 2022?) for Windows 10
  2. Have a "relatively normal" amount of messages in the DB (100s - 1000s, approx?)
  3. Update to 7.33
  4. Start the app

Expected result

Signal should not crash

Actual result

Signal crashes with a DB error, due to SQLite OOM.

Screenshots

No response

Signal version

7.33

Operating system

Windows 10

Version of Signal on your phone

No response

Link to debug log

Zipped log folder included here

7.33_migration_db_crash_logs.zip

@ayumi-signal
Copy link
Contributor

Sorry this is happening -- there were some database format changes in the past, and it's possible we can't easily migrate from it. Is it actually running out of memory based on Task Manager or does it seem to be a spurious error?

As a separate test, you could check using Signal Beta if starting from a fresh app state is working. It's safe to run concurrently on the same machine since prod and beta use separate data directories. Info: https://support.signal.org/hc/en-us/articles/360007318471-Signal-Beta

@Tossrock
Copy link
Author

There does not appear to be any unusual memory usage by any of the Signal processes
image

Peak usage hits ~350 MB for the parent process, and the machine is certainly not out of memory.

Signal Beta launches fine

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants