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

Frequent database errors that crashes Signal. Restart possible, but errors increasingly more frequent #6750

Open
2 tasks done
cyberwolfie1 opened this issue Jan 17, 2024 · 37 comments
Labels

Comments

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

This is possibly related/duplicate of #6639 and #3180, although different operating systems and not the same behavior, so I am submitted a separate ticket because of that.

For some time I have been getting database errors occasionally when opening Signal. I would not have to delete the database, but could click "Copy error and exit" and then immediately reopen Signal and it would work fine.

Recently (during the last week) Signal has also started crashing in use. It would never do this before. I can still restart Signal as I would before when this happens, without having to delete the database.

Whenever I click "Copy error and exit", nothing is copied to my clipboard, but I have pasted in the last lines of ~/.config/Signal/logs/main.log below that shows that there is some corruption in the SQL database.

I have as of yet not experienced any issues running the mobile version on Android.

I am running Signal v. 6.44.0 on Tuxedo OS 2, installed via commands found here https://signal.org/download/linux/

Steps to reproduce

Before:

  1. Open Signal
  2. Occasionally get Database error-popup
  3. Click "Copy error and exit" and relaunch Signal
  4. Fine

Now:

  1. Open Signal
    2a. Occasionally get Database error-popup
    3a. Click "Copy error and exit" and relaunch Signal
    or.
    2b. Successfully use Signal for a while, then Signal crashes and Database error-popup shows
    3b. Click "Copy error and exit" and relaunch Signnal
  2. Fine (until next crash)

Expected result

That Signal should not crash.

Actual result

Signal sometimes crashes upon start and during operation with an error message saying there is a Database error. I can restart Signal and use it again for some time before it crashes again.

Last lines from ~/.config/Signal/logs/main.log:

{"level":40,"time":"2024-01-17T10:53:33.039Z","msg":"MainSQL: Database log code=11: database corruption at line 71045 of [831d0fb283]"}
{"level":40,"time":"2024-01-17T10:53:33.039Z","msg":"MainSQL: Database log code=11: database corruption at line 71195 of [831d0fb283]"}
{"level":40,"time":"2024-01-17T10:53:33.039Z","msg":"MainSQL: Database log code=11: statement aborts at 18: [\n      SELECT json\n      FROM messages\n      WHERE\n        (schemaVersion IS NULL OR schemaVersion < $maxVersion) AND\n        IFNULL(\n          json_extract(json, '$.schemaMigrationAtt"}
{"level":30,"time":"2024-01-17T10:53:34.220Z","msg":"MainSQL: runCorruptionChecks: general integrity is ok"}
{"level":30,"time":"2024-01-17T10:53:34.272Z","msg":"MainSQL: runCorruptionChecks: FTS5 integrity ok"}
{"level":50,"time":"2024-01-17T10:53:34.272Z","msg":"Detected sql corruption in main process. Restarting the application immediately. Error: SqliteError: database disk image is malformed\n    at Object.getMessagesNeedingUpgrade ([REDACTED]/ts/sql/Server.js:4653:5)\n    at MessagePort.<anonymous> ([REDACTED]/ts/sql/mainWorker.js:108:35)\n    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:741:20)\n    at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)"}
{"level":30,"time":"2024-01-17T10:53:34.272Z","msg":"close event {\"readyForShutdown\":false,\"shouldQuit\":false}"}
{"level":30,"time":"2024-01-17T10:53:34.272Z","msg":"System tray service: rendering no tray"}
{"level":50,"time":"2024-01-17T10:53:37.109Z","msg":"onDatabaseError: Quitting application"}
{"level":30,"time":"2024-01-17T10:53:37.110Z","msg":"main window closed event"}
{"level":30,"time":"2024-01-17T10:53:37.110Z","msg":"System tray service: updating main window. Previously, there was a window, and now there is not"}
{"level":30,"time":"2024-01-17T10:53:37.110Z","msg":"System tray service: rendering no tray"}
{"level":30,"time":"2024-01-17T10:53:37.110Z","msg":"quit event {\"hasEventBeenPrevented\":false,\"windowCount\":0,\"mainWindowExists\":false}"}
{"level":50,"time":"2024-01-17T10:53:37.110Z","msg":"Error occurred in handler for 'sql-channel': {}"}

Screenshots

Screenshot_20240117_114114

Signal version

6.44.0

Operating system

Tuxedo OS 2

Version of Signal on your phone

No response

Link to debug log

No response

@jamiebuilds-signal
Copy link
Member

@cyberwolfie1 Could you provide a full debuglog?

@cyberwolfie1
Copy link
Author

cyberwolfie1 commented Jan 19, 2024

@jamiebuilds-signal Here you go: https://debuglogs.org/desktop/6.44.0/695b30fe47078784c0a2a70354901062db05cd55a9e055cb5188537693e7da45.gz

To add: I can't see that any particular action causes this. It happens seemingly randomly, and often when I don't have focus on the window as well. No messages received at the time of crash. It can crash within the first minute of opening, and sometimes it can stay open for longer durations.

@indutny-signal
Copy link
Contributor

Thank you for the log. We'll take a look!

@maxguru
Copy link

maxguru commented Jan 22, 2024

I had a similar thing happen just now.
I've been using the flatpak version for ages, never had an issue. I'm on Gentoo and btrfs file system.
Signal crashed with some sort of JS error. I thought that was weird but decided I might as well update. After the update I get this database error.

$ flatpak run org.signal.Signal
Debug: Will run signal with the following arguments:
Debug: Additionally, user gave: 
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 undefined
NODE_APP_INSTANCE undefined
SUPPRESS_NO_CONFIG_WARNING undefined
SIGNAL_ENABLE_HTTP undefined
userData: /home/al/.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: 12:09:59.670: Failed to load module "xapp-gtk3-module"
Gtk-Message: 12:09:59.670: Failed to load module "canberra-gtk-module"
Gtk-Message: 12:09:59.670: Failed to load module "appmenu-gtk-module"
{"level":30,"time":"2024-01-22T20:09:59.822Z","msg":"got fast localeOverride setting null"}
{"level":30,"time":"2024-01-22T20:09:59.823Z","msg":"app.ready: hour cycle preference: UnknownPreference"}
{"level":30,"time":"2024-01-22T20:09:59.823Z","msg":"app.ready: preferred system locales: en-US, en"}
{"level":30,"time":"2024-01-22T20:09:59.823Z","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-01-22T20:09:59.823Z","msg":"locale: Preferred locales: en-US, en"}
{"level":30,"time":"2024-01-22T20:09:59.823Z","msg":"locale: Locale Override: null"}
{"level":30,"time":"2024-01-22T20:09:59.825Z","msg":"locale: Matched locale: en"}
{"level":40,"time":"2024-01-22T20:09:59.848Z","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-01-22T20:09:59.848Z","msg":"locale: Text info direction for en: ltr"}
{"level":30,"time":"2024-01-22T20:09:59.849Z","msg":"app ready"}
{"level":30,"time":"2024-01-22T20:09:59.849Z","msg":"starting version 6.44.1"}
{"level":30,"time":"2024-01-22T20:09:59.849Z","msg":"media access status [object Undefined] [object Undefined]"}
{"level":30,"time":"2024-01-22T20:09:59.851Z","msg":"got fast theme-setting value dark"}
{"level":40,"time":"2024-01-22T20:09:59.851Z","msg":"MainSQL: Database log code=283: recovered 142 frames from WAL file [REDACTED]/sql/db.sqlite-wal"}
{"level":30,"time":"2024-01-22T20:09:59.851Z","msg":"MainSQL: updateSchema:\n  Current user_version: 980;\n  Most recent db schema: 980;\n  SQLite version: 3.42.0;\n  SQLCipher version: 4.5.5 community;\n  (deprecated) schema_version: 408;\n"}
{"level":30,"time":"2024-01-22T20:09:59.852Z","msg":"got fast theme-setting value dark"}
{"level":30,"time":"2024-01-22T20:09:59.852Z","msg":"got fast spellcheck setting true"}
{"level":30,"time":"2024-01-22T20:09:59.852Z","msg":"getSystemTraySetting had no flags and did no DB lookups. Returning DoNotUseSystemTray"}
{"level":30,"time":"2024-01-22T20:09:59.853Z","msg":"Initializing BrowserWindow config: {\"show\":false,\"width\":979,\"height\":649,\"minWidth\":300,\"minHeight\":200,\"autoHideMenuBar\":false,\"titleBarStyle\":\"default\",\"titleBarOverlay\":false,\"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\":5369,\"y\":334}"}

(signal-desktop:2): GLib-GIO-WARNING **: 12:09:59.876: Can't find module 'dconf' specified in GSETTINGS_BACKEND
{"level":30,"time":"2024-01-22T20:09:59.893Z","msg":"spellcheck: user locales: [\"en-US\",\"en\"]"}
{"level":30,"time":"2024-01-22T20:09:59.893Z","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-01-22T20:09:59.893Z","msg":"spellcheck: setting languages to: [\"en-US\",\"en\"]"}
{"level":30,"time":"2024-01-22T20:10:00.233Z","msg":"got fast theme-setting value dark"}
{"level":30,"time":"2024-01-22T20:10:00.724Z","msg":"got fast spellcheck setting true"}
{"level":30,"time":"2024-01-22T20:10:00.733Z","msg":"System tray service: created"}
{"level":30,"time":"2024-01-22T20:10:00.733Z","msg":"System tray service: updating main window. Previously, there was not a window, and now there is"}
{"level":30,"time":"2024-01-22T20:10:00.733Z","msg":"System tray service: rendering no tray"}
{"level":30,"time":"2024-01-22T20:10:00.733Z","msg":"Begin ensuring permissions"}
{"level":30,"time":"2024-01-22T20:10:00.734Z","msg":"main window is ready-to-show"}
{"level":30,"time":"2024-01-22T20:10:00.734Z","msg":"showing main window"}
{"level":30,"time":"2024-01-22T20:10:00.735Z","msg":"System tray service: rendering no tray"}
{"level":30,"time":"2024-01-22T20:10:00.738Z","msg":"Ensuring file permissions for 4 files"}
{"level":30,"time":"2024-01-22T20:10:00.739Z","msg":"Finish ensuring permissions in 6ms"}
{"level":40,"time":"2024-01-22T20:10:00.976Z","msg":"MainSQL: Database log code=11: database corruption at line 99919 of [831d0fb283]"}
{"level":40,"time":"2024-01-22T20:10:00.976Z","msg":"MainSQL: Database log code=11: statement aborts at 6: [\n      SELECT\n        json,\n        (SELECT EXISTS(\n          SELECT 1\n          FROM messages as replies\n          WHERE replies.storyId IS messages.id\n        )) as hasReplies,\n      "}
{"level":50,"time":"2024-01-22T20:10:01.174Z","msg":"MainSQL: runCorruptionChecks: general integrity is not ok [\n  {\n    integrity_check: '*** in database main ***\\n' +\n      'Tree 14948 page 14948: unable to get the page. error code=8458\\n' +\n      'Tree 14947 page 14947: unable to get the page. error code=1\\n' +\n      'Tree 14946 page 14946: unable to get the page. error code=1\\n' +\n      'Tree 14945 page 14945: unable to get the page. error code=1\\n' +\n      'Tree 14944 page 14944: unable to get the page. error code=1\\n' +\n      'Tree 14943 page 14943: unable to get the page. error code=1\\n' +\n      'Tree 14942 page 14942: unable to get the page. error code=1\\n' +\n      'Tree 14941 page 14941: unable to get the page. error code=1\\n' +\n      'Tree 14940 page 14940: unable to get the page. error code=1\\n' +\n      'Tree 14939 page 14939: unable to get the page. error code=1\\n' +\n      'Tree 14938 page 14938: unable to get the page. error code=1\\n' +\n      'Tree 14937 page 14937: unable to get the page. error code=1\\n' +\n      'Tree 14936 page 14936: unable to get the page. error code=1\\n' +\n      'Tree 14935 page 14935: unable to get the page. error code=1\\n' +\n      'Tree 14934 page 14934: unable to get the page. error code=1\\n' +\n      'Tree 14933 page 14933: unable to get the page. error code=1\\n' +\n      'Tree 14932 page 14932: unable to get the page. error code=1\\n' +\n      'Tree 14931 page 14931: unable to get the page. error code=1\\n' +\n      'Tree 14930 page 14930: unable to get the page. error code=1\\n' +\n      'Tree 14929 page 14929: unable to get the page. error code=1\\n' +\n      'Tree 14928 page 14928: unable to get the page. error code=1\\n' +\n      'Tree 14927 page 14927: unable to get the page. error code=1\\n' +\n      'Tree 14926 page 14926: unable to get the page. error code=1\\n' +\n      'Tree 14696 page 14696: unable to get the page. error code=1\\n' +\n      'Tree 14696 page 20 cell 35: Child page depth differs\\n' +\n      'Tree 14297 page 14297: unable to get the page. error code=1\\n' +\n      'Tree 13906 page 13906: unable to get the page. error code=1\\n' +\n      'Tree 13513 page 13513: unable to get the page. error code=1\\n' +\n      'Tree 13118 page 13118: unable to get the page. error code=1\\n' +\n      'Tree 12724 page 12724: unable to get the page. error code=1\\n' +\n      'Tree 12331 page 12331: unable to get the page. error code=1\\n' +\n      'Tree 11932 page 11932: unable to get the page. error code=1\\n' +\n      'Tree 11541 page 11541: unable to get the page. error code=1\\n' +\n      'Tree 11150 page 11150: unable to get the page. error code=1\\n' +\n      'Tree 10758 page 10758: unable to get the page. error code=1\\n' +\n      'Tree 10366 page 10366: unable to get the page. error code=1\\n' +\n      'Tree 9975 page 9975: unable to get the page. error code=1\\n' +\n      'Tree 9580 page 9580: unable to get the page. error code=1\\n' +\n      'Tree 9187 page 9187: unable to get the page. error code=1\\n' +\n      'Tree 8795 page 8795: unable to get the page. error code=1\\n' +\n      'Tree 8400 page 8400: unable to get the page. error code=1\\n' +\n      'Tree 8004 page 8004: unable to get the page. error code=1\\n' +\n      'Tree 7606 page 7606: unable to get the page. error code=1\\n' +\n      'Tree 7214 page 7214: unable to get the page. error code=1\\n' +\n      'Tree 6820 page 6820: unable to get the page. error code=1\\n' +\n      'Tree 6426 page 6426: unable to get the page. error code=1\\n' +\n      'Tree 6030 page 6030: unable to get the page. error code=1\\n' +\n      'Tree 5636 page 5636: unable to get the page. error code=1\\n' +\n      'Tree 5242 page 5242: unable to get the page. error code=1\\n' +\n      'Tree 4851 page 4851: unable to get the page. error code=1\\n' +\n      'Tree 4428 page 4428: unable to get the page. error code=1\\n' +\n      'Tree 3983 page 3983: unable to get the page. error code=1\\n' +\n      'Tree 3537 page 3537: unable to get the page. error code=1\\n' +\n      'Tree 3096 page 3096: unable to get the page. error code=1\\n' +\n      'Tree 2651 page 2651: unable to get the page. error code=1\\n' +\n      'Tree 2210 page 2210: unable to get the page. error code=1\\n' +\n      'Tree 1767 page 1767: unable to get the page. error code=1\\n' +\n      'Tree 1262 page 1262: unable to get the page. error code=1\\n' +\n      'Tree 758 page 758: unable to get the page. error code=1\\n' +\n      'Tree 757 page 757: unable to get the page. error code=1\\n' +\n      'Tree 124 page 124: unable to get the page. error code=1\\n' +\n      'Tree 123 page 123: unable to get the page. error code=1\\n' +\n      'Tree 115 page 115: unable to get the page. error code=1\\n' +\n      'Tree 114 page 114: unable to get the page. error code=1\\n' +\n      'Tree 113 page 113: unable to get the page. error code=1\\n' +\n      'Tree 112 page 112: unable to get the page. error code=1\\n' +\n      'Tree 110 page 110: unable to get the page. error code=1\\n' +\n      'Tree 109 page 109: unable to get the page. error code=1\\n' +\n      'Tree 108 page 108: unable to get the page. error code=1\\n' +\n      'Tree 106 page 106: unable to get the page. error code=1\\n' +\n      'Tree 104 page 104: unable to get the page. error code=1\\n' +\n      'Tree 103 page 103: unable to get the page. error code=1\\n' +\n      'Tree 101 page 101: unable to get the page. error code=1\\n' +\n      'Tree 99 page 99: unable to get the page. error code=1\\n' +\n      'Tree 98 page 98: unable to get the page. error code=1\\n' +\n      'Tree 95 page 95: unable to get the page. error code=1\\n' +\n      'Tree 94 page 94: unable to get the page. error code=1\\n' +\n      'Tree 93 page 93: unable to get the page. error code=1\\n' +\n      'Tree 92 page 92: unable to get the page. error code=1\\n' +\n      'Tree 91 page 91: unable to get the page. error code=1\\n' +\n      'Tree 90 page 90: unable to get the page. error code=1\\n' +\n      'Tree 88 page 88: unable to get the page. error code=1\\n' +\n      'Tree 87 page 87: unable to get the page. error code=1\\n' +\n      'Tree 84 page 84: unable to get the page. error code=1\\n' +\n      'Tree 81 page 81: unable to get the page. error code=1\\n' +\n      'Tree 80 page 80: unable to get the page. error code=1\\n' +\n      'Tree 79 page 79: unable to get the page. error code=1\\n' +\n      'Tree 78 page 78: unable to get the page. error code=1\\n' +\n      'Tree 77 page 77: unable to get the page. error code=1\\n' +\n      'Tree 21 page 21: unable to get the page. error code=1\\n' +\n      'Tree 17 page 17: unable to get the page. error code=1\\n' +\n      'Tree 64 page 64: unable to get the page. error code=1\\n' +\n      'Tree 122 page 122: unable to get the page. error code=1\\n' +\n      'Tree 120 page 120: unable to get the page. error code=1\\n' +\n      'Tree 119 page 119: unable to get the page. error code=1\\n' +\n      'Tree 66 page 66: unable to get the page. error code=1\\n' +\n      'Tree 65 page 65: unable to get the page. error code=1\\n' +\n      'Tree 59 page 59: unable to get the page. error code=1\\n' +\n      'Tree 29 page 29: unable to get the page. error code=1\\n' +\n      'Tree 30 page 30: unable to get the page. error code=1'\n  }\n]"}
{"level":30,"time":"2024-01-22T20:10:01.243Z","msg":"Updating BrowserWindow config: %s {\"maximized\":false,\"autoHideMenuBar\":false,\"fullscreen\":false,\"width\":979,\"height\":649,\"x\":5369,\"y\":362}"}
{"level":30,"time":"2024-01-22T20:10:01.245Z","msg":"config/set: Saving ephemeral config to disk"}
{"level":30,"time":"2024-01-22T20:10:01.245Z","msg":"config/set: Saved ephemeral config to disk"}
{"level":30,"time":"2024-01-22T20:10:01.516Z","msg":"MainSQL: runCorruptionChecks: FTS5 integrity ok"}
{"level":50,"time":"2024-01-22T20:10:01.517Z","msg":"Detected sql corruption in main process. Restarting the application immediately. Error: SqliteError: database disk image is malformed\n    at Object.getAllStories ([REDACTED]/ts/sql/Server.js:2236:5)\n    at MessagePort.<anonymous> ([REDACTED]/ts/sql/mainWorker.js:108:35)\n    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:741:20)\n    at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)"}
{"level":30,"time":"2024-01-22T20:10:01.517Z","msg":"close event {\"readyForShutdown\":false,\"shouldQuit\":false}"}
{"level":30,"time":"2024-01-22T20:10:01.519Z","msg":"System tray service: rendering no tray"}
{"level":50,"time":"2024-01-22T20:10:04.275Z","msg":"onDatabaseError: Quitting application"}
{"level":30,"time":"2024-01-22T20:10:04.276Z","msg":"main window closed event"}
{"level":30,"time":"2024-01-22T20:10:04.276Z","msg":"System tray service: updating main window. Previously, there was a window, and now there is not"}
{"level":30,"time":"2024-01-22T20:10:04.276Z","msg":"System tray service: rendering no tray"}
{"level":30,"time":"2024-01-22T20:10:04.276Z","msg":"quit event {\"hasEventBeenPrevented\":false,\"windowCount\":0,\"mainWindowExists\":false}"}
{"level":50,"time":"2024-01-22T20:10:04.276Z","msg":"Error occurred in handler for 'sql-channel': {}"}

@indutny-signal
Copy link
Contributor

@maxguru oof, I'm sorry to say it, but in your case the database appears to be pretty badly corrupted and cannot be automatically recovered. Was there a sudden crash or maybe power went out recently?

@maxguru
Copy link

maxguru commented Jan 22, 2024

No, it just randomly crashed with some sort of JS error popup. No power issues whatsoever. Uptime is 18 days. However, I was having strange issues with flatpak (apps not starting in some situations), so, maybe flatpak caused it. Otherwise, maybe it was some kind of hack coming from an inbound message.

@cyberwolfie1
Copy link
Author

An update from my side: it has been very stable the last couple of days with no crashes. I have not updated the client.

@emko
Copy link

emko commented Jul 29, 2024

started crashing same way for me too now

@ayumi-signal
Copy link
Contributor

@emko sorry this is happening for you, can you please share a debug log? and i'm curious if anything happened prior to the issue (app update, system power lost, etc)

@emko
Copy link

emko commented Jul 29, 2024

flatpak run org.signal.Signal  
Debug: Will run signal with the following arguments:
Debug: Additionally, user gave: 
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 emko-pc
NODE_APP_INSTANCE undefined
SUPPRESS_NO_CONFIG_WARNING undefined
SIGNAL_ENABLE_HTTP undefined
userData: /home/emincavalic/.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: 13:23:09.372: Failed to load module "canberra-gtk-module"
Gtk-Message: 13:23:09.372: Failed to load module "pk-gtk-module"
Gtk-Message: 13:23:09.372: Failed to load module "canberra-gtk-module"
Gtk-Message: 13:23:09.372: Failed to load module "pk-gtk-module"
src/gbm_drv_common.c:131: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

src/gbm_drv_common.c:131: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

src/gbm_drv_common.c:131: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

src/gbm_drv_common.c:131: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

src/gbm_drv_common.c:131: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

{"level":30,"time":"2024-07-29T19:23:09.483Z","msg":"got fast localeOverride setting null"}
{"level":30,"time":"2024-07-29T19:23:09.484Z","msg":"app.ready: hour cycle preference: UnknownPreference"}
{"level":30,"time":"2024-07-29T19:23:09.484Z","msg":"app.ready: preferred system locales: en-CA, en"}
{"level":30,"time":"2024-07-29T19:23:09.484Z","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-07-29T19:23:09.484Z","msg":"locale: Preferred locales: en-CA, en"}
{"level":30,"time":"2024-07-29T19:23:09.484Z","msg":"locale: Locale Override: null"}
{"level":30,"time":"2024-07-29T19:23:09.485Z","msg":"locale: Matched locale: en"}
{"level":40,"time":"2024-07-29T19:23:09.499Z","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-distribut
ion"}
{"level":30,"time":"2024-07-29T19:23:09.499Z","msg":"locale: Text info direction for en: ltr"}
{"level":30,"time":"2024-07-29T19:23:09.499Z","msg":"getSQLKey: decrypting key"}
{"level":30,"time":"2024-07-29T19:23:09.499Z","msg":"getSystemTraySetting got value DoNotUseSystemTray"}
{"level":30,"time":"2024-07-29T19:23:09.499Z","msg":"getSystemTraySetting returning DoNotUseSystemTray"}
{"level":30,"time":"2024-07-29T19:23:09.500Z","msg":"app ready"}
{"level":30,"time":"2024-07-29T19:23:09.500Z","msg":"starting version 7.17.0"}
{"level":30,"time":"2024-07-29T19:23:09.500Z","msg":"media access status [object Undefined] [object Undefined]"}
{"level":30,"time":"2024-07-29T19:23:09.501Z","msg":"got fast theme-setting value system"}
{"level":30,"time":"2024-07-29T19:23:09.502Z","msg":"got fast theme-setting value system"}
{"level":30,"time":"2024-07-29T19:23:09.502Z","msg":"got fast spellcheck setting true"}
{"level":30,"time":"2024-07-29T19:23:09.502Z","msg":"Initializing BrowserWindow config: {\"show\":false,\"width\":983,\"height\":510,\"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\":2026,\"y\":1631}"}
{"level":30,"time":"2024-07-29T19:23:09.524Z","msg":"spellcheck: user locales: [\"en-CA\",\"en\"]"}
{"level":30,"time":"2024-07-29T19:23:09.524Z","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-07-29T19:23:09.524Z","msg":"spellcheck: setting languages to: [\"en-CA\",\"en\"]"}
{"level":40,"time":"2024-07-29T19:23:09.612Z","msg":"MainSQL: Database log code=26: file is not a database in \"PRAGMA journal_mode = WAL\""}
{"level":30,"time":"2024-07-29T19:23:09.612Z","msg":"MainSQL: migrateDatabase: Migration without cipher change failed"}
{"level":40,"time":"2024-07-29T19:23:09.634Z","msg":"MainSQL: Database log code=26: statement aborts at 2: [PRAGMA user_version] file is not a database"}
{"level":50,"time":"2024-07-29T19:23:09.634Z","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:389:54)\n    at openAndMigrateDatabase ([REDACTED]/ts/sql/Server.js:420:3)\n    at openAndSetUpSQLCipher ([REDACTED]/ts/sql/Server.js:435:14)\n    at Object.initialize ([REDACTED]/ts/sql/Server.js:471:16)\n    at MessagePort.<anonymous> ([REDACTED]/ts/sql/mainWorker.js:84:35)\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-07-29T19:23:09.634Z","msg":"MainSQL: runCorruptionChecks: not running the check, no writable instance Error: getUnsafeWritableInstance: globalWritableInstance not set!\n    at getUnsafeWritableInstance ([REDACTED]/ts/sql/Server.js:600:11)\n    at Object.runCorruptionChecks ([REDACTED]/ts/sql/Server.js:4785:10)\n    at respond ([REDACTED]/ts/sql/mainWorker.js:40:29)\n    at MessagePort.<anonymous> ([REDACTED]/ts/sql/mainWorker.js:115:5)"}
{"level":50,"time":"2024-07-29T19:23:09.634Z","msg":"Failed to get zoom factor {}"}
{"level":40,"time":"2024-07-29T19:23:09.772Z","msg":"safeLoadURL: ignoring ERR_FAILED because we are shutting down {\"errno\":-2,\"code\":\"ERR_FAILED\",\"url\":\"file:[REDACTED]/background.html\"}"}
{"level":50,"time":"2024-07-29T19:23:09.772Z","msg":"sql.initialize was unsuccessful; returning early"}
{"level":30,"time":"2024-07-29T19:23:09.773Z","msg":"close event {\"readyForShutdown\":false,\"shouldQuit\":false}"}
{"level":30,"time":"2024-07-29T19:23:09.773Z","msg":"maybeRequestCloseConfirmation: Checking to see if close confirmation is needed"}
{"level":50,"time":"2024-07-29T19:23:11.308Z","msg":"onDatabaseError: Quitting application"}
{"level":30,"time":"2024-07-29T19:23:11.308Z","msg":"main window closed event"}
{"level":30,"time":"2024-07-29T19:23:11.308Z","msg":"quit event {\"hasEventBeenPrevented\":false,\"windowCount\":0,\"mainWindowExists\":false}"}
Render process is gone: Error: Reason: crashed, Exit Code: 133
    at App.<anonymous> (/app/Signal/resources/app.asar/app/global_errors.js:88:7)
    at App.emit (node:events:519:28)
    at WebContents.<anonymous> (node:electron/js2c/browser_init:2:84014)
    at WebContents.emit (node:events:519:28)
{"level":50,"time":"2024-07-29T19:23:11.309Z","msg":"Render process is gone: Error: Reason: crashed, Exit Code: 133\n    at App.<anonymous> ([REDACTED]/app/global_errors.js:88:7)\n    at App.emit (node:events:519:28)\n    at WebContents.<anonymous> (node:electron/js2c/browser_init:2:84014)\n    at WebContents.emit (node:events:519:28)"}
{"level":30,"time":"2024-07-29T19:23:12.818Z","msg":"Updating BrowserWindow config: %s {\"maximized\":false,\"autoHideMenuBar\":false,\"fullscreen\":false,\"width\":983,\"height\":510,\"x\":2026,\"y\":1631}"}
{"level":30,"time":"2024-07-29T19:23:12.819Z","msg":"config/set: Saving ephemeral config to disk"}
{"level":30,"time":"2024-07-29T19:23:12.837Z","msg":"config/set: Saved ephemeral config to disk"}

@ayumi-signal
Copy link
Contributor

@emko Thanks for the log! First, I noticed you're using flatpak and we currently don't support unofficial builds. We will do our best effort.

Regarding the actual error, it looks like "file is not a database" and the cause seems different than earlier errors in this issue. The cause may be related to the safeStorage encryption backend. Normally it's auto selected based on desktop env such as gnome-libsecret for GNOME or kwallet for KDE. However we don't develop on flatpak and are not sure how its keyring detection works. Questions would be: was it working in previous versions; did an update break things; did any system configuration change in the meantime?

If you continue to experience it, please open a new issue for "file is not a database" and can't start the app.

@theborakompanioni
Copy link

@emko Thanks for the log! First, I noticed you're using flatpak and we currently don't support unofficial builds. We will do our best effort.

Just fyi: Same experience on v7.17.0 on Fedora 40. No ability to start the application (without cleaning the data). Reverting to v7.16.0 gives the option to "Recover data" and open the application "normally".

@ayumi-signal
Copy link
Contributor

@theborakompanioni Sorry this is happening -- is this also on the flatpak? If so I'd suggest to check the maintainer's issue tracker to see if there's anything relevant there.

@theborakompanioni
Copy link

@theborakompanioni Sorry this is happening -- is this also on the flatpak? If so I'd suggest to check the maintainer's issue tracker to see if there's anything relevant there.

Don't be sorry. Might be totally outside of your control. As far as I am aware, this was installed via snap. I can ask again and get back to you if it was different. 🙏

@gum101010
Copy link

gum101010 commented Aug 1, 2024

Hello there,
i can confirm the same experience on v7.17.0 on Ubuntu 23.10 with signal-desktop installed via snap.

Set Windows Application User Model ID (AUMID) { AUMID: 'org.whispersystems.signal-desktop' }
NODE_ENV production
NODE_CONFIG_DIR /snap/signal-desktop/675/opt/Signal/resources/app.asar/config
NODE_CONFIG {}
ALLOW_CONFIG_MUTATIONS undefined
HOSTNAME max-HP-EliteBook-840-G6
NODE_APP_INSTANCE undefined
SUPPRESS_NO_CONFIG_WARNING undefined
SIGNAL_ENABLE_HTTP undefined
userData: /home/max/snap/signal-desktop/675/.config/Signal
config/get: Successfully read user config file
config/get: Successfully read ephemeral config file
making app single instance
Error org.freedesktop.DBus.Error.Failed: cannot find desktop file "/var/lib/snapd/desktop/applications/signal-desktop_signal.desktop"
Error org.freedesktop.DBus.Error.Failed: cannot find desktop file "/var/lib/snapd/desktop/applications/signal-desktop_signal.desktop"
Gtk-Message: 08:52:38.814: Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.

(signal-desktop:229629): Gtk-WARNING **: 08:52:38.924: GTK+ module /snap/signal-desktop/675/gnome-platform/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded.
GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.
Gtk-Message: 08:52:38.925: Failed to load module "canberra-gtk-module"

(signal-desktop:229629): Gtk-WARNING **: 08:52:38.926: GTK+ module /snap/signal-desktop/675/gnome-platform/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded.
GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.
Gtk-Message: 08:52:38.926: Failed to load module "canberra-gtk-module"
Warning: build/dns-fallback.json not build, run `yarn generate`
{"level":30,"time":"2024-08-01T06:52:39.234Z","msg":"got fast localeOverride setting null"}
{"level":30,"time":"2024-08-01T06:52:39.235Z","msg":"app.ready: hour cycle preference: UnknownPreference"}
{"level":30,"time":"2024-08-01T06:52:39.235Z","msg":"app.ready: preferred system locales: en-US, en"}
{"level":30,"time":"2024-08-01T06:52:39.236Z","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-08-01T06:52:39.236Z","msg":"locale: Preferred locales: en-US, en"}
{"level":30,"time":"2024-08-01T06:52:39.236Z","msg":"locale: Locale Override: null"}
{"level":30,"time":"2024-08-01T06:52:39.240Z","msg":"locale: Matched locale: en"}
{"level":40,"time":"2024-08-01T06:52:39.270Z","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-08-01T06:52:39.270Z","msg":"locale: Text info direction for en: ltr"}
{"level":30,"time":"2024-08-01T06:52:39.271Z","msg":"getSQLKey: decrypting key"}
{"level":30,"time":"2024-08-01T06:52:39.271Z","msg":"getSystemTraySetting got value DoNotUseSystemTray"}
{"level":30,"time":"2024-08-01T06:52:39.271Z","msg":"getSystemTraySetting returning DoNotUseSystemTray"}
{"level":30,"time":"2024-08-01T06:52:39.273Z","msg":"app ready"}
{"level":30,"time":"2024-08-01T06:52:39.273Z","msg":"starting version 7.17.0"}
{"level":30,"time":"2024-08-01T06:52:39.273Z","msg":"media access status [object Undefined] [object Undefined]"}
{"level":30,"time":"2024-08-01T06:52:39.275Z","msg":"got fast theme-setting value system"}
{"level":30,"time":"2024-08-01T06:52:39.276Z","msg":"got fast theme-setting value system"}
{"level":30,"time":"2024-08-01T06:52:39.276Z","msg":"got fast spellcheck setting true"}
{"level":30,"time":"2024-08-01T06:52:39.277Z","msg":"Initializing BrowserWindow config: {\"show\":false,\"width\":1440,\"height\":810,\"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\":171,\"y\":217}"}
{"level":30,"time":"2024-08-01T06:52:39.317Z","msg":"spellcheck: user locales: [\"en-US\",\"en\"]"}
{"level":30,"time":"2024-08-01T06:52:39.317Z","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-08-01T06:52:39.317Z","msg":"spellcheck: setting languages to: [\"en-US\",\"en\"]"}
{"level":40,"time":"2024-08-01T06:52:39.491Z","msg":"MainSQL: Database log code=26: file is not a database in \"PRAGMA journal_mode = WAL\""}
{"level":30,"time":"2024-08-01T06:52:39.491Z","msg":"MainSQL: migrateDatabase: Migration without cipher change failed"}
{"level":40,"time":"2024-08-01T06:52:39.552Z","msg":"MainSQL: Database log code=26: statement aborts at 2: [PRAGMA user_version] file is not a database"}
{"level":50,"time":"2024-08-01T06:52:39.553Z","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:389:54)\n    at openAndMigrateDatabase ([REDACTED]/ts/sql/Server.js:420:3)\n    at openAndSetUpSQLCipher ([REDACTED]/ts/sql/Server.js:435:14)\n    at Object.initialize ([REDACTED]/ts/sql/Server.js:471:16)\n    at MessagePort.<anonymous> ([REDACTED]/ts/sql/mainWorker.js:84:35)\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-08-01T06:52:39.553Z","msg":"MainSQL: runCorruptionChecks: not running the check, no writable instance Error: getUnsafeWritableInstance: globalWritableInstance not set!\n    at getUnsafeWritableInstance ([REDACTED]/ts/sql/Server.js:600:11)\n    at Object.runCorruptionChecks ([REDACTED]/ts/sql/Server.js:4785:10)\n    at respond ([REDACTED]/ts/sql/mainWorker.js:40:29)\n    at MessagePort.<anonymous> ([REDACTED]/ts/sql/mainWorker.js:115:5)"}
{"level":50,"time":"2024-08-01T06:52:39.554Z","msg":"Failed to get zoom factor {}"}
{"level":30,"time":"2024-08-01T06:52:39.980Z","msg":"got fast theme-setting value system"}
{"level":50,"time":"2024-08-01T06:52:43.605Z","msg":"sql.initialize was unsuccessful; returning early"}
{"level":30,"time":"2024-08-01T06:52:43.605Z","msg":"close event {\"readyForShutdown\":false,\"shouldQuit\":false}"}
{"level":30,"time":"2024-08-01T06:52:43.605Z","msg":"maybeRequestCloseConfirmation: Checking to see if close confirmation is needed"}
{"level":50,"time":"2024-08-01T06:52:45.783Z","msg":"onDatabaseError: Quitting application"}
{"level":30,"time":"2024-08-01T06:52:45.784Z","msg":"main window closed event"}
{"level":30,"time":"2024-08-01T06:52:45.786Z","msg":"quit event {\"hasEventBeenPrevented\":false,\"windowCount\":0,\"mainWindowExists\":false}"}
{"level":50,"time":"2024-08-01T06:52:45.788Z","msg":"Error occurred in handler for 'sql-channel': {}"}

@lnicola
Copy link

lnicola commented Aug 1, 2024

I also ran into this issue on 7.17 (it started crashing on some of the startups, possibly Wayland-related, and sometimes complained about the database, but was recoverable) and 7.18 (file is not a database in \"PRAGMA journal_mode = WAL\", unrecoverable). The file looks like junk, which I assume it's just SQLCipher doing its job.

@alpha14
Copy link

alpha14 commented Aug 1, 2024

Having the same issue with 7.17 and 7.18 (snap version)
The app recommends wiping the data and re-linking which I did 3 times, the error occurs again after restarting the app.

@ayumi-signal
Copy link
Contributor

This issue has diverged from OP's issue, which was database corruption during normal operation.

Regarding community packages such as flatpak or snap, we don't build them and we also don't have bandwidth to develop on them right now.

It seems like in the packaged environment there's an issue using the GNOME keyring and/or electron safeStorage API. You could experiment with turning it off by running the app with the command line arg --password-store="basic". Note that this will only work on a fresh data directory. If you had previously run it without the arg, the key must be decrypted first. You can do this by running a script in Electron fiddle (check that it points to the correct user data path): https://community.signalusers.org/t/signal-stores-encryption-key-in-plain-text-on-desktop-client-s/61675/53

More info on the --password-store arg in the electron docs: https://www.electronjs.org/docs/latest/api/safe-storage#safestoragegetselectedstoragebackend-linux

@jnsgruk
Copy link
Contributor

jnsgruk commented Aug 1, 2024

Has Signal's usage of the keyring fundamentally changed? It doesn't make a lot of sense to me that this is a confinement issue - particularly that it's happening across two completely discrete packaging systems? What's in the logs there that suggests no communication with the GNOME keyring?

@lnicola
Copy link

lnicola commented Aug 1, 2024

I'm using a Fedora COPR, by the way. Yes, I understand it's not supported.

@jnsgruk
Copy link
Contributor

jnsgruk commented Aug 8, 2024

Similar reports of the deb version supplied by Signal exhibiting the same behaviour on Ubuntu: snapcrafters/signal-desktop#300 (comment)

@padames
Copy link

padames commented Aug 8, 2024

So, the version from the snapstore should be avoided for now?
What is the officially supported version?
Build from source?
Manual install of a Deb package for Ubuntu/AMD64?
Will I lose all my Signal data if I have to remove the snap signal-desktop version and install it from a different channel?
Thanks

@jnsgruk
Copy link
Contributor

jnsgruk commented Aug 8, 2024

The snap is not maintained or supported by Signal - and never has been. That said, given that people are experiencing this with the official deb, the Fedora COPR package, and the snap - it seems likely that it's not a packaging issue.

@cyberwolfie1
Copy link
Author

Since my last post, where this issue had completely gone, it has now started again. I am still on the .deb-package. Double error message now, same as is mentioned in the issue @jnsgruk linked to.

@scottnonnenberg-signal
Copy link
Contributor

@cyberwolfie1 What's the exact error message you see when it crashes?

If it's a database corruption error, is there anything that might have prevented Signal Desktop from accessing your database password through Electron's safeStorage API? Or perhaps you've changed desktop environments, and Signal Desktop no longer has access to your previous protected storage system?

@adioe3
Copy link

adioe3 commented Sep 26, 2024

+1, experiencing the same on Fedora 40 with Signal installed via Flathub. Running via terminal I see these errors:

2024-09-27 00:22:28.535: ERROR CORE sqlcipher_page_cipher: hmac check failed for pgno=1
2024-09-27 00:22:28.535: ERROR CORE sqlite3Codec: error decrypting page 1 data: 1
2024-09-27 00:22:28.535: ERROR CORE sqlcipher_codec_ctx_set_error 1
{"level":40,"time":"2024-09-26T22:22:28.536Z","msg":"MainSQL: Database log code=26: file is not a database in \"PRAGMA journal_mode = WAL\""}
{"level":30,"time":"2024-09-26T22:22:28.536Z","msg":"MainSQL: migrateDatabase: Migration without cipher change failed"}
2024-09-27 00:22:28.563: ERROR CORE sqlcipher_page_cipher: hmac check failed for pgno=1
2024-09-27 00:22:28.563: ERROR CORE sqlite3Codec: error decrypting page 1 data: 1
2024-09-27 00:22:28.563: ERROR CORE sqlcipher_codec_ctx_set_error 1
{"level":40,"time":"2024-09-26T22:22:28.563Z","msg":"MainSQL: Database log code=26: statement aborts at 2: [PRAGMA user_version] file is not a database"}
{"level":50,"time":"2024-09-26T22:22:28.564Z","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)"}

@scottnonnenberg-signal
Copy link
Contributor

@adioe3 What is the history of your desktop instance, and the computer it's installed on? Did you have a hard reset or power loss? That can sometimes cause database corruption. Also, taking a backup in the middle of the application running then restoring it - the database file can be only partially-written in that case, and can cause this.

@theborakompanioni
Copy link

@adioe3 What is the history of your desktop instance, and the computer it's installed on? Did you have a hard reset or power loss? That can sometimes cause database corruption. Also, taking a backup in the middle of the application running then restoring it - the database file can be only partially-written in that case, and can cause this.

Cannot speak for @adioe3, but here happens every time the app is started. Needs re-linking, after closing the app, the problem reappears.

@Kaldo
Copy link

Kaldo commented Sep 27, 2024

Came here because of the same issue on freshly installed Bazzite, even just logging out the current user makes Signal throw the "database error occurred" next time I try to start it up. Installed with a flatpak.

@adioe3
Copy link

adioe3 commented Sep 27, 2024

Same as @theborakompanioni , nothing special simply started the app. It's a Framework 13 laptop so it could be it ran out of battery and powered off but doubt that would cause corruption.

Today I get this error:

Unable to access the database encryption key because the OS encryption keyring has changed from gnome_libsecret to basic_text. This can occur if the desktop environment changes, for example between GNOME and KDE.

Please switch to the previous desktop environment or try to run signal with the command line flag --password-store="gnome-libsecret"

Note I have made no changes aside from keeping my system up-to-date with dnf update and flatpak upgrade.

At the moment, I cannot start Signal at all and have lost all the data I had on this laptop which is, not gonna lie, a little frustrating.

@adioe3
Copy link

adioe3 commented Sep 27, 2024

Error log:

2024-09-27 17:20:13.156: ERROR CORE sqlcipher_page_cipher: hmac check failed for pgno=1
2024-09-27 17:20:13.156: ERROR CORE sqlite3Codec: error decrypting page 1 data: 1
2024-09-27 17:20:13.156: ERROR CORE sqlcipher_codec_ctx_set_error 1
{"level":40,"time":"2024-09-27T15:20:13.157Z","msg":"MainSQL: Database log code=26: file is not a database in \"PRAGMA journal_mode = WAL\""}
{"level":30,"time":"2024-09-27T15:20:13.157Z","msg":"MainSQL: migrateDatabase: Migration without cipher change failed"}
2024-09-27 17:20:13.187: ERROR CORE sqlcipher_page_cipher: hmac check failed for pgno=1
2024-09-27 17:20:13.187: ERROR CORE sqlite3Codec: error decrypting page 1 data: 1
2024-09-27 17:20:13.187: ERROR CORE sqlcipher_codec_ctx_set_error 1
{"level":40,"time":"2024-09-27T15:20:13.188Z","msg":"MainSQL: Database log code=26: statement aborts at 2: [PRAGMA user_version] file is not a database"}
{"level":50,"time":"2024-09-27T15:20:13.189Z","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)"}

@adioe3
Copy link

adioe3 commented Sep 27, 2024

After manually deleting the database from .var/app/org.signal.Signal/config/Signal/sql/ and starting I see in the error logs:

# ... trimmed parts, let me know if you want em ...
"level":30,"time":"2024-09-27T15:28:38.312Z","msg":"MainSQL: updateToSchemaVersion1180: success!"}
{"level":30,"time":"2024-09-27T15:28:38.315Z","msg":"MainSQL: updateToSchemaVersion1190: success!"}
{"level":30,"time":"2024-09-27T15:28:38.315Z","msg":"MainSQL: enableFTS5SecureDelete: enabling"}
{"level":30,"time":"2024-09-27T15:28:38.316Z","msg":"MainSQL: updateSchema: optimize took 1ms"}
{"level":30,"time":"2024-09-27T15:28:38.692Z","msg":"got fast theme-setting value system"}
{"level":50,"time":"2024-09-27T15:28:39.080Z","msg":"sql.initialize was unsuccessful; returning early"}
{"level":30,"time":"2024-09-27T15:28:39.080Z","msg":"close event {\"readyForShutdown\":false,\"shouldQuit\":false}"}
{"level":30,"time":"2024-09-27T15:28:39.080Z","msg":"maybeRequestCloseConfirmation: Checking to see if close confirmation is needed"}
{"level":50,"time":"2024-09-27T15:28:52.058Z","msg":"onDatabaseError: Quitting application"}
{"level":30,"time":"2024-09-27T15:28:52.059Z","msg":"main window closed event"}
{"level":30,"time":"2024-09-27T15:28:52.060Z","msg":"quit event {\"hasEventBeenPrevented\":false,\"windowCount\":0,\"mainWindowExists\":false}"}
{"level":50,"time":"2024-09-27T15:28:52.061Z","msg":"maybeRequestCloseConfirmation: Response never received; continuing with close."}

This line is very interesting:

{"level":50,"time":"2024-09-27T15:28:39.080Z","msg":"sql.initialize was unsuccessful; returning early"}

thing is you don't seem to actually log the SQL errors so it's hard to say what goes wrong.

@ibganev
Copy link

ibganev commented Sep 27, 2024

Happens with 100% reproducibility on my current Fedora 40 laptop. Signal-desktop is installed as a snap application (as there are no native Fedora RPMs.)

@adioe3
Copy link

adioe3 commented Sep 29, 2024

What fixes it for me was:

sudo flatpak override --no-talk-name=org.freedesktop.Secrets org.signal.Signal

and now I can use desktop again until this is fixed.

@Je-sse
Copy link

Je-sse commented Oct 16, 2024

What fixes it for me was:

sudo flatpak override --no-talk-name=org.freedesktop.Secrets org.signal.Signal

and now I can use desktop again until this is fixed.

Hi, I'm relatively new to Linux and I'm experiencing the same issue with Signal on Fedora. I want to understand the command better.
I found the Flatpak Command Reference that explains the flatpack override command:
Overrides the application specified runtime requirements. This can be used to grant a sandboxed application more or less resources than it requested.

Additionally, the --no-talk-name option is described as:
Don't allow the application to talk to the well-known name NAME on the session bus. This overrides to the Context section from the application metadata. This option can be used multiple times.

This information is pretty clear. However, could you please explain what the name org.freedesktop.Secrets is?
Also, if I want to undo the fix, can I just run this command?
sudo flatpak override --talk-name=org.freedesktop.Secrets org.signal.Signal

@bikubi
Copy link

bikubi commented Oct 17, 2024

"Same," although I suspect in my case it is (almost) always after crash / power loss.

I don't think that a power loss should be able to corrupt my chat history so hard it needs to be wiped...

file ~/.config/Signal/sql
# db.sqlite: data

sqlite3 ~/.config/Signal/db.sqlite ".dump" # ".recover" doesn't work either
# sql error: file is not a database (26)
# PRAGMA foreign_keys=OFF;
# BEGIN TRANSACTION;
# /**** ERROR: (26) file is not a database *****/
# ROLLBACK; -- due to errors

I'm on Arch, signal-desktop 7.28.0-1 from extra, no snap/flatpak.

2024-10-17 10:05:22.296: ERROR CORE sqlcipher_page_cipher: hmac check failed for pgno=1
2024-10-17 10:05:22.296: ERROR CORE sqlite3Codec: error decrypting page 1 data: 1
2024-10-17 10:05:22.296: ERROR CORE sqlcipher_codec_ctx_set_error 1
{"level":40,"time":"2024-10-17T08:05:22.296Z","msg":"MainSQL: Database log code=26: file is not a database in \"PRAGMA journal_mode = WAL\""}
{"level":30,"time":"2024-10-17T08:05:22.297Z","msg":"MainSQL: migrateDatabase: Migration without cipher change failed"}
2024-10-17 10:05:22.366: ERROR CORE sqlcipher_page_cipher: hmac check failed for pgno=1
2024-10-17 10:05:22.366: ERROR CORE sqlite3Codec: error decrypting page 1 data: 1
2024-10-17 10:05:22.366: ERROR CORE sqlcipher_codec_ctx_set_error 1
{"level":40,"time":"2024-10-17T08:05:22.367Z","msg":"MainSQL: Database log code=26: statement aborts at 2: [PRAGMA user_version] file is not a database"}
{"level":50,"time":"2024-10-17T08:05:22.368Z","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:406:54)\n    at openAndMigrateDatabase ([REDACTED]/ts/sql/Server.js:438:5)\n    at openAndSetUpSQLCipher ([REDACTED]/ts/sql/Server.js:460:14)\n    at initialize ([REDACTED]/ts/sql/Server.js:507: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)"}

@SpamixOfficial
Copy link

To anyone who finds this thread and happens to be on Fedora, use the NATIVE PACKAGE.

The flatpak build seems to cause this issue

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