Mailspring Could not Store your account securely -- BUG

Description

I updated to Plasma 6.0.1 on Archlinux, I started getting the following error when I try to open mailspring:

This happens every time I try to login to mailspring. Both libsecretand gnome-keyring is installed.

Expected Behavior

I expect mailspring to authenticate my account and the window to disappear

Setup

Archlinux Mailspring 1.13.3-1

I am facing the same issue after updating Plasma from 5.27.10 to 6.0.1. None of my accounts are operational and I am not able to reauthenticate or add new ones. It seems to have something to do with KWallet integration as per the console output below. Other applications using KWallet (Chromium, Element [electron client]) are continuing to work normally after the Plasma update.

Setup

Mailspring 1.13.3-9a7e1a78
KDE Plasma 6.0.1
Arch Linux 6.7.8-arch1-1

Screenshots

image

image

Console Output

~ ❯ mailspring
Running database migrations
App load time: 163ms

{"error":null}
src/gbm_drv_common.c:130: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

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

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

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

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

Manual update check (updates.getmailspring.com/check/linux/x64/1.13.3-9a7e1a78/anonymous/stable) returned 204
[9531:0307/185810.870883:ERROR:object_proxy.cc(623)] Failed to call method: org.kde.KWallet.isEnabled: object_path= /modules/kwalletd: org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
[9531:0307/185810.870902:ERROR:kwallet_dbus.cc(100)] Error contacting kwalletd (isEnabled)
[9531:0307/185810.870984:ERROR:object_proxy.cc(623)] Failed to call method: org.kde.KLauncher.start_service_by_desktop_name: object_path= /KLauncher: org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
[9531:0307/185810.870992:ERROR:kwallet_dbus.cc(72)] Error contacting klauncher to start kwalletd
[9531:0307/185810.871054:ERROR:object_proxy.cc(623)] Failed to call method: org.kde.KWallet.close: object_path= /modules/kwalletd: org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
[9531:0307/185810.871061:ERROR:kwallet_dbus.cc(418)] Error contacting kwalletd (close)
Error: Could not call remote method 'encryptString'. Check that the method signature is correct. Underlying error: Error: Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.Underlying stack: Error: Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.
    at /usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:465:71
    at IpcMainImpl.<anonymous> (/usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:323:27)
    at IpcMainImpl.emit (node:events:513:28)
    at IpcMainImpl.emit (node:domain:489:12)
    at EventEmitter.<anonymous> (node:electron/js2c/browser_init:2:82058)
    at EventEmitter.emit (node:events:513:28)
    at EventEmitter.emit (node:domain:489:12)

    at /usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:468:25
    at IpcMainImpl.<anonymous> (/usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:323:27)
    at IpcMainImpl.emit (node:events:513:28)
    at IpcMainImpl.emit (node:domain:489:12)
    at EventEmitter.<anonymous> (node:electron/js2c/browser_init:2:82058)
    at EventEmitter.emit (node:events:513:28)
    at EventEmitter.emit (node:domain:489:12) {
  cause: {
    stack: 'Error: Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.\n' +
      '    at /usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:465:71\n' +
      '    at IpcMainImpl.<anonymous> (/usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:323:27)\n' +
      '    at IpcMainImpl.emit (node:events:513:28)\n' +
      '    at IpcMainImpl.emit (node:domain:489:12)\n' +
      '    at EventEmitter.<anonymous> (node:electron/js2c/browser_init:2:82058)\n' +
      '    at EventEmitter.emit (node:events:513:28)\n' +
      '    at EventEmitter.emit (node:domain:489:12)',
    message: 'Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.'
  }
} { pluginIds: [] }
(node:9531) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
(Use `mailspring --trace-deprecation ...` to show where the warning was created)

i also thought about kwallet integration issues, but it seems to be a problem with gnome-keyring specifically. I am not sure if mailspring uses kwallet at all (might be wrong)

Seeing this as well after updating to KDE 6 on Arch Linux today, along with a number of matching reports. Moving into this thread and referencing from the others to hopefully consolidate.

Mailspring does use kwallet albeit may be indirectly, I did notice a new setting in KWallet haven’t seen before though I also haven’t looked in quite a while - the “Use KWallet for the Secret Service interface” which is enabled and blocks other applications (including gnome keyring etc) :thinking: Tried disabling that briefly and re-trying but no change :man_shrugging:

Seems like it can’t contact kwalletd anymore, note also running with UseOzonePlatform and --ozone-platform=wayland to force wayland vs xwayland.
Console log

[23821:0311/162206.733397:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is egl, ANGLE is 
Running database migrations
App load time: 238ms

{"error":null}
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to open nvidia-drm: /usr/lib/dri/nvidia-drm_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
Manual update check (updates.getmailspring.com/check/linux/x64/1.13.3-9a7e1a78/(removed uid looking thing just in case)/stable) returned 204
[23779:0311/162207.286083:ERROR:object_proxy.cc(623)] Failed to call method: org.kde.KWallet.isEnabled: object_path= /modules/kwalletd: org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
[23779:0311/162207.286096:ERROR:kwallet_dbus.cc(100)] Error contacting kwalletd (isEnabled)
[23779:0311/162207.286218:ERROR:object_proxy.cc(623)] Failed to call method: org.kde.KLauncher.start_service_by_desktop_name: object_path= /KLauncher: org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
[23779:0311/162207.286226:ERROR:kwallet_dbus.cc(72)] Error contacting klauncher to start kwalletd
[23779:0311/162207.286277:ERROR:object_proxy.cc(623)] Failed to call method: org.kde.KWallet.close: object_path= /modules/kwalletd: org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
[23779:0311/162207.286282:ERROR:kwallet_dbus.cc(418)] Error contacting kwalletd (close)
TypeError: Cannot read properties of null (reading 'expiration')
    at Message.metadataForPluginId (file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64-6Ns7Ou/resources/app/src/flux/models/model-with-metadata.ts:82:15)
    at file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64-6Ns7Ou/resources/app/internal_packages/activity/lib/activity-event-store.tsx:123:36
    at Array.forEach (<anonymous>)
    at ActivityEventStore._onUpdateActivity (file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64-6Ns7Ou/resources/app/internal_packages/activity/lib/activity-event-store.tsx:121:73)
    at AnonymousObserver._onNext (file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64-6Ns7Ou/resources/app/internal_packages/activity/lib/activity-event-store.tsx:43:16)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/usr/share/mailspring/resources/app.asar/node_modules/rx-lite/rx.lite.js:1668:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/usr/share/mailspring/resources/app.asar/node_modules/rx-lite/rx.lite.js:1602:31)
    at AnonymousObserver.tryCatcher (/usr/share/mailspring/resources/app.asar/node_modules/rx-lite/rx.lite.js:67:31)
    at AutoDetachObserverPrototype.next (/usr/share/mailspring/resources/app.asar/node_modules/rx-lite/rx.lite.js:6495:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/usr/share/mailspring/resources/app.asar/node_modules/rx-lite/rx.lite.js:1602:31)
    at file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64-6Ns7Ou/resources/app/src/global/mailspring-observables.ts:156:77
    at file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64-6Ns7Ou/resources/app/src/flux/models/query-subscription.ts:322:41
    at Array.forEach (<anonymous>)
    at QuerySubscription._createResultAndTrigger (file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64-6Ns7Ou/resources/app/src/flux/models/query-subscription.ts:322:21)
    at file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64-6Ns7Ou/resources/app/src/flux/models/query-subscription.ts:277:12 { pluginIds: [ 'activity' ] }
(node:23779) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
(Use `mailspring --trace-deprecation ...` to show where the warning was created)
Raven: 429 - undefined

[NOTE Try re-setting up mailspring ID and then -]

Error: Could not call remote method 'encryptString'. Check that the method signature is correct. Underlying error: Error: Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.Underlying stack: Error: Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.
    at /usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:465:71
    at IpcMainImpl.<anonymous> (/usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:323:27)
    at IpcMainImpl.emit (node:events:513:28)
    at IpcMainImpl.emit (node:domain:489:12)
    at EventEmitter.<anonymous> (node:electron/js2c/browser_init:2:82058)
    at EventEmitter.emit (node:events:513:28)
    at EventEmitter.emit (node:domain:489:12)

    at /usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:468:25
    at IpcMainImpl.<anonymous> (/usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:323:27)
    at IpcMainImpl.emit (node:events:513:28)
    at IpcMainImpl.emit (node:domain:489:12)
    at EventEmitter.<anonymous> (node:electron/js2c/browser_init:2:82058)
    at EventEmitter.emit (node:events:513:28)
    at EventEmitter.emit (node:domain:489:12) {
  cause: {
    stack: 'Error: Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.\n' +
      '    at /usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:465:71\n' +
      '    at IpcMainImpl.<anonymous> (/usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:323:27)\n' +
      '    at IpcMainImpl.emit (node:events:513:28)\n' +
      '    at IpcMainImpl.emit (node:domain:489:12)\n' +
      '    at EventEmitter.<anonymous> (node:electron/js2c/browser_init:2:82058)\n' +
      '    at EventEmitter.emit (node:events:513:28)\n' +
      '    at EventEmitter.emit (node:domain:489:12)',
    message: 'Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.'
  }
} { pluginIds: [] }
Raven: 429 - undefined

Had this exact issue. Uninstalled Mailspring, deleted the /home/user/.config/Mailspring directory, reinstalled and before starting it up. Edited the desktop shortcut to the following (note the exec line)

cat /usr/share/applications/Mailspring.desktop 
[Desktop Entry]
Name=Mailspring
Comment=The best email app for people and teams at work
GenericName=Mail Client
Exec=mailspring --password-store="gnome-libsecret" %U

Note you also have to disable Mailspring from staring up manually and only launch from the app. Hope that helps.