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

v7.24.1 is Breaking database #7029

Open
2 tasks done
ampeditile opened this issue Sep 26, 2024 · 26 comments
Open
2 tasks done

v7.24.1 is Breaking database #7029

ampeditile opened this issue Sep 26, 2024 · 26 comments

Comments

@ampeditile
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

After updating to 7.24.1 first close of Signal breaking database.

app.log:

{"level":30,"time":"2024-09-26T19:54:11.581Z","msg":"Profile Service initialized"}
{"level":30,"time":"2024-09-26T19:54:11.772Z","msg":"libsignal net environment resolved to [Production]"}
{"level":30,"time":"2024-09-26T19:54:11.791Z","msg":"preload complete"}
{"level":30,"time":"2024-09-26T19:54:11.792Z","msg":"@signalapp/libsignal-client Initializing libsignal version:0.55.1 signal_node::logging rust/bridge/node/src/logging.rs:206"}
{"level":30,"time":"2024-09-26T19:54:11.792Z","msg":"@signalapp/libsignal-client Initializing connection manager for Prod... libsignal_bridge_types::net rust/bridge/shared/types/src/net.rs:74"}
{"level":30,"time":"2024-09-26T19:54:11.836Z","msg":"NotificationService initialized"}
{"level":50,"time":"2024-09-26T19:54:11.852Z","msg":"Top-level unhandled promise rejection: TypeError: Cannot destructure property 'getIsInCall' of 'window.Events' as it is undefined.\n    at IpcRenderer.<anonymous> ([REDACTED]/resources/app.asar/preload.bundle.js:80:24766)\n    at IpcRenderer.emit (node:events:519:28)\n    at Object.onMessage (node:electron/js2c/renderer_init:2:8944)"}

main.log:

{"level":30,"time":"2024-09-26T19:54:10.278Z","msg":"got fast localeOverride setting null"}
{"level":30,"time":"2024-09-26T19:54:10.279Z","msg":"app.ready: hour cycle preference: UnknownPreference"}
{"level":30,"time":"2024-09-26T19:54:10.279Z","msg":"app.ready: preferred system locales: en-US, en"}
{"level":30,"time":"2024-09-26T19:54:10.280Z","msg":"locale: Supported locales: af-ZA, ar, az-AZ, bg-BG, bn-BD, bs-BA, ca, cs, da, de, el, en, es, et-EE, eu, fa-IR, fi, fr, ga-IE, gl-ES, gu-IN, he, hi-IN, hr-HR, hu, id, it, ja, ka-GE, kk-KZ, km-KH, kn-IN, ko, ky-KG, lt-LT, lv-LV, mk-MK, ml-IN, mr-IN, ms, my, nb, nl, pa-IN, pl, pt-BR, pt-PT, ro-RO, ru, sk-SK, sl-SI, sq-AL, sr, sv, sw, ta-IN, te-IN, th, tl-PH, tr, ug, uk-UA, ur, vi, yue, zh-CN, zh-HK, zh-Hant"}
{"level":30,"time":"2024-09-26T19:54:10.280Z","msg":"locale: Preferred locales: en-US, en"}
{"level":30,"time":"2024-09-26T19:54:10.280Z","msg":"locale: Locale Override: null"}
{"level":30,"time":"2024-09-26T19:54:10.282Z","msg":"locale: Matched locale: en"}
{"level":40,"time":"2024-09-26T19:54:10.312Z","msg":"intl.onWarn [@formatjs/intl] \"defaultRichTextElements\" was specified but \"message\" was not pre-compiled. \nPlease consider using \"@formatjs/cli\" to pre-compile your messages for performance.\nFor more details see https://formatjs.io/docs/getting-started/message-distribution"}
{"level":30,"time":"2024-09-26T19:54:10.312Z","msg":"locale: Text info direction for en: ltr"}
{"level":30,"time":"2024-09-26T19:54:10.313Z","msg":"getSQLKey: decrypting key"}
{"level":30,"time":"2024-09-26T19:54:10.313Z","msg":"getSystemTraySetting got value DoNotUseSystemTray"}
{"level":30,"time":"2024-09-26T19:54:10.314Z","msg":"getSystemTraySetting returning DoNotUseSystemTray"}
{"level":30,"time":"2024-09-26T19:54:10.315Z","msg":"app ready"}
{"level":30,"time":"2024-09-26T19:54:10.315Z","msg":"starting version 7.24.1"}
{"level":30,"time":"2024-09-26T19:54:10.315Z","msg":"media access status [object Undefined] [object Undefined]"}
{"level":30,"time":"2024-09-26T19:54:10.317Z","msg":"got fast theme-setting value system"}
{"level":30,"time":"2024-09-26T19:54:10.328Z","msg":"got fast theme-setting value system"}
{"level":30,"time":"2024-09-26T19:54:10.328Z","msg":"got fast spellcheck setting true"}
{"level":30,"time":"2024-09-26T19:54:10.328Z","msg":"Initializing BrowserWindow config: {\"show\":false,\"width\":1027,\"height\":1080,\"minWidth\":300,\"minHeight\":200,\"autoHideMenuBar\":false,\"titleBarStyle\":\"default\",\"backgroundColor\":\"#3a76f0\",\"webPreferences\":{\"devTools\":false,\"spellcheck\":true,\"enableBlinkFeatures\":\"CSSPseudoDir,CSSLogical\",\"enablePreferredSizeMode\":true,\"nodeIntegration\":false,\"nodeIntegrationInWorker\":false,\"sandbox\":false,\"contextIsolation\":true,\"preload\":\"[REDACTED]/preload.bundle.js\",\"backgroundThrottling\":true,\"disableBlinkFeatures\":\"Accelerated2dCanvas,AcceleratedSmallCanvases\"},\"icon\":\"[REDACTED]/images/signal-logo-desktop-linux.png\",\"x\":0,\"y\":0}"}
{"level":30,"time":"2024-09-26T19:54:10.368Z","msg":"spellcheck: user locales: [\"en-US\",\"en\"]"}
{"level":30,"time":"2024-09-26T19:54:10.368Z","msg":"spellcheck: available spellchecker languages: [\"af\",\"bg\",\"ca\",\"cs\",\"cy\",\"da\",\"de\",\"de-DE\",\"el\",\"en\",\"en-AU\",\"en-CA\",\"en-GB\",\"en-GB-oxendict\",\"en-US\",\"es\",\"es-419\",\"es-AR\",\"es-ES\",\"es-MX\",\"es-US\",\"et\",\"fa\",\"fo\",\"fr\",\"fr-FR\",\"he\",\"hi\",\"hr\",\"hu\",\"hy\",\"id\",\"it\",\"it-IT\",\"ko\",\"lt\",\"lv\",\"nb\",\"nl\",\"pl\",\"pt\",\"pt-BR\",\"pt-PT\",\"ro\",\"ru\",\"sh\",\"sk\",\"sl\",\"sq\",\"sr\",\"sv\",\"ta\",\"tg\",\"tr\",\"uk\",\"vi\"]"}
{"level":30,"time":"2024-09-26T19:54:10.368Z","msg":"spellcheck: setting languages to: [\"en-US\",\"en\"]"}
{"level":40,"time":"2024-09-26T19:54:10.580Z","msg":"MainSQL: Database log code=26: file is not a database in \"PRAGMA journal_mode = WAL\""}
{"level":30,"time":"2024-09-26T19:54:10.580Z","msg":"MainSQL: migrateDatabase: Migration without cipher change failed"}
{"level":40,"time":"2024-09-26T19:54:10.639Z","msg":"MainSQL: Database log code=26: statement aborts at 2: [PRAGMA user_version] file is not a database"}
{"level":50,"time":"2024-09-26T19:54:10.640Z","msg":"MainSQL: Database startup error: SqliteError: file is not a database\n    at Database.pragma ([REDACTED]/node_modules/@signalapp/better-sqlite3/lib/methods/pragma.js:11:31)\n    at getUserVersion ([REDACTED]/ts/sql/util.js:132:13)\n    at migrateSchemaVersion ([REDACTED]/ts/sql/Server.js:404:54)\n    at openAndMigrateDatabase ([REDACTED]/ts/sql/Server.js:436:5)\n    at openAndSetUpSQLCipher ([REDACTED]/ts/sql/Server.js:458:14)\n    at initialize ([REDACTED]/ts/sql/Server.js:496:10)\n    at MessagePort.<anonymous> ([REDACTED]/ts/sql/mainWorker.js:69:41)\n    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20)\n    at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)"}
{"level":50,"time":"2024-09-26T19:54:10.640Z","msg":"Failed to get zoom factor {\"name\":\"SqliteError\"}"}
{"level":30,"time":"2024-09-26T19:54:11.143Z","msg":"got fast theme-setting value system"}
{"level":50,"time":"2024-09-26T19:54:11.836Z","msg":"sql.initialize was unsuccessful; returning early"}
{"level":30,"time":"2024-09-26T19:54:11.837Z","msg":"close event {\"readyForShutdown\":false,\"shouldQuit\":false}"}
{"level":30,"time":"2024-09-26T19:54:11.837Z","msg":"maybeRequestCloseConfirmation: Checking to see if close confirmation is needed"}
{"level":50,"time":"2024-09-26T19:54:13.222Z","msg":"onDatabaseError: Quitting application"}
{"level":30,"time":"2024-09-26T19:54:13.224Z","msg":"main window closed event"}
{"level":30,"time":"2024-09-26T19:54:13.225Z","msg":"quit event {\"hasEventBeenPrevented\":false,\"windowCount\":0,\"mainWindowExists\":false}"}
{"level":50,"time":"2024-09-26T19:54:13.226Z","msg":"Error occurred in handler for 'sql-channel:read': {\"name\":\"SqliteError\"}"}

I see new file config.json

{
  "encryptedKey": "**********************************59dda3d8b110*******",
  "safeStorageBackend": "gnome_libsecret"
}

In same time after first closure ~1h DB is broken. What goings on? Also another user have same experience: #7025 Is anybody here got same?
For example I DON'T HAVE SAVED PHONE NUMBER COZ IT BEEN TEMPORALLY PHONE NUMBER. I DON'T USE SIGNAL ON PHONE TOO TO RECOVER IT.

Steps to reproduce

  1. Update Signal to v7.24.1
  2. Open Signal
  3. Send message
  4. Close
  5. Reboot PC
  6. Open again

Expected result

Signal must open DB

Actual result

DB is broken

Screenshots

No response

Signal version

7.24.1

Operating system

Ubuntu 24.04

Version of Signal on your phone

No response

Link to debug log

No response

@toppk
Copy link

toppk commented Sep 26, 2024

seeing this too.

{"level":40,"time":"2024-09-26T22:41:46.309Z","msg":"MainSQL: Database log code=26: file is not a database in \"PRAGMA journal_mode = WAL\""}
{"level":30,"time":"2024-09-26T22:41:46.309Z","msg":"MainSQL: migrateDatabase: Migration without cipher change failed"}
{"level":40,"time":"2024-09-26T22:41:46.379Z","msg":"MainSQL: Database log code=26: statement aborts at 2: [PRAGMA user_version] file is not a database"}
{"level":50,"time":"2024-09-26T22:41:46.380Z","msg":"MainSQL: Database startup error: SqliteError: file is not a database\n    at Database.pragma ([REDACTED]/node_modules/@signalapp/better-sqlite3/lib/methods/pragma.js:11:31)\n    at getUserVersion ([REDACTED]/ts/sql/util.js:132:13)\n    at migrateSchemaVersion ([REDACTED]/ts/sql/Server.js:387:54)\n    at openAndMigrateDatabase ([REDACTED]/ts/sql/Server.js:419:5)\n    at openAndSetUpSQLCipher ([REDACTED]/ts/sql/Server.js:441:14)\n    at initialize ([REDACTED]/ts/sql/Server.js:479:10)\n    at MessagePort.<anonymous> ([REDACTED]/ts/sql/mainWorker.js:89:41)\n    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20)\n    at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)"}

@scottnonnenberg-signal
Copy link
Contributor

Hi there, @ampeditile. First, you reference the user in #7025 - their issue is true database corruption, because of log lines like this:

WARN  2024-09-25T04:26:03.995Z MainSQL: Database log code=779: index corruption at line 100056 of [c9c2ab54ba]
WARN  2024-09-25T04:26:04.079Z MainSQL: Database log code=11: database corruption at line 89012 of [c9c2ab54ba]

From your log, it looks more like your decryption key is wrong. What can you say about the history of Signal Desktop on your computer? I see that gnome_libsecret is in your config file - are you always running it in Gnome? If you run it outside of Gnome, you'll see that error. If you ever run it in a way where it doesn't have access to that protected store, it will show that error.

@scottnonnenberg-signal
Copy link
Contributor

@toppk What do you see in your config.json file? What protected data store did Signal try to use for you? Why doesn't it have access to that protected store now?

@toppk
Copy link

toppk commented Sep 26, 2024

@toppk What do you see in your config.json file? What protected data store did Signal try to use for you? Why doesn't it have access to that protected store now?

I had gnome_libsecret, I put the following into the flathub issue for other people hitting this. So I was able to recover/downgrade and seem to be back up and running. I hope signal pulls this release since there's more people that are going to hit this without any backups.

i will give my recovery instructions. First, my recovery involves having backup, sorry if that excludes you. I don't think my backup was too recent, so take a look. Second there's a bit about database schema in here, that was something that you'll have to be aware of if you're lucky enough to fix the encryption issue. When you downgrade signal to and older version which is prudent until signal.org gives much better clarity how to avoid this issue, you may overshoot and install a version of signal that is incompatible with the database. But you'll see this after you get past the encryption hurdle if it is relevant. I think it's safe to just go back to a early version well before the scary 7.24.2 times, this is because there's a schema check in the code, that you'll see how to deal with in step 6. I won't recommend a version, because i don't understand much about the schema update process, but I went back to a month or so ago version.

  1. list old flatpaks with flatpak remote-info --log flathub org.signal.Signal
  2. install old flatpaks with flatpak update --commit $COMMIT_VALUE org.signal.Signal this has to be done as root
  3. backup your Database existing signal tar -cvzf ~/signal-bu.tgz ~/.var/app/org.signal.Signal (do no harm)
  4. Look at your current/backups settings in .var/app/org.signal.Signal/config/Signal/config.json basically replace those bad fields with the good fields and things should be be working again, almost.

current(BAD)

  "encryptedKey": "not_this_time_NSA",
  "safeStorageBackend": "gnome_libsecret"

backup(GOOD)

  "key": "not_this_time_NSA",
  1. Everything is good and working again, no more Database startup error: SqliteError: file is not a database errors, or...
  2. You might see now see this Database startup error: DBVersionFromFutureError: SQL: User version is 1190 but the expected maximum version is 1130. startup error. What I did to correctly go to the minimum required version is just look at this directory and just switch git tags until you find the earliest release that has your needed scema https://github.com/signalapp/Signal-Desktop/tree/v7.24.0/ts/sql/migrations Once you find a version you want repeat steps 1 and 2.

Hopefully this works for you, I am totally shocked that signal and/or flathub hasn't pulled this release, or explained it, because I didn't need to go through this scare. Please warn your friends not to update their flatpak and take an immediately backup of their ~/.var/app/org.signal.Signal directory. credits to @brettk-git @frans-fuerst for adding useful bits of info in other issues that made me feel like a full recovery was possible.

@phavel
Copy link

phavel commented Sep 27, 2024

flathub/org.signal.Signal#723

@BentHaase
Copy link

BentHaase commented Sep 27, 2024

flathub/org.signal.Signal#723

tl;dr for anyone experiencing this -> if you don't have a recent backup of your Signal folder your data is permanently lost.

@chinchan54
Copy link

chinchan54 commented Sep 27, 2024

I managed to fix it by first doing what @toppk said about reverting the key.
Then when updating the Signal flatpak back to 7.24.1 it says this:

New org.signal.Signal permissions:
    dbus access [1]

    [1] org.freedesktop.secrets

So after updating I used Flatseal to remove the "org.freedesktop.secrets" permission and now Signal works on 7.24.1.
It seems like this permission changes the key settings in config.json and then Signal can't open the database anymore.

@minosimo
Copy link

I have added some simplified recovery instructions here: https://community.signalusers.org/t/warning-do-not-update-from-flathub-database-error/63222

@dominikzogg
Copy link

And gnome_libsecret does not work. Close it and database is broken again. At leas with flatpak, but the flatpak itself looks correct. other tools using gnome_libsecret work fine.

@bermeitinger-b
Copy link

For the Flathub version, it will use --password-store=basic as default. If you want to use your host's keyring, you have to tell it with environment variable SIGNAL_PASSWORD_STORE=gnome-libsecret (yes, with a dash!) to use e.g. the Gnome Keyring.

Keep the discussion here to the official Signal version. If your issue is related to Flathub, please move the discussion to https://github.com/flathub/org.signal.Signal/issues .

@Captainpast
Copy link

I'm also using the Flathub version but, adding flatpak run org.signal.Signal --password-store=gnome-libsecret solved the problem and this is the solution by the Error-Dialog.
Why is Signal directing the error and provides a solution, and not just switches to "gnome-libsecret"?
Or is this a Dialog by Flathub?

@A6GibKm
Copy link

A6GibKm commented Sep 28, 2024

The dialog is flathub's. See the issue/mr downstream for its rationale.

@bermeitinger-b
Copy link

Depends which dialog you mean. In flatpak, it can't "just switch to 'gnome-libsecret'" automatically because it can't find which backend is available. You can see the result of this in this thread: broken databases.

Flathub will show you in info when the SIGNAL_PASSWORD_STORE variable is set to basic (which is the default) and you never started Signal in the first place (no config.json exists).

Then, there are other dialogues which could come from Signal: it detects that it previously used gnome-libsecret to encrypt the key but the current setting is different (e.g. basic).
Another dialogue could happen if the encryption was correct but it couldn't retrieve the key (the main error message for this whole thread).

@egabosh
Copy link

egabosh commented Sep 30, 2024

Moin,
similar problems here

$ flatpak run --branch=stable --arch=x86_64 --command=signal-desktop --file-forwarding org.signal.Signal @@u %U @@
Debug: Will run signal with the following arguments:
Debug: Additionally, user gave: %U
Set Windows Application User Model ID (AUMID) { AUMID: 'org.whispersystems.signal-desktop' }
NODE_ENV production
NODE_CONFIG_DIR /app/Signal/resources/app.asar/config
NODE_CONFIG {}
ALLOW_CONFIG_MUTATIONS undefined
HOSTNAME hostname
NODE_APP_INSTANCE undefined
SUPPRESS_NO_CONFIG_WARNING undefined
SIGNAL_ENABLE_HTTP undefined
userData: /home/olli/.var/app/org.signal.Signal/config/Signal
config/get: Successfully read user config file
config/get: Successfully read ephemeral config file
making app single instance
LaunchProcess: failed to execvp:
xdg-settings
LaunchProcess: failed to execvp:
xdg-settings
Gtk-Message: 11:54:37.938: Failed to load module "xapp-gtk3-module"
{"level":30,"time":"2024-09-30T09:54:39.105Z","msg":"got fast localeOverride setting null"}
{"level":30,"time":"2024-09-30T09:54:39.107Z","msg":"app.ready: hour cycle preference: UnknownPreference"}
{"level":30,"time":"2024-09-30T09:54:39.110Z","msg":"app.ready: preferred system locales: de-DE, de"}
{"level":30,"time":"2024-09-30T09:54:39.114Z","msg":"locale: Supported locales: af-ZA, ar, az-AZ, bg-BG, bn-BD, bs-BA, ca, cs, da, de, el, en, es, et-EE, eu, fa-IR, fi, fr, ga-IE, gl-ES, gu-IN, he, hi-IN, hr-HR, hu, id, it, ja, ka-GE, kk-KZ, km-KH, kn-IN, ko, ky-KG, lt-LT, lv-LV, mk-MK, ml-IN, mr-IN, ms, my, nb, nl, pa-IN, pl, pt-BR, pt-PT, ro-RO, ru, sk-SK, sl-SI, sq-AL, sr, sv, sw, ta-IN, te-IN, th, tl-PH, tr, ug, uk-UA, ur, vi, yue, zh-CN, zh-HK, zh-Hant"}
{"level":30,"time":"2024-09-30T09:54:39.114Z","msg":"locale: Preferred locales: de-DE, de"}
{"level":30,"time":"2024-09-30T09:54:39.116Z","msg":"locale: Locale Override: null"}
{"level":30,"time":"2024-09-30T09:54:39.162Z","msg":"locale: Matched locale: de"}
{"level":40,"time":"2024-09-30T09:54:39.340Z","msg":"intl.onWarn [@formatjs/intl] \"defaultRichTextElements\" was specified but \"message\" was not pre-compiled. \nPlease consider using \"@formatjs/cli\" to pre-compile your messages for performance.\nFor more details see https://formatjs.io/docs/getting-started/message-distribution"}
{"level":30,"time":"2024-09-30T09:54:39.346Z","msg":"locale: Text info direction for de: ltr"}
{"level":30,"time":"2024-09-30T09:54:39.347Z","msg":"getSQLKey: using legacy key"}
{"level":30,"time":"2024-09-30T09:54:39.349Z","msg":"getSystemTraySetting got value DoNotUseSystemTray"}
{"level":30,"time":"2024-09-30T09:54:39.349Z","msg":"getSystemTraySetting returning DoNotUseSystemTray"}
{"level":30,"time":"2024-09-30T09:54:39.364Z","msg":"app ready"}
{"level":30,"time":"2024-09-30T09:54:39.365Z","msg":"starting version 7.24.1"}
{"level":30,"time":"2024-09-30T09:54:39.366Z","msg":"media access status [object Undefined] [object Undefined]"}
{"level":30,"time":"2024-09-30T09:54:39.374Z","msg":"got fast theme-setting value system"}
{"level":30,"time":"2024-09-30T09:54:39.431Z","msg":"got fast theme-setting value system"}
{"level":30,"time":"2024-09-30T09:54:39.431Z","msg":"got fast spellcheck setting true"}
{"level":30,"time":"2024-09-30T09:54:39.433Z","msg":"Initializing BrowserWindow config: {\"show\":false,\"width\":960,\"height\":481,\"minWidth\":300,\"minHeight\":200,\"autoHideMenuBar\":false,\"titleBarStyle\":\"default\",\"backgroundColor\":\"#121212\",\"webPreferences\":{\"devTools\":false,\"spellcheck\":true,\"enableBlinkFeatures\":\"CSSPseudoDir,CSSLogical\",\"enablePreferredSizeMode\":true,\"nodeIntegration\":false,\"nodeIntegrationInWorker\":false,\"sandbox\":false,\"contextIsolation\":true,\"preload\":\"[REDACTED]/preload.bundle.js\",\"backgroundThrottling\":true,\"disableBlinkFeatures\":\"Accelerated2dCanvas,AcceleratedSmallCanvases\"},\"icon\":\"[REDACTED]/images/signal-logo-desktop-linux.png\",\"x\":0,\"y\":32}"}
{"level":30,"time":"2024-09-30T09:54:39.774Z","msg":"spellcheck: user locales: [\"de-DE\",\"de\"]"}
{"level":30,"time":"2024-09-30T09:54:39.777Z","msg":"spellcheck: available spellchecker languages: [\"af\",\"bg\",\"ca\",\"cs\",\"cy\",\"da\",\"de\",\"de-DE\",\"el\",\"en\",\"en-AU\",\"en-CA\",\"en-GB\",\"en-GB-oxendict\",\"en-US\",\"es\",\"es-419\",\"es-AR\",\"es-ES\",\"es-MX\",\"es-US\",\"et\",\"fa\",\"fo\",\"fr\",\"fr-FR\",\"he\",\"hi\",\"hr\",\"hu\",\"hy\",\"id\",\"it\",\"it-IT\",\"ko\",\"lt\",\"lv\",\"nb\",\"nl\",\"pl\",\"pt\",\"pt-BR\",\"pt-PT\",\"ro\",\"ru\",\"sh\",\"sk\",\"sl\",\"sq\",\"sr\",\"sv\",\"ta\",\"tg\",\"tr\",\"uk\",\"vi\"]"}
{"level":30,"time":"2024-09-30T09:54:39.778Z","msg":"spellcheck: setting languages to: [\"de-DE\",\"de\"]"}
2024-09-30 11:54:40.441: ERROR CORE sqlcipher_page_cipher: hmac check failed for pgno=1
2024-09-30 11:54:40.441: ERROR CORE sqlite3Codec: error decrypting page 1 data: 1
2024-09-30 11:54:40.441: ERROR CORE sqlcipher_codec_ctx_set_error 1
{"level":40,"time":"2024-09-30T09:54:40.442Z","msg":"MainSQL: Database log code=26: file is not a database in \"PRAGMA journal_mode = WAL\""}
{"level":30,"time":"2024-09-30T09:54:40.442Z","msg":"MainSQL: migrateDatabase: Migration without cipher change failed"}
2024-09-30 11:54:40.534: ERROR CORE sqlcipher_page_cipher: hmac check failed for pgno=1
2024-09-30 11:54:40.534: ERROR CORE sqlite3Codec: error decrypting page 1 data: 1
2024-09-30 11:54:40.534: ERROR CORE sqlcipher_codec_ctx_set_error 1
{"level":40,"time":"2024-09-30T09:54:40.535Z","msg":"MainSQL: Database log code=26: statement aborts at 2: [PRAGMA user_version] file is not a database"}
{"level":50,"time":"2024-09-30T09:54:40.536Z","msg":"MainSQL: Database startup error: SqliteError: file is not a database\n    at Database.pragma ([REDACTED]/node_modules/@signalapp/better-sqlite3/lib/methods/pragma.js:11:31)\n    at getUserVersion ([REDACTED]/ts/sql/util.js:132:13)\n    at migrateSchemaVersion ([REDACTED]/ts/sql/Server.js:404:54)\n    at openAndMigrateDatabase ([REDACTED]/ts/sql/Server.js:436:5)\n    at openAndSetUpSQLCipher ([REDACTED]/ts/sql/Server.js:458:14)\n    at initialize ([REDACTED]/ts/sql/Server.js:496:10)\n    at MessagePort.<anonymous> ([REDACTED]/ts/sql/mainWorker.js:69:41)\n    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20)\n    at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)"}
{"level":50,"time":"2024-09-30T09:54:40.536Z","msg":"Failed to get zoom factor {\"name\":\"SqliteError\"}"}
{"level":30,"time":"2024-09-30T09:54:41.319Z","msg":"got fast theme-setting value system"}
{"level":50,"time":"2024-09-30T09:54:42.421Z","msg":"sql.initialize was unsuccessful; returning early"}
{"level":30,"time":"2024-09-30T09:54:42.422Z","msg":"close event {\"readyForShutdown\":false,\"shouldQuit\":false}"}
{"level":30,"time":"2024-09-30T09:54:42.423Z","msg":"maybeRequestCloseConfirmation: Checking to see if close confirmation is needed"}
{"level":50,"time":"2024-09-30T09:54:45.001Z","msg":"onDatabaseError: Quitting application"}
{"level":30,"time":"2024-09-30T09:54:45.004Z","msg":"main window closed event"}
{"level":30,"time":"2024-09-30T09:54:45.006Z","msg":"quit event {\"hasEventBeenPrevented\":false,\"windowCount\":0,\"mainWindowExists\":false}"}
{"level":50,"time":"2024-09-30T09:54:45.009Z","msg":"Error occurred in handler for 'sql-channel:read': {\"name\":\"SqliteError\"}"}

A bit strange is, that 7.24.1 is fine on an other device (both flatpaks)

@bermeitinger-b
Copy link

I don't think you're up-to-date.

@egabosh
Copy link

egabosh commented Sep 30, 2024

I don't think you're up-to-date.

Both devices have the flatpak with 7.24.1 installed.

@turmanticant
Copy link

turmanticant commented Sep 30, 2024

I am also seeing this error. I am also on version 7.24.1.

flatpak run org.signal.Signal --password-store=gnome-libsecret
Debug: Using password store: basic
Debug: Will run signal with the following arguments: --password-store=basic
Debug: Additionally, user gave: --password-store=gnome-libsecret
Set Windows Application User Model ID (AUMID) { AUMID: 'org.whispersystems.signal-desktop' }
NODE_ENV production
NODE_CONFIG_DIR /app/Signal/resources/app.asar/config
NODE_CONFIG {}
ALLOW_CONFIG_MUTATIONS undefined
HOSTNAME phobos
NODE_APP_INSTANCE undefined
SUPPRESS_NO_CONFIG_WARNING undefined
SIGNAL_ENABLE_HTTP undefined
userData: /home/monolith/.var/app/org.signal.Signal/config/Signal
config/get: Successfully read user config file
config/get: Successfully read ephemeral config file
making app single instance
LaunchProcess: failed to execvp:
xdg-settings
LaunchProcess: failed to execvp:
xdg-settings
Gtk-Message: 15:44:08.130: Failed to load module "canberra-gtk-module"
Gtk-Message: 15:44:08.130: Failed to load module "pk-gtk-module"
Gtk-Message: 15:44:08.131: Failed to load module "canberra-gtk-module"
Gtk-Message: 15:44:08.131: Failed to load module "pk-gtk-module"
{"level":30,"time":"2024-09-30T19:44:08.262Z","msg":"got fast localeOverride setting null"}
{"level":30,"time":"2024-09-30T19:44:08.263Z","msg":"app.ready: hour cycle preference: UnknownPreference"}
{"level":30,"time":"2024-09-30T19:44:08.263Z","msg":"app.ready: preferred system locales: en-US, en"}
{"level":30,"time":"2024-09-30T19:44:08.263Z","msg":"locale: Supported locales: af-ZA, ar, az-AZ, bg-BG, bn-BD, bs-BA, ca, cs, da, de, el, en, es, et-EE, eu, fa-IR, fi, fr, ga-IE, gl-ES, gu-IN, he, hi-IN, hr-HR, hu, id, it, ja, ka-GE, kk-KZ, km-KH, kn-IN, ko, ky-KG, lt-LT, lv-LV, mk-MK, ml-IN, mr-IN, ms, my, nb, nl, pa-IN, pl, pt-BR, pt-PT, ro-RO, ru, sk-SK, sl-SI, sq-AL, sr, sv, sw, ta-IN, te-IN, th, tl-PH, tr, ug, uk-UA, ur, vi, yue, zh-CN, zh-HK, zh-Hant"}
{"level":30,"time":"2024-09-30T19:44:08.263Z","msg":"locale: Preferred locales: en-US, en"}
{"level":30,"time":"2024-09-30T19:44:08.263Z","msg":"locale: Locale Override: null"}
{"level":30,"time":"2024-09-30T19:44:08.264Z","msg":"locale: Matched locale: en"}
{"level":40,"time":"2024-09-30T19:44:08.284Z","msg":"intl.onWarn [@formatjs/intl] \"defaultRichTextElements\" was specified but \"message\" was not pre-compiled. \nPlease consider using \"@formatjs/cli\" to pre-compile your messages for performance.\nFor more details see https://formatjs.io/docs/getting-started/message-distribution"}
{"level":30,"time":"2024-09-30T19:44:08.285Z","msg":"locale: Text info direction for en: ltr"}
{"level":30,"time":"2024-09-30T19:44:08.285Z","msg":"getSQLKey: decrypting key"}
{"level":30,"time":"2024-09-30T19:44:08.285Z","msg":"getSystemTraySetting got value DoNotUseSystemTray"}
{"level":30,"time":"2024-09-30T19:44:08.285Z","msg":"getSystemTraySetting returning DoNotUseSystemTray"}
{"level":30,"time":"2024-09-30T19:44:08.286Z","msg":"app ready"}
{"level":30,"time":"2024-09-30T19:44:08.286Z","msg":"starting version 7.24.1"}
{"level":30,"time":"2024-09-30T19:44:08.286Z","msg":"media access status [object Undefined] [object Undefined]"}
{"level":30,"time":"2024-09-30T19:44:08.288Z","msg":"got fast theme-setting value system"}
{"level":30,"time":"2024-09-30T19:44:08.297Z","msg":"got fast theme-setting value system"}
{"level":30,"time":"2024-09-30T19:44:08.298Z","msg":"got fast spellcheck setting true"}
{"level":30,"time":"2024-09-30T19:44:08.298Z","msg":"Initializing BrowserWindow config: {\"show\":false,\"width\":960,\"height\":1095,\"minWidth\":300,\"minHeight\":200,\"autoHideMenuBar\":true,\"titleBarStyle\":\"default\",\"backgroundColor\":\"#121212\",\"webPreferences\":{\"devTools\":false,\"spellcheck\":true,\"enableBlinkFeatures\":\"CSSPseudoDir,CSSLogical\",\"enablePreferredSizeMode\":true,\"nodeIntegration\":false,\"nodeIntegrationInWorker\":false,\"sandbox\":false,\"contextIsolation\":true,\"preload\":\"[REDACTED]/preload.bundle.js\",\"backgroundThrottling\":true,\"disableBlinkFeatures\":\"Accelerated2dCanvas,AcceleratedSmallCanvases\"},\"icon\":\"[REDACTED]/images/signal-logo-desktop-linux.png\",\"x\":0,\"y\":69}"}
{"level":30,"time":"2024-09-30T19:44:08.335Z","msg":"spellcheck: user locales: [\"en-US\",\"en\"]"}
{"level":30,"time":"2024-09-30T19:44:08.335Z","msg":"spellcheck: available spellchecker languages: [\"af\",\"bg\",\"ca\",\"cs\",\"cy\",\"da\",\"de\",\"de-DE\",\"el\",\"en\",\"en-AU\",\"en-CA\",\"en-GB\",\"en-GB-oxendict\",\"en-US\",\"es\",\"es-419\",\"es-AR\",\"es-ES\",\"es-MX\",\"es-US\",\"et\",\"fa\",\"fo\",\"fr\",\"fr-FR\",\"he\",\"hi\",\"hr\",\"hu\",\"hy\",\"id\",\"it\",\"it-IT\",\"ko\",\"lt\",\"lv\",\"nb\",\"nl\",\"pl\",\"pt\",\"pt-BR\",\"pt-PT\",\"ro\",\"ru\",\"sh\",\"sk\",\"sl\",\"sq\",\"sr\",\"sv\",\"ta\",\"tg\",\"tr\",\"uk\",\"vi\"]"}
{"level":30,"time":"2024-09-30T19:44:08.335Z","msg":"spellcheck: setting languages to: [\"en-US\",\"en\"]"}
2024-09-30 15:44:08.484: ERROR CORE sqlcipher_page_cipher: hmac check failed for pgno=1
2024-09-30 15:44:08.484: ERROR CORE sqlite3Codec: error decrypting page 1 data: 1
2024-09-30 15:44:08.484: ERROR CORE sqlcipher_codec_ctx_set_error 1
{"level":40,"time":"2024-09-30T19:44:08.484Z","msg":"MainSQL: Database log code=26: file is not a database in \"PRAGMA journal_mode = WAL\""}
{"level":30,"time":"2024-09-30T19:44:08.484Z","msg":"MainSQL: migrateDatabase: Migration without cipher change failed"}
2024-09-30 15:44:08.510: ERROR CORE sqlcipher_page_cipher: hmac check failed for pgno=1
2024-09-30 15:44:08.510: ERROR CORE sqlite3Codec: error decrypting page 1 data: 1
2024-09-30 15:44:08.510: ERROR CORE sqlcipher_codec_ctx_set_error 1
{"level":40,"time":"2024-09-30T19:44:08.510Z","msg":"MainSQL: Database log code=26: statement aborts at 2: [PRAGMA user_version] file is not a database"}
{"level":50,"time":"2024-09-30T19:44:08.511Z","msg":"MainSQL: Database startup error: SqliteError: file is not a database\n    at Database.pragma ([REDACTED]/node_modules/@signalapp/better-sqlite3/lib/methods/pragma.js:11:31)\n    at getUserVersion ([REDACTED]/ts/sql/util.js:132:13)\n    at migrateSchemaVersion ([REDACTED]/ts/sql/Server.js:404:54)\n    at openAndMigrateDatabase ([REDACTED]/ts/sql/Server.js:436:5)\n    at openAndSetUpSQLCipher ([REDACTED]/ts/sql/Server.js:458:14)\n    at initialize ([REDACTED]/ts/sql/Server.js:496:10)\n    at MessagePort.<anonymous> ([REDACTED]/ts/sql/mainWorker.js:69:41)\n    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20)\n    at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)"}
{"level":50,"time":"2024-09-30T19:44:08.511Z","msg":"Failed to get zoom factor {\"name\":\"SqliteError\"}"}
{"level":30,"time":"2024-09-30T19:44:08.716Z","msg":"got fast theme-setting value system"}
{"level":50,"time":"2024-09-30T19:44:10.236Z","msg":"sql.initialize was unsuccessful; returning early"}
{"level":30,"time":"2024-09-30T19:44:10.236Z","msg":"close event {\"readyForShutdown\":false,\"shouldQuit\":false}"}
{"level":30,"time":"2024-09-30T19:44:10.236Z","msg":"maybeRequestCloseConfirmation: Checking to see if close confirmation is needed"}
{"level":50,"time":"2024-09-30T19:44:12.938Z","msg":"onDatabaseError: Quitting application"}
{"level":30,"time":"2024-09-30T19:44:12.939Z","msg":"main window closed event"}
{"level":30,"time":"2024-09-30T19:44:12.939Z","msg":"quit event {\"hasEventBeenPrevented\":false,\"windowCount\":0,\"mainWindowExists\":false}"}
{"level":50,"time":"2024-09-30T19:44:12.941Z","msg":"Error occurred in handler for 'sql-channel:read': {\"name\":\"SqliteError\"}"}

Using flatseal to change the envvar from basic to gnome-libsecret fails the same.

Additionally the "Copy and Quit" option only quits, I haven't gotten it to actually copy.

@turmanticant
Copy link

turmanticant commented Sep 30, 2024

I stepped through each version of signal desktop reported by flathub. None of them work.

flatpak remote-info --log flathub  org.signal.Signal

This is a brutal update.

@minosimo
Copy link

I stepped through each version of signal desktop reported by flathub. None of them work.

flatpak remote-info --log flathub  org.signal.Signal

This is a brutal update.

There's troubleshooting help here: https://community.signalusers.org/t/database-error/63214

@BentHaase
Copy link

BentHaase commented Oct 1, 2024

I stepped through each version of signal desktop reported by flathub. None of them work.

flatpak remote-info --log flathub  org.signal.Signal

This is a brutal update.

Exactly, I can't use the desktop (flatpak) app anymore when using gnome-libsecret. The database get's corrupted on every second run. The only way is to store the key unencrypted (basic mode) which seems to be a step back regarding security.

@minosimo
Copy link

minosimo commented Oct 1, 2024

gnome-libsecret is broken for the moment on flatpak. Basic has been the default setting for years, using it for a few more days won't hurt anything. The WIP workaround is here: flathub/org.signal.Signal#756

@BentHaase
Copy link

gnome-libsecret is broken for the moment on flatpak. Basic has been the default setting for years, using it for a few more days won't hurt anything. The WIP workaround is here: flathub/org.signal.Signal#756

Ahh thank you for pointing me in the correct direction! 👍 Was missing this due to all the ongoing discussions. The test branch with @bbhtt pr flathub/org.signal.Signal#756 is working for me throughout subsequent app restarts.

@arturu
Copy link

arturu commented Oct 4, 2024

I restored the database. From an old backup I recovered the config.json file and copied the line "key": "xyz". I modified the current config.json by adding the line copied from the backup and deleting the line with "encryptedkey" and the next one. I installed version 7.27 and everything went smoothly, I didn't lose my 3 years of history.

OS: Pop_OS 22.04
Signal before break: flatpak 7.24.1
Signal restore: deb 7.27.0

Yes, you read that right, I changed from flatpak to deb. During the restore, I moved the Signal folder from ~/.var/app/org.signal.Signal/config/Signal to ~/.config/Signal. Everything worked.

@Sebsdnl
Copy link

Sebsdnl commented Oct 16, 2024

The problem persist in the latest update
Screenshot from 2024-10-16 10-39-00

@bermeitinger-b
Copy link

All the previous updates can't magically recover a lost key. There might be workarounds but your current best option is to start with an empty database.

@XenonSup
Copy link

I might've submitted this to the wrong place thinking it's a flatpak issue, but see flathub/org.signal.Signal#774
This same issue happened for me with upgrade 7.28 -> 7.29 after successfully switching from basic to gnome-libsecret on 7.28

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

No branches or pull requests