element-hq / element-hq/element-web

Element fails to launch with "Unable to restore session" Error decrypting secret access_token (no pickle key found)

Open
#32,521 20 comments 5 reactions 0 assignees View on GitHub
A-Electron A-Session-Mgmt O-Uncommon S-Critical T-Defect Z-Linux Z-Platform-Specific
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

Was advised to report this as a new issue.
Originally posted by @CaptOrb in [#31998](https://github.com/element-hq/element-web/issues/31998#issuecomment-3904383330)_

1. Where are you starting? What can you see?
Each time I launch Element, an "Unable to restore session" pops up on the screen.

Image

3. What do you click?
Launched Element Desktop

5. More steps…
Unable to post logs through the application as I get a "failed to upload logs" message. GitHub won't let me upload the rageshake.tar that the logs generate, please see the following Zip file.

[rageshake.zip](https://github.com/user-attachments/files/25342738/rageshake.zip)

Looking at the logs. The root cause seems to be:

```
Unable to load session Error decrypting secret access_token: no pickle key found. Error: Error decrypting secret access_token: no pickle key found.
```

If I try and open Element through the command line, I get
```
conor@conor:~$ element-desktop
/home/conor/.config/Element exists: yes
/home/conor/.config/Riot exists: no
(node:4306) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `element-desktop --trace-deprecation ...` to show where the warning was created)
Loading app config: /opt/Element/resources/webapp.asar/config.json
Loading local config: /home/conor/.config/Element/config.json
Skipping nonexistent file: /home/conor/.config/Element/config.json
Reached Electron ready state
Auto update not supported on this platform
Fetching translation json for locale: en_EN
Changing application language to en
Fetching translation json for locale: en
Resetting the UI components after locale change
Resetting the UI components after locale change
Opening main window
Ensuring storage is ready
Using storage mode 'encrypted' with backend 'gnome_libsecret'
(node:4306) [DEP0044] DeprecationWarning: The `util.isArray` API is deprecated. Please use `Array.isArray()` instead.
[4306:0216/142315.134840:ERROR:dbus/object_proxy.cc:573] Failed to call method: org.freedesktop.systemd1.Manager.StartTransientUnit: object_path= /org/freedesktop/systemd1: org.freedesktop.systemd1.UnitExists: Unit app-org.chromium.Chromium-4306.scope was already loaded or has a fragment file.
Reading setting value for: Electron.warnBeforeExit = true
Reading setting value for: Electron.alwaysShowMenuBar = false
Reading setting value for: Electron.showTrayIcon = true
Reading setting value for: Electron.enableHardwareAcceleration = true
Changing application language to en
Fetching translation json for locale: en
Resetting the UI components after locale change
Reading setting value for: Electron.autoLaunch = disabled
Failed to decrypt secret Error: Error while decrypting the ciphertext provided to safeStorage.decryptString.
at SafeStorageWriter.get (file:///opt/Element/resources/app.asar/lib/store.js:77:36)
at Store.getSecret (file:///opt/Element/resources/app.asar/lib/store.js:383:29)
at async IpcMainImpl. (file:///opt/Element/resources/app.asar/lib/ipc.js:103:23)
...ciphertext: "djExjl8mWgMSoLcjX+SAr1kAkjZA2kr+C++RzzGD0oiICOwJHorB04zO9p4iU21GtW4+"
```

### Outcome

#### What did you expect?
Element to launch without errors.

#### What happened instead?
Upon each of launch of Element, a popup dialog "Unable to restore session" appears.

### Operating system

Linux Mint

### Application version

1.12.10

### How did you install the app?

Official APT repo (packages.element.io)

### Homeserver

_No response_

### Will you send logs?

Yes

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure by launching Element Desktop with the encrypted storage backend and review the reported paths in lib/store.js and lib/ipc.js. Investigate the safeStorage/gnome_libsecret error for the access_token, then verify that Element launches without the “Unable to restore session” dialog and restores the session successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, linux, typescript
Domain
desktop, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.