snapcrafters / signal-desktop

Unofficial Signal Desktop installer for Linux
https://snapcraft.io/signal-desktop
GNU Affero General Public License v3.0
34 stars 13 forks source link

[Bug]: signal-desktop does not start due to database-error #300

Open KlausC opened 1 month ago

KlausC commented 1 month ago

What happened?

Application starts and an error window pops upDatabase startup error:

grafik

When I follow the instructions and delete all data, I can re-connect the device to the account and send a message. But after I close the app and try to start again, the same error window re-appears.

What should have happened?

signal-desktop should start without forcing me to delete data and re-connect.

Output of snap info $snap_name

$ snap info signal-desktop
name:      signal-desktop
summary:   Speak Freely - Private Messenger
publisher: Snapcrafters✪
store-url: https://snapcraft.io/signal-desktop
contact:   https://github.com//snapcrafters/signal-desktop/issues
license:   AGPL-3.0-only
description: |
  **Note: To use the Signal desktop app, you must first install Signal on your phone.**

  Millions of people use Signal every day for free and instantaneous communication anywhere in the
  world. Send and receive high-fidelity messages, participate in HD voice/video calls, and explore a
  growing set of new features that help you stay connected. Signal's advanced privacy-preserving
  technology is always enabled, so you can focus on sharing the moments that matter with the people
  who matter to you.

  - Say anything - State-of-the-art end-to-end encryption (powered by the open source Signal
  Protocol™) keeps your conversations secure. Privacy isn't an optional mode; it's just the way that
  Signal works. Every message, every call, every time.
  - Go fast - Messages are delivered quickly and reliably, even on slow networks. Signal is
  optimized to operate in the most constrained environment possible.
  - Feel free - Signal is a completely independent 501c3 nonprofit. Development is supported by
  users like you. No advertisements. No trackers. No kidding.
  - Be yourself - You can use your existing phone number and address book to securely communicate
  with your friends.
  - Speak up - Whether they live across town or across the ocean, Signal's enhanced audio and video
  quality will make your friends and family feel closer.
  - Whisper in the shadows - Switch to the dark theme if you refuse to see the light.

  **Minimize to tray**

  Per the request of the Signal developers, this snap does not use the system tray by default. This
  is disabled by default per the request of the Signal developers, because system tray support is
  not stable. Set to `false`, Signal will stop when you close it and will not have a system tray
  icon. You can enable it by running the following command.

      snap set signal-desktop tray-icon=true

  **Are you having issues?**

  Let us know by creating a new issue here: https://github.com/snapcrafters/signal-desktop/issues

  **Authors**

  This snap is maintained by the Snapcrafters community, and is not necessarily endorsed or
  officially maintained by the upstream developers.
commands:
  - signal-desktop
snap-id:      r4LxMVp7zWramXsJQAKdamxy6TAWlaDD
tracking:     latest/stable
refresh-date: today at 11:07 CEST
channels:
  latest/stable:    7.17.0 2024-07-29 (675) 196MB -
  latest/candidate: 7.17.0 2024-07-29 (675) 196MB -
  latest/beta:      ↑                             
  latest/edge:      ↑                             
installed:          7.17.0            (675) 196MB -

Output of snap connections $snap_name

$ snap connections signal-desktop
Interface               Plug                                   Slot                            Notes
audio-playback          signal-desktop:audio-playback          :audio-playback                 -
audio-record            signal-desktop:audio-record            :audio-record                   -
browser-support         signal-desktop:browser-support         :browser-support                -
camera                  signal-desktop:camera                  :camera                         -
content[gnome-42-2204]  signal-desktop:gnome-42-2204           gnome-42-2204:gnome-42-2204     -
content[gtk-3-themes]   signal-desktop:gtk-3-themes            gtk-common-themes:gtk-3-themes  -
content[icon-themes]    signal-desktop:icon-themes             gtk-common-themes:icon-themes   -
content[sound-themes]   signal-desktop:sound-themes            gtk-common-themes:sound-themes  -
desktop                 signal-desktop:desktop                 :desktop                        -
desktop-legacy          signal-desktop:desktop-legacy          :desktop-legacy                 -
gsettings               signal-desktop:gsettings               :gsettings                      -
home                    signal-desktop:home                    :home                           -
network                 signal-desktop:network                 :network                        -
opengl                  signal-desktop:opengl                  :opengl                         -
removable-media         signal-desktop:removable-media         -                               -
screen-inhibit-control  signal-desktop:screen-inhibit-control  :screen-inhibit-control         -
unity7                  signal-desktop:unity7                  :unity7                         -
wayland                 signal-desktop:wayland                 :wayland                        -
x11                     signal-desktop:x11                     :x11                            -

Output of snap version

$ snap version
snap    2.63-0.fc40
snapd   2.63-0.fc40
series  16
fedora  40
kernel  6.9.11-200.fc40.x86_64

Relevant log output

[   34.915452] show_signal: 13 callbacks suppressed
[   34.915457] traps: signal-desktop[5826] trap int3 ip:5561d07c09af sp:7fff4bf89de0 error:0 in signal-desktop[5561cc879000+8646000]
[  458.513720] traps: signal-desktop[8906] trap int3 ip:55586a3745fa sp:7fffdb372b50 error:0 in signal-desktop[55586652b000+8646000]
[  657.018948] traps: signal-desktop[10491] trap int3 ip:5635b7d3fdf6 sp:7ffc5e3ddbf0 error:0 in signal-desktop[5635b25fa000+8646000]
[  761.945716] traps: signal-desktop[11179] trap int3 ip:559fafadddf6 sp:7ffc2b727bd0 error:0 in signal-desktop[559faa398000+8646000]
[ 1736.762010] traps: signal-desktop[12583] trap int3 ip:55f3d9e38df6 sp:7fff3441e600 error:0 in signal-desktop[55f3d46f3000+8646000]

Teminal output of app

$ signal-desktop
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 klausnuc
NODE_APP_INSTANCE undefined
SUPPRESS_NO_CONFIG_WARNING undefined
SIGNAL_ENABLE_HTTP undefined
userData: /home/crusius/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"

(signal-desktop:15129): Gtk-WARNING **: 12:01:03.771: 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: 12:01:03.772: Failed to load module "canberra-gtk-module"
Gtk-Message: 12:01:03.772: Failed to load module "pk-gtk-module"

(signal-desktop:15129): Gtk-WARNING **: 12:01:03.773: 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: 12:01:03.773: Failed to load module "canberra-gtk-module"
Gtk-Message: 12:01:03.773: Failed to load module "pk-gtk-module"
Warning: build/dns-fallback.json not build, run `yarn generate`
{"level":30,"time":"2024-07-31T10:01:03.982Z","msg":"got fast localeOverride setting null"}
{"level":30,"time":"2024-07-31T10:01:03.983Z","msg":"app.ready: hour cycle preference: UnknownPreference"}
{"level":30,"time":"2024-07-31T10:01:03.983Z","msg":"app.ready: preferred system locales: de-DE, de"}
{"level":30,"time":"2024-07-31T10:01:03.984Z","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-31T10:01:03.984Z","msg":"locale: Preferred locales: de-DE, de"}
{"level":30,"time":"2024-07-31T10:01:03.984Z","msg":"locale: Locale Override: null"}
{"level":30,"time":"2024-07-31T10:01:03.985Z","msg":"locale: Matched locale: de"}
{"level":40,"time":"2024-07-31T10:01:04.016Z","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-07-31T10:01:04.017Z","msg":"locale: Text info direction for de: ltr"}
{"level":30,"time":"2024-07-31T10:01:04.017Z","msg":"getSQLKey: decrypting key"}
{"level":30,"time":"2024-07-31T10:01:04.017Z","msg":"getSystemTraySetting got value DoNotUseSystemTray"}
{"level":30,"time":"2024-07-31T10:01:04.018Z","msg":"getSystemTraySetting returning DoNotUseSystemTray"}
{"level":30,"time":"2024-07-31T10:01:04.019Z","msg":"app ready"}
{"level":30,"time":"2024-07-31T10:01:04.019Z","msg":"starting version 7.17.0"}
{"level":30,"time":"2024-07-31T10:01:04.019Z","msg":"media access status [object Undefined] [object Undefined]"}
{"level":30,"time":"2024-07-31T10:01:04.020Z","msg":"got fast theme-setting value system"}
{"level":30,"time":"2024-07-31T10:01:04.025Z","msg":"got fast theme-setting value system"}
{"level":30,"time":"2024-07-31T10:01:04.025Z","msg":"got fast spellcheck setting true"}
{"level":30,"time":"2024-07-31T10:01:04.026Z","msg":"Initializing BrowserWindow config: {\"show\":false,\"width\":1920,\"height\":1008,\"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\":72}"}
{"level":30,"time":"2024-07-31T10:01:04.063Z","msg":"spellcheck: user locales: [\"de-DE\",\"de\"]"}
{"level":30,"time":"2024-07-31T10:01:04.063Z","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-31T10:01:04.063Z","msg":"spellcheck: setting languages to: [\"de-DE\",\"de\"]"}
{"level":40,"time":"2024-07-31T10:01:04.264Z","msg":"MainSQL: Database log code=26: file is not a database in \"PRAGMA journal_mode = WAL\""}
{"level":30,"time":"2024-07-31T10:01:04.265Z","msg":"MainSQL: migrateDatabase: Migration without cipher change failed"}
{"level":40,"time":"2024-07-31T10:01:04.320Z","msg":"MainSQL: Database log code=26: statement aborts at 2: [PRAGMA user_version] file is not a database"}
{"level":50,"time":"2024-07-31T10:01:04.321Z","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-31T10:01:04.321Z","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-31T10:01:04.321Z","msg":"Failed to get zoom factor {}"}
{"level":30,"time":"2024-07-31T10:01:04.689Z","msg":"got fast theme-setting value system"}
{"level":50,"time":"2024-07-31T10:01:05.231Z","msg":"sql.initialize was unsuccessful; returning early"}
{"level":30,"time":"2024-07-31T10:01:05.232Z","msg":"close event {\"readyForShutdown\":false,\"shouldQuit\":false}"}
{"level":30,"time":"2024-07-31T10:01:05.232Z","msg":"maybeRequestCloseConfirmation: Checking to see if close confirmation is needed"}
{"level":50,"time":"2024-07-31T10:01:17.760Z","msg":"onDatabaseError: Quitting application"}
{"level":30,"time":"2024-07-31T10:01:17.763Z","msg":"main window closed event"}
{"level":30,"time":"2024-07-31T10:01:17.764Z","msg":"quit event {\"hasEventBeenPrevented\":false,\"windowCount\":0,\"mainWindowExists\":false}"}
{"level":50,"time":"2024-07-31T10:01:17.766Z","msg":"Error occurred in handler for 'sql-channel': {}"}
{"level":50,"time":"2024-07-31T10:01:17.767Z","msg":"maybeRequestCloseConfirmation: Response never received; continuing with close."}
Unhandled Promise Rejection: Error: Not initialized
    at MainSQL.close (/snap/signal-desktop/675/opt/Signal/resources/app.asar/ts/sql/main.js:104:13)
    at BrowserWindow.<anonymous> (/snap/signal-desktop/675/opt/Signal/resources/app.asar/app/main.js:690:15)
{"level":50,"time":"2024-07-31T10:01:17.768Z","msg":"Unhandled Promise Rejection: Error: Not initialized\n    at MainSQL.close ([REDACTED]/ts/sql/main.js:104:13)\n    at BrowserWindow.<anonymous> ([REDACTED]/app/main.js:690:15)"}
jnsgruk commented 1 month ago

Hi - is this the first time you've used the snap, or has it started happening since an update?

KlausC commented 1 month ago

I observe this since a few days/weeks. Before it worked without issues for some years.

jnsgruk commented 1 month ago

Hmm, I'd be interested to see the state of the "corrupted" file - I'd be surprised if this is as a result of the snap packaging.

There does seem to be an upstream issue, along with some steps for recovery - are you able to confirm if those steps work for you? https://github.com/signalapp/Signal-Desktop/issues/4513

jnsgruk commented 1 month ago

Ahh another potential lead here - how's the disk space on your machine?

KlausC commented 1 month ago

Disk space seem not to be an issue, whence /var/lib/snap/ subdirs seem all to be complete:

/dev/loop17       188160    188160         0  100% /var/lib/snapd/snap/spotify/77
/dev/loop18       192384    192384         0  100% /var/lib/snapd/snap/signal-desktop/675
/dev/loop16        52608     52608         0  100% /var/lib/snapd/snap/nps-ssh-askpass/205
/dev/loop19       186240    186240         0  100% /var/lib/snapd/snap/spotify/78
/dev/loop20        84096     84096         0  100% /var/lib/snapd/snap/whatsdesk/28
tmpfs            8036488        92   8036396    1% /tmp
/dev/nvme0n1p2    996780    273304    654664   30% /boot
/dev/nvme0n1p3 975097856 641286056 326005032   67% /btrfs_pool
/dev/nvme0n1p3 975097856 641286056 326005032   67% /home
KlausC commented 1 month ago

In the first link I did not find hint for recover from a corrupted database. Also if I snap remove signal-desktop and check the ~/snap/signal-desktop is empty, the bug persists after snap install signal-desktop and re-connect and re-start as described in the OP.

jnsgruk commented 1 month ago

Assuming you have a backup of the messages on another device, you could try snap remove --purge signal-desktop, then reinstall?

KlausC commented 1 month ago

Yes, that did not change the behavior.

jnsgruk commented 1 month ago

Hmm, I'm a little lost on this one for now. Are you able to confirm if the behaviour happens if you install Signal from the deb?

KlausC commented 1 month ago

I have no other option than Snap on fedora, afaik.

KlausC commented 1 month ago

Correction: while I did not find signal-desktop in the repositories accessible with dnf, it was possible to install from the fedora software GUI. After removing the snap version, that seems to work now with version 7.17. Of course the local copy of my chats are lost; but still available on my Android mobile.

wiryonolau commented 1 month ago

Hi also happen to me, started on rev673

debian 12  Debian 6.7.12-1~bpo12+1 xfce
snap signal-desktop  v7.17.0   rev675 

on fresh install everything ok , but after next run always broken. this is the log when running from console a lot of REDACTED part don't know what its means.

{"level":40,"time":"2024-08-01T02:24:49.409Z","msg":"MainSQL: Database log code=26: file is not a database in \"PRAGMA journal_mode = WAL\""}
{"level":30,"time":"2024-08-01T02:24:49.409Z","msg":"MainSQL: migrateDatabase: Migration without cipher change failed"}
{"level":40,"time":"2024-08-01T02:24:49.461Z","msg":"MainSQL: Database log code=26: statement aborts at 2: [PRAGMA user_version] file is not a database"}
{"level":50,"time":"2024-08-01T02:24:49.461Z","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-01T02:24:49.462Z","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)"}
vgallissot commented 1 month ago

Hi, also happened to me, seems related to cipher change at launch (cipher not recognized while opening database file, so considering database corrupt ?).

{"level":30,"time":"2024-08-01T08:18:27.409Z","msg":"spellcheck: setting languages to: [\"en-US\",\"en\"]"}
{"level":40,"time":"2024-08-01T08:18:27.598Z","msg":"MainSQL: Database log code=26: file is not a database in \"PRAGMA journal_mode = WAL\""}
{"level":30,"time":"2024-08-01T08:18:27.598Z","msg":"MainSQL: migrateDatabase: Migration without cipher change failed"}
{"level":40,"time":"2024-08-01T08:18:27.629Z","msg":"MainSQL: Database log code=26: statement aborts at 2: [PRAGMA user_version] file is not a database"}
{"level":50,"time":"2024-08-01T08:18:27.629Z","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-01T08:18:27.630Z","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-01T08:18:27.630Z","msg":"Failed to get zoom factor {}"}
{"level":30,"time":"2024-08-01T08:18:27.931Z","msg":"got fast theme-setting value system"}
{"level":50,"time":"2024-08-01T08:18:28.342Z","msg":"sql.initialize was unsuccessful; returning early"}
{"level":30,"time":"2024-08-01T08:18:28.343Z","msg":"close event {\"readyForShutdown\":false,\"shouldQuit\":false}"}
{"level":30,"time":"2024-08-01T08:18:28.343Z","msg":"maybeRequestCloseConfirmation: Checking to see if close confirmation is needed"}
{"level":50,"time":"2024-08-01T08:18:30.664Z","msg":"onDatabaseError: Deleting all data"}
{"level":50,"time":"2024-08-01T08:18:30.665Z","msg":"Error occurred in handler for 'sql-channel': {}"}
{"level":40,"time":"2024-08-01T08:18:30.665Z","msg":"MainSQL: removeDB: Removing all database files"}
{"level":30,"time":"2024-08-01T08:18:30.665Z","msg":"main window is ready-to-show"}
{"level":30,"time":"2024-08-01T08:18:30.666Z","msg":"config/remove: Deleting user config from disk"}
{"level":30,"time":"2024-08-01T08:18:30.666Z","msg":"config/remove: Deleted user config from disk"}
{"level":50,"time":"2024-08-01T08:18:30.666Z","msg":"onDatabaseError: Requesting immediate restart after quit"}
{"level":50,"time":"2024-08-01T08:18:30.690Z","msg":"onDatabaseError: Quitting application"}
{"level":30,"time":"2024-08-01T08:18:30.691Z","msg":"main window closed event"}
{"level":30,"time":"2024-08-01T08:18:30.692Z","msg":"quit event {\"hasEventBeenPrevented\":false,\"windowCount\":0,\"mainWindowExists\":false}"}
FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal
----- Native stack trace -----

[1]    8895 IOT instruction  signal-desktop

I tried to uninstall and re-install, I can launch the app and sync with the phone, but same error occurs at every launch, even on the first launch after a fresh install.

I even tried to purge all with: snap remove --purge signal-desktop

alpha14 commented 1 month ago

Happened to my installation of signal-destop (7.17.0) a few days ago. Tried resetting the local data and re linking to phone as proposed by the launcher. Tried reinstalling, same corruption happened three times in a row. Before that, It worked for months without any issue.

jnsgruk commented 1 month ago

Hmm, okay I think this was a bug in Signal 7.17. Looking at the comparison for 7.18 (released last night), there appear to be a few commits related to the sql database on Linux: https://github.com/signalapp/Signal-Desktop/compare/v7.18.0...v7.17.0

I'll kick off the update now.

jnsgruk commented 1 month ago

Hi all - still waiting on the full build for arm64, but if you're on an amd64 machine, you should be able to try sudo snap refresh signal-desktop --channel latest/candidate to try out the next version and see if that solves the issue.

If you're installing from scratch it'll be sudo snap install signal-desktop --channel latest/candidate

alpha14 commented 1 month ago

@jnsgruk Just tried 7.18.0 with a fresh re-link, I still have the same database error upon restarting the application.

jnsgruk commented 1 month ago

Hmm, looks like this is also an issue on the Flatpak, and on other distros: https://github.com/signalapp/Signal-Desktop/issues/6750

vgallissot commented 1 month ago

Problem is still here on 7.18 for me.

I had to install 7.15 to get back on a crash-free version. (Source) # snap install signal-desktop --revision=671

So, whether in 7.16, 7.17 or 7.18, launching Signal-desktop causes a database file error that forces you to delete all the data in 7.17 and 7.18, but the error was recoverable in 7.16 (you had to choose to recover the database at launch). Each time you launch Signal-desktop 7.17 or 7.18 (new or existing), you have to delete all the data and resynchronise the phone.

jnsgruk commented 1 month ago

I've been trying to repro all morning and failed. Interesting that is on Fedora 40, which is also where the reported error is upstream.

Is anyone on this thread seeing this with Ubuntu?

alpha14 commented 1 month ago

@jnsgruk Yes I'm having that issue on Ubuntu 24.04 (kern 6.9.9)

vgallissot commented 1 month ago

having this issue on Fedora 29 6.9.11-100.fc39.x86_64

jnsgruk commented 1 month ago

@jnsgruk Yes I'm having that issue on Ubuntu 24.04 (kern 6.9.9)

Now that's super odd. Can I ask if you're able to repro on a clean Noble VM? I've been trying to with that exact setup, and not been able to.

jnsgruk commented 1 month ago

Out of interest, if you run snap connect signal-desktop:password-manager-service and re-pair etc., does the issue persist?

alpha14 commented 1 month ago

@jnsgruk

$ sudo snap connect signal-desktop:password-manager-service
error: snap "signal-desktop" has no plug named "password-manager-service"

I'll try with a fresh VM and let you know

jo-oe commented 1 month ago

I have the same issue, Fedora 40 (Linux 6.10.1-200.fc40.x86_64) here. Tried installing 7.18 (from latest/candidate), snap rev 678, problem persists. With 7.15, snap rev 671, everything works as expected.

fyptog commented 1 month ago

I have the same issue in Ubuntu arm64 (ubuntu 24.04, Linux 6.1.0-1021-rockchip - Joshua Riek), on 4 machines. Rolled back to 7.15.0 (arm64 rev672) because we need Signal Desktop in order to do our work. sudo snap install signal-desktop --revision=672 sudo snap refresh --hold signal-desktop

sean-abbott commented 1 month ago

I have this issue on a new pop-os machine, using snap.

snap-id:      r4LxMVp7zWramXsJQAKdamxy6TAWlaDD
tracking:     latest/stable
refresh-date: today at 11:33 EDT
channels:
  latest/stable:    7.18.0 2024-08-02 (679) 183MB -
  latest/candidate: 7.18.0 2024-08-02 (679) 183MB -

Been happening since we got the new machine about a month ago.

$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"

I'm trying the revision=671 workaround...and it appears to work. Hopefully this can be resolved before any updates that will break the older client. :-)

torrycrass commented 1 month ago

Same situation here but also cannot revert. It seems 671 is no longer available, at least for me. I was only able to revert to version 675 and that version did not help resolve the problem. Same errors as everyone above running Fedora as base OS so this seems pretty app specific.

Installed version:

snap-id:      r4LxMVp7zWramXsJQAKdamxy6TAWlaDD
tracking:     latest/stable
refresh-date: yesterday at 04:35 EDT
channels:
  latest/stable:    7.18.0 2024-08-02 (679) 183MB -
  latest/candidate: 7.18.0 2024-08-02 (679) 183MB -
  latest/beta:      ↑                             
  latest/edge:      ↑                             
installed:          7.18.0            (679) 183MB -

Attempt to revert to 671:

$ sudo snap revert signal-desktop --revision=671
error: cannot revert "signal-desktop": cannot find revision 671 for snap "signal-desktop"

Attempt to revert to anything at all, found successful revert (but still broken) with 675:

$ sudo snap revert signal-desktop --revision=675
signal-desktop reverted to 7.17.0
digiphaze commented 1 month ago

Same issue. Ubuntu 24.04 Kernel 6.9.11 Previous update gave me the error and I reluctantly deleted the data.. It worked for after, then this last update 7.18.0 rev 679 now throws the error on every attempt to run it. Even after purging and re-installing.

level":50,"time":"2024-08-05T00:57:16.461Z","msg":"MainSQL: Database startup error: Error: setupSQLCipher: key '�>8!���˯�I�M�u0��L�W�r'i߉AM�� cOB\u0019\t�Y�Oa�6�P�g\\\u0019���'\u0019�C�U ���w��Cg�' is not valid\n at openAndSetUpSQLCipher ([REDACTED]/ts/sql/Server.js:438:11)\n at Object.initialize ([REDACTED]/ts/sql/Server.js:476:16)\n at MessagePort. ([REDACTED]/ts/sql/mainWorker.js:84:35)\n at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20)\n at MessagePort. (node:internal/per_context/messageport:23:28)"} `

vgallissot commented 1 month ago

@torrycrass

Attempt to revert to anything at all, found successful revert (but still broken) with 675:

$ sudo snap revert signal-desktop --revision=675
signal-desktop reverted to 7.17.0

Apparently with snap, revert only works for recently installed versions.

You should try the following:

snap remove --purge signal-desktop            # remove latest version
snap install signal-desktop --revision=671   # install 7.15
snap list            # ensure you installed the 7.15 version
snap refresh --hold=forever signal-desktop    # freeze updates for this package
digital-codes commented 1 month ago

@torrycrass

Attempt to revert to anything at all, found successful revert (but still broken) with 675:

$ sudo snap revert signal-desktop --revision=675
signal-desktop reverted to 7.17.0

Apparently with snap, revert only works for recently installed versions.

You should try the following:

snap remove --purge signal-desktop            # remove latest version
snap install signal-desktop --revision=671   # install 7.15
snap list            # ensure you installed the 7.15 version
snap refresh --hold=forever signal-desktop    # freeze updates for this package

Did work on my Fedora 39, after renaming desktop file:

sudo mv /var/lib/snapd/desktop/applications/signal-desktop_signal-desktop.desktop /var/lib/snapd/desktop/applications/signal-desktop.desktop

However, this is only a workaround and updates are blocked. What's the true cause for this bug?

jnsgruk commented 1 month ago

I'm pretty sure this is an upstream bug, and unfortunately not one I can reproduce so I'm having trouble making progress at the moment.

One option I can try is to add the password-manager-service plug, and publish a candidate build for you to try. I'll work on that today.

jnsgruk commented 1 month ago

@digital-codes or @digiphaze are you able to test the new revison?

sudo snap remove --purge signal-desktop
sudo snap install signal-desktop --channel latest/candidate
sudo snap connect signal-desktop:password-manager-service

Then try linking/restarting, etc.?

ronidee commented 1 month ago

I'm experiencing the same issue, on Ubuntu 23.10, x86-64 CPU. However, I'm using the .deb version. Is there any information I can provide to aid debugging this issue?

After closing the first error (Database Error, same as OP), a second error popup appears: image

jnsgruk commented 1 month ago

Yeh, I think this is the problem - this is not a snap packaging issue, and therefore unlikely we're going to be able to fix in this repository.

padames commented 1 month ago

I had the same database error this morning on Ubuntu 22.04.4 LTS immediately after installing the snap updates for signal-desktop. The error crashes the app because the only two buttons in the popup are quit and copy error and quit. I rebooted the laptop to no effect on the bug. Reverting to version 671 removed the error.

$ sudo snap install signal-desktop --revision=671
signal-desktop 7.15.0 from Snapcrafters✪ installed

I have the Linux kernel 6.5.0-45-generic

I think this is caused by bug #6750 Frequent database errors that crashes Signal. Restart possible, but errors increasingly more frequent

Another comment on this thread states that the deb package version also shows the error. I wonder if a complete purge of software and data is required before testing the deb package after seeing the error from the Snap package.

What is the official and thus supported way to install Signal-Desktop on Ubuntu?

We need to get our Signal-Desktop back on Ubuntu. Should I avoid updates for now?

Thanks

ronidee commented 1 month ago

The official way is listed on the signal download page:

Linux (Debian-based) Install Instructions

# NOTE: These instructions only work for 64-bit Debian-based
# Linux distributions such as Ubuntu, Mint etc.

# 1. Install our official public software signing key:
wget -O- https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor > signal-desktop-keyring.gpg
cat signal-desktop-keyring.gpg | sudo tee /usr/share/keyrings/signal-desktop-keyring.gpg > /dev/null

# 2. Add our repository to your list of repositories:
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' |\
  sudo tee /etc/apt/sources.list.d/signal-xenial.list

# 3. Update your package database and install Signal:
sudo apt update && sudo apt install signal-desktop

https://signal.org/de/download/#

fyptog commented 1 month ago

Works well unless you need arm64, in which case Snap is it. There's no other option.

jbntlff commented 4 weeks ago

I have the exact same problem. Initial install runs good but a close and start will crash and give DB error.

Running on: Distributor ID: Ubuntu Description: Ubuntu 24.04 LTS Release: 24.04 Codename: noble

Revision 671 works !!!

JLD-sudo commented 4 weeks ago

I have recently been having the same "Database Error" message upon opening my Signal desktop app version 7.19.1. while using Ubuntu 20.04 LTS. Have tried "Copy error and quit" but nothing happens. Also tried "Delete data and restart" multiple times and relinked my mobile each time but when I close down my desktop app it fails to start up again without going through the whole process I just described. I have uninstalled/reinstalled my desktop app multiple times as well and that also doesn't work to fix the issue. It appears this issue affects various Ubuntu users regardless of using a deb or snap package. Sure miss using my Signal desktop!

lizthegrey commented 1 week ago

The problem for me appears to be that the latest bundled version of better-sqlite3 is compiled against GLIBC_2.38 which core22 lacks.

$ signal-dekstop
...
{"level":50,"time":"2024-08-29T16:04:50.049Z","msg":"MainSQL: Database startup error: Error: /snap/core22/current/usr/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by [REDACTED].unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node)\n    at process.func [as dlopen] (node:electron/js2c/node_init:2:2559)\n    at Module._extensions..node (node:internal/modules/cjs/loader:1470:18)\n    at Object.func [as .node] (node:electron/js2c/node_init:2:2786)\n    at Module.load (node:internal/modules/cjs/loader:1215:32)\n    at Module._load (node:internal/modules/cjs/loader:1031:12)\n    at c._load (node:electron/js2c/node_init:2:17025)\n    at Module.require (node:internal/modules/cjs/loader:1240:19)\n    at require (node:internal/modules/helpers:179:18)\n    at bindings ([REDACTED]/node_modules/@signalapp/better-sqlite3/node_modules/bindings/bindings.js:112:48)\n    at new Database ([REDACTED]/node_modules/@signalapp/better-sqlite3/lib/database.js:48:64)"}
...
$ ldd /snap/signal-desktop/694/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node 
/snap/signal-desktop/694/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /snap/signal-desktop/694/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node)
/snap/signal-desktop/694/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /snap/signal-desktop/694/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node)
        linux-vdso.so.1 (0x00007ffca01c3000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f6a8da00000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6a8e4ef000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6a8e4cf000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6a8d600000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f6a8e5e8000)
jnsgruk commented 1 week ago

The problem for me appears to be that the latest bundled version of better-sqlite3 is compiled against GLIBC_2.38 which core22 lacks.

$ signal-dekstop
...
{"level":50,"time":"2024-08-29T16:04:50.049Z","msg":"MainSQL: Database startup error: Error: /snap/core22/current/usr/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by [REDACTED].unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node)\n    at process.func [as dlopen] (node:electron/js2c/node_init:2:2559)\n    at Module._extensions..node (node:internal/modules/cjs/loader:1470:18)\n    at Object.func [as .node] (node:electron/js2c/node_init:2:2786)\n    at Module.load (node:internal/modules/cjs/loader:1215:32)\n    at Module._load (node:internal/modules/cjs/loader:1031:12)\n    at c._load (node:electron/js2c/node_init:2:17025)\n    at Module.require (node:internal/modules/cjs/loader:1240:19)\n    at require (node:internal/modules/helpers:179:18)\n    at bindings ([REDACTED]/node_modules/@signalapp/better-sqlite3/node_modules/bindings/bindings.js:112:48)\n    at new Database ([REDACTED]/node_modules/@signalapp/better-sqlite3/lib/database.js:48:64)"}
...
$ ldd /snap/signal-desktop/694/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node 
/snap/signal-desktop/694/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /snap/signal-desktop/694/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node)
/snap/signal-desktop/694/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /snap/signal-desktop/694/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node)
        linux-vdso.so.1 (0x00007ffca01c3000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f6a8da00000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6a8e4ef000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6a8e4cf000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6a8d600000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f6a8e5e8000)

Aha that's interesting - I'd not seen that before. That probably is something we can fix by building the better-sqlite binaries as part of our build process (currently we're fetching pre-built binaries from Signal).

silvermar commented 1 week ago

Just installed version 7.22.0 on Fedora 40 but the bug persists. The Flatpak version runs fine but I'd prefer using the snap app, if possible.

debug686 commented 1 week ago

Seems to be fixed by 7.22.1. Please update as soon as possible. https://github.com/signalapp/Signal-Desktop/issues/6996#issuecomment-2318323039

debug686 commented 1 week ago

@jnsgruk

jnsgruk commented 1 week ago

I've kicked off our update/release process - will comment here when it's ready to test.

lizthegrey commented 1 week ago

No joy.

$ ldd /snap/signal-desktop/696/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node 
/snap/signal-desktop/696/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /snap/signal-desktop/696/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node)
/snap/signal-desktop/696/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /snap/signal-desktop/696/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node)
        linux-vdso.so.1 (0x00007ffcc1ce3000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9254800000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9254b19000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f92552c9000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9254400000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f92552fb000)
debug686 commented 1 week ago

I installed 7.22.2, copied over the folder from an older version, and got Signal-desktop to start again. I lost all data since i made that copy, but at least it starts again.

jnsgruk commented 1 week ago

No joy.


$ ldd /snap/signal-desktop/696/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node 

/snap/signal-desktop/696/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /snap/signal-desktop/696/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node)

/snap/signal-desktop/696/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /snap/signal-desktop/696/opt/Signal/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node)

        linux-vdso.so.1 (0x00007ffcc1ce3000)

        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9254800000)

        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9254b19000)

        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f92552c9000)

        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9254400000)

        /lib64/ld-linux-x86-64.so.2 (0x00007f92552fb000)

This feels like a separate issue to me, even if related. Can you file an issue to track that separately? Thank you!