element-web icon indicating copy to clipboard operation
element-web copied to clipboard

Element desktop starts new instance instead of opening old instance

Open schuelermine opened this issue 3 years ago • 9 comments

Steps to reproduce

  1. Launch Element desktop
  2. Close the App (make sure it’s running in the background)
  3. Launch Element again

Outcome

What did you expect?

The old Element desktop instance reopens.

What happened instead?

A new Element instance opens and prompts to log in. This seems like it could corrupt state.

Operating system

NixOS 22.05.20220511.41ff747 (Quokka)

Application version

Element version: 1.10.11, Olm version: 3.2.8

How did you install the app?

using home-manager, from nixpkgs

Homeserver

matrix.org

Will you send logs?

Yes

schuelermine avatar May 14 '22 11:05 schuelermine

This sounds like a packaging issue with the community-maintained nixpkg, I suggest contacting the maintainer. Flatpak had a similar issue due to sandboxing.

t3chguy avatar May 14 '22 11:05 t3chguy

It doesn’t happen immediately after startup, as I’ve found out now. It sometimes happens a while later. Maybe it happens on suspend? I feel like this isn’t a packaging issue, as console element-desktop invocations detect the instance normally but also don’t for me sometimes.

schuelermine avatar May 14 '22 13:05 schuelermine

Well its either a packaging issue or an electron one as this is a built-in feature of electron, https://www.electronjs.org/docs/latest/api/app#apprequestsingleinstancelockadditionaldata

t3chguy avatar May 14 '22 13:05 t3chguy

I will test if this is triggered by suspend. Thank you for the information!

schuelermine avatar May 14 '22 13:05 schuelermine

I am now somewhat sure this is caused by suspend.

schuelermine avatar May 14 '22 17:05 schuelermine

The second instance is being detected by any third instance. Screenshot from 2022-05-14 19-27-59

Closing the first instance and re-launching via CLI launches a second instance. Screenshot from 2022-05-14 19-28-28

schuelermine avatar May 14 '22 17:05 schuelermine

I have the same Problem with the standard repo https://packages.element.io/debian/ When the instance is already running, it tries to start a new one. When you open element out of a matrix.to link it tries to open a new one.

It seems to have to do with the autostart. When you close the autostarted element and start it normal the problem vanished. Then you get this in a terminal: /opt/Element/element-desktop %U

/home/jokergermany/.config/Element exists: yes
/home/jokergermany/.config/Riot exists: no
Other instance detected: exiting

Will post tomorrow the terminal output when the bug appers.

JokerGermany avatar Aug 05 '22 21:08 JokerGermany

/opt/Element/element-desktop --hidden

/home/jokergermany/.config/Element exists: yes
/home/jokergermany/.config/Riot exists: no
Starting auto update with base URL: https://packages.element.io/desktop/update/
Auto update not supported on this platform
Fetching translation json for locale: en_EN
Changing application language to de
Fetching translation json for locale: de
Resetting the UI components after locale change
Resetting the UI components after locale change
mesa: for the --amdgpu-atomic-optimizations option: may only occur zero or one times!
[324551:0807/192947.281627:ERROR:browser_main_loop.cc(271)] Gdk: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
Changing application language to de
Fetching translation json for locale: de
Resetting the UI components after locale change
[324551:0807/192952.408606:ERROR:leveldb_factory.cc(88)] Failed to open LevelDB database from /home/jokergermany/.config/Element/IndexedDB/vector_vector_0.indexeddb.leveldb,IO error: /home/jokergermany/.config/Element/IndexedDB/vector_vector_0.indexeddb.leveldb/LOCK: File currently in use. (ChromeMethodBFE: 15::LockFile::2)
[324551:0807/192953.418660:ERROR:leveldb_factory.cc(88)] Failed to open LevelDB database from /home/jokergermany/.config/Element/IndexedDB/vector_vector_0.indexeddb.leveldb,IO error: /home/jokergermany/.config/Element/IndexedDB/vector_vector_0.indexeddb.leveldb/LOCK: File currently in use. (ChromeMethodBFE: 15::LockFile::2)
[324551:0807/192953.748112:ERROR:nss_util.cc(335)] After loading Root Certs, loaded==false: NSS error code: -8018
[324551:0807/192954.885684:ERROR:leveldb_factory.cc(88)] Failed to open LevelDB database from /home/jokergermany/.config/Element/IndexedDB/vector_vector_0.indexeddb.leveldb,IO error: /home/jokergermany/.config/Element/IndexedDB/vector_vector_0.indexeddb.leveldb/LOCK: File currently in use. (ChromeMethodBFE: 15::LockFile::2)
[324551:0807/192955.895411:ERROR:leveldb_factory.cc(88)] Failed to open LevelDB database from /home/jokergermany/.config/Element/IndexedDB/vector_vector_0.indexeddb.leveldb,IO error: /home/jokergermany/.config/Element/IndexedDB/vector_vector_0.indexeddb.leveldb/LOCK: File currently in use. (ChromeMethodBFE: 15::LockFile::2)

The last line repeats over and over again

JokerGermany avatar Aug 07 '22 17:08 JokerGermany

@t3chguy Pls remove the X-Community-Supported-Platform

JokerGermany avatar Aug 07 '22 18:08 JokerGermany

This is the same issue I've been seeing for over a year now in vector-im/element-desktop#679

Can we get some eyes on this already??? :/

BloodyIron avatar Mar 22 '23 17:03 BloodyIron

Duplicate of vector-im/element-desktop#679

t3chguy avatar Mar 22 '23 17:03 t3chguy