-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Element shows session errors after being restarted during opening spinner #18625
Comments
Wow, that's pretty terrible. Unfortunately I think debug logs are the only way we're going to be able to find out what's going on here: I'm fairly sure this isn't a common problem. |
This definitely is absolutely terrible! It just happened to me, too, and I am furious about such bad design. I lost all my conversations! My system:
|
Is there any workaround for now? I have decided I will ditch Element for personal use immediately (back to email with PGP – I guess it is the only channel that never failed me) but I need Element for work.
|
Some more details about this problem:
The workaround I found is to have Element also installed on my phone, so when I have to log in again, it syncs keys from there. |
|
It might be relevant that both the OP and yajo are flatpak users, although maybe this is just becoming a common way of installing Element |
Yes, I use flatpaks everywhere I can. I installed from https://flathub.org/apps/details/im.riot.Riot Today it happened again. I got an upgrade, then rebooted. Element was open, so it had to close immediately. After rebooting, I opened Element again, and it became dumb: After a long time like this, I got the logs: vector-1635935322508.log I closed it (Ctrl+Q). Then opened it again. I got this: Clicking on the "send us the logs" link, then clicking on "Download logs", fails with "No connected database...": Instead of clicking on "close session". I quit Element (Ctrl+Q) and open it back again. It still logs some IndexedDB connection errors: Now I just have to log in again 🤷🏼♂️ I hope this info helps diagnose the bug. |
Your issue sounds identical to dexie/Dexie.js#271 (comment) which has a suggestion here We are already doing this but it doesn't work out of the box in flatpak .. So I've submitted a PR to the flatpak config based on what others have done. I don't have a linux environment to test on, so I don't know for sure if this works. If someone in this thread could test it, that would help. |
Hoping to fix element-hq/element-web#18625 This is suggested at flathub/org.electronjs.Electron2.BaseApp#4 (comment)
Until that gets merged .. don't use flatpak, or if you must insist, try really hard not to open two copies of the app at the same time |
But I never opened more than 1 Element on parallel... Actually the problem always happens when I just have rebooted and logged in, so all is closed at that point. |
I don't know what's causing the hanging causing you to restart the app in the first place - there's nothing in the logs - but the indexDB errors and session corruption occurred immediately after
So, here I'm fairly confident the first process wasn't quite dead when you opened the second, causing the issue |
If I were to take a guess at why it's apparently hanging after a version upgrade, I expect replacing the flatpak likely deletes Element's sync cache (due to flatpak sandboxing all app data), and so your next sync is from cold, which unfortunately can take a very long time if you are in many rooms with a lot of history and/or the homeserver isn't the fastest. |
Sorry I meant I got an upgrade for my OS, not for the app; the app didn't update.
Where is that cache supposedly stored? Flatpak sandboxes stuff, but the app still has write permissions on the dirs needed to function.
That can be true, I didn't check the task manager. I'll check next time.
Any way to get that info next time? I guess that should be the main issue to diagnose. |
Okay, then the problem lies elsewhere!
I would look at the developer tools console and check what network requests are being made to see if it's a client or server issue. It would also be useful for debugging purposes to understand if the issue occurs more often with flatpak than without. Your issue does sound like this one, where the OP indicates that the problems only repro under flatpak. |
Today it happened again and it seems like the only requests being made are for piwik: Following your suggestion, this time I:
So, you weren't so far with #18625 (comment)! Thank you, at least now I have a workaround. 😊 |
It's quite good to know that it does actually resurrect if you kill the processes and there's no permanent damage. I'm moving this issue to upstream as it seems flatpak specific, lets continue this in flathub/im.riot.Riot#230 |
@yajo as far as I can tell from your screenshots you seem to run on GNOME. I know that Element minimizes to tray by default which should be the process you see there. Since GNOME doesn't have a system tray, this process ends up to continue to run in background invisibly. |
You may try disabling tray in app prefs to test if it helps. |
It sounds like no one is taking this bug as serious as it is. I would expect Element to implement some failsafe behavior. I mean I lost all my chat history due to this bug. Element should be able to recover chat history! |
@ilka-schulz You shouldn't be able to loose your chat history if you use the "Secure Backup" functionality, since all your session keys are stored encrypted on the homeserver. 👀 At least unless you say that's broken as well. |
Thank you, I will try that! I have Element installed in a VM and I back that up frequently. However, restoring a previous snapshot of the VM did not work. |
@ilka-schulz if the issue recurs, we need to understand if its a similar instance of the problem reported by other posters in this thread with similar root causes -
|
hrm, I would have hoped the single instance lock would still be held if a process is in the tray.. |
Here, when this occurs (on flatpak Element; this bug still happens ~once a month), the spinner window looks a bit different from normal. Normally, there's a "Log out" text on the bottom of the window when the spinner is active, but in the failing case, there's just the spinner in the window but no other UI elements. |
Thanks for this report @pv - we still don't understand what's driving this, so if you could provide debug logs when it occurs, that will help us |
Apologies if this is in the backlog already, but are there multiple clients running at the same time? (ie: close doesn't actually close/end all processes). This can lead to a lock on the storage, which makes the second instance unhappy and think it can recover. See also: element-hq/element-desktop#840 |
Related: element-hq/element-desktop#819 |
is anyone still seeing this? |
Yes, pretty frequently. One sure way for me to get it is to not launch Element for a while, while being in a few busy group chat places (I am assuming it probably helps if some of them use E2EE), and then launch Element. It will sometimes get stuck, sometimes without even any loading indicator, for minutes. Now if during that phase in GNOME 3 you do "top/GNOME3 bar app bar menu" > "Quit Element" (since it is stuck, I don't actually know if it would get unstuck reliably during these phases since usually after some minutes I give up) then launch it again, there is a good chance it will complain afterward about corrupted data. |
@ell1e that would be a classic case of element-hq/element-desktop#819 fwiw |
I think the GNOME Shell "Quit ..." entry does something different than close window. Not sure what it is, but I think it usually won't leave stuff running? (Maybe it figures out the parent of the window and sends SIGTERM?) So I'm not entirely sure it's multiple parallel processes, might just be Element breaking when it's shut down during the wrong moment of starting up. Could also be that it's parallel processes though, I don't think I ever checked when that happened |
Quit probably kills that instance but there is still a second one lingering somewhere else. |
CLosing as there hasn't been a lot of activity here to suggest it's a recurring problem. If this is untrue, please open a new issue with fresh reproduction steps for our QA team to take a look at. |
I don't know I still see this a lot. Reproduction steps is "use element flatpak a lot" 👀 I don't think anyone knows how to trigger it willingly Edit: oops, I forgot this issue was about the corruption initially. I haven't actually seen that in a while but mainly because I do |
If this is the flatpak, then please report it upstream to them: https://github.com/flathub/im.riot.Riot/ |
No idea honestly if it happens without the flatpak, since I never run it without one |
Steps to reproduce
What happened?
spinner gets stuck a lot. zero useful indications on progress. restarting element due to this suddenly wiped my session data, telling me it is now "missing" and I'm prompted with a blank login.
What did you expect?
spinner has proper progress indicator and session data isn't ruined if i quit early
Operating system
Linux
Application version
1.7.33
How did you install the app?
flatpak x64
Have you submitted a rageshake?
No
The text was updated successfully, but these errors were encountered: