element-hq / element-desktop

A glossy Matrix collaboration client for desktop.
https://element.io
GNU Affero General Public License v3.0
1.13k stars 258 forks source link

Unable to restore session upon startup #1632

Closed KrisVos130 closed 4 months ago

KrisVos130 commented 4 months ago

Steps to reproduce

  1. Start PC
  2. Start Element Desktop

Can't reproduce the issue reliable, but it has happened two times in a few weeks.

Outcome

What did you expect?

Element to open as usual.

What happened instead?

A screen popped up saying it could not restore session, with an option to send logs or logout.

image

Console shows "Expected a pickle key, but none provided. Encryption may not work." and "Unable to load session Error: invalid type: integer 123, expected a string at line 1 column 4"

Operating system

Arch Linux

Application version

Element version: 1.11.63, Crypto version: Olm 3.2.15

How did you install the app?

https://archlinux.org/packages/extra/x86_64/element-desktop/ - yay -S element-desktop

Homeserver

Synapse 1.103.0

Will you send logs?

Yes

KrisVos130 commented 4 months ago

Additionally, it gives you the option to log out, which tells you it will remove encryption keys if you do. If you click cancel, or close Element, it still logs you out, and probably also removes encryption keys. I would expect to see the same "Unable to restore session" dialog after doing one of those two things.

KrisVos130 commented 4 months ago

Just happened again. I remember Element was running in the background (tray) when I shut down my PC last night. Usually, I close it manually, and then shut down my PC.

After sending logs, I am first shown the "Send logs or log out" view, and then redirected to the login/register page again without clicking on anything. Clicking Login then shows the spinning logo, with a Logout button, and nothing ever happens. When I quit and start Element again, I am shown the Login/Register page again, but this time clicking Login shows the login form, and I can actually log in again.

New versions: Synapse homeserver: 1.105.1 Package manager version of element-desktop: Arch 1.11.65-1 Element version from Help & About: Element version: 1.11.65; Crypto version: Rust SDK 0.7.0 (61b175b), Vodozemac 0.5.1

t3chguy commented 4 months ago

The Arch package isn't supported by us and often includes an unexpected Electron version. Please seek support from its maintainer.

KrisVos130 commented 4 months ago

If this is the case, I would recommend updating the message that tells people to report it here on GitHub. Telling people to send logs, linked to a GitHub issue, and then closing said issue is not useful for any involved party.

Someone else also reported this upstream (https://gitlab.archlinux.org/archlinux/packaging/packages/element.io/-/issues/7), whose maintainer said this is not a packaging issue, but I guess I'll try elsewhere then.

t3chguy commented 4 months ago

this is not a packaging issue

If you can repro with the official tarballs then we can confirm and reopen, otherwise using a different version of Electron means we cannot ascertain that.

I would recommend updating the message that tells people to report it here on GitHub.

You'd have to suggest that to the community packager, the github link is configurable

KrisVos130 commented 3 months ago

It took over a month, but I was able to reproduce this issue with the official tarballs.

Same issue: I open Element, I am greeted with the original screenshot. Console shows the same error message. And the logout screen still has the same issue, as described in the second comment.

This time, it happened hours after starting my PC, and I had started Element successfully earlier. I then quit Element via the tray's Quit option, and a few hours later started it again, like normal. So my earlier comment of Element not being shut down cleanly when shutting down my PC can be disregarded.

Version v1.11.67, still on Arch.
Homeserver is Synapse v1.105.1

Could this issue be reopened @t3chguy?

t3chguy commented 3 months ago

@KrisVos130 based on your logs you hit https://github.com/element-hq/element-desktop/issues/1816