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

Impossible to continue after "Element is open in another window"

Open Xzensi opened this issue 2 years ago • 12 comments

STR

  1. Have element-desktop (or web, I guess) running
  2. Unclean shutdown (eg reboot)
  3. Wind clock back by 5 minutes or so
  4. Start Element again
  5. Observe "Element is open in another window" dialog: image
  6. Click continue
  7. Observe spinner: image
  8. Wait for clock to pass the time of the unclean shutdown
  9. Element loads at last

Original description follows

Steps to reproduce

Element worked fine. Rebooted Windows 10, suddenly get "Element is open in another window" warning even though I do not have any other client open. Pressing "Continue" does nothing and loads forever.

I tried:

  • Reinstalling Element desktop
  • At /synapse-admin I removed myself under "DEVICES"

Web and mobile clients still work fine.

Outcome

What did you expect?

Being able to just use Element like normal.

What happened instead?

image

Operating system

Windows 10

Application version

Latest, reinstalled fresh

How did you install the app?

https://element.io/download

Homeserver

No response

Will you send logs?

No

Xzensi avatar Feb 08 '24 13:02 Xzensi

Update: After waiting 18 hours and a couple reboots later, whatever file lock or stuck flag caused it to stay stuck in "Element is open in another window", even though the session wasn't even authenticated or logged in anymore, expired or got cleared and I can log into homeurl again.

Xzensi avatar Feb 09 '24 08:02 Xzensi

I'm having the same problem. Happened after rebooting Windows. There was an Element update a few days ago, and I had not rebooted since. Likely a bug in the latest version.

gmpreussner avatar Apr 15 '24 23:04 gmpreussner

this is so aids it happens almost every time i restart my computer and every time i have to delete .config/Element and every time i have to import my keys again

ewof avatar Aug 11 '24 11:08 ewof

Could someone export logs from the developer console when this happens (ctrl-shift-i, "Console", right click -> "Save As") and share them?

richvdh avatar Sep 05 '24 10:09 richvdh

@ewof: your choice of phrasing is somewhat offensive. I appreciate the issue may be frustrating, but please remain civil in your interactions.

richvdh avatar Sep 05 '24 12:09 richvdh

Hello there!

rageshake.ts:69 Initialised rageshake.
rageshake.ts:69 To fix line numbers in Chrome: Meatball menu → Settings → Ignore list → Add /rageshake\.ts & /logger\.ts$
rageshake.ts:69 Using Electron platform
Markdown.ts:387 Uncaught (in promise) ReferenceError: Cannot access 'q' before initialization
    at Object.J (Markdown.ts:387:5)
    at _.start (ReadyWatchingStore.ts:30:30)
    at get instance (WidgetLayoutStore.ts:63:35)
    at ./node_modules/matrix-react-sdk/src/stores/widgets/WidgetLayoutStore.ts (WidgetLayoutStore.ts:518:48)
    at u (bootstrap:19:32)
    at ./node_modules/matrix-react-sdk/src/utils/WidgetUtils.ts (Whenable.ts:78:5)
    at u (bootstrap:19:32)
    at ./node_modules/matrix-react-sdk/src/stores/ActiveWidgetStore.ts (shouldHideEvent.ts:75:1)
    at u (bootstrap:19:32)
    at ./node_modules/matrix-react-sdk/src/stores/WidgetStore.ts (WidgetEchoStore.ts:110:1)
Markdown.ts:387 Uncaught (in promise) ReferenceError: Cannot access 'q' before initialization
    at Object.J (Markdown.ts:387:5)
    at l.start (ReadyWatchingStore.ts:30:30)
    at d.start (AsyncStoreWithClient.ts:40:31)
    at WidgetMessagingStore.ts:30:18
    at ./node_modules/matrix-react-sdk/src/stores/widgets/WidgetMessagingStore.ts (WidgetMessagingStore.ts:28:48)
    at u (bootstrap:19:32)
    at ./node_modules/matrix-react-sdk/src/stores/ActiveWidgetStore.ts (shouldHideEvent.ts:75:1)
    at u (bootstrap:19:32)
    at ./node_modules/matrix-react-sdk/src/stores/WidgetStore.ts (WidgetEchoStore.ts:110:1)
    at u (bootstrap:19:32)
Markdown.ts:387 Uncaught (in promise) ReferenceError: Cannot access 'q' before initialization
    at Object.J (Markdown.ts:387:5)
    at l.start (ReadyWatchingStore.ts:30:30)
    at p.start (AsyncStoreWithClient.ts:40:31)
    at WidgetStore.ts:48:18
    at ./node_modules/matrix-react-sdk/src/stores/WidgetStore.ts (WidgetStore.ts:46:48)
    at u (bootstrap:19:32)
    at ./node_modules/matrix-react-sdk/src/modules/ModuleRunner.ts (ModuleUiDialog.tsx:78:5)
    at u (bootstrap:19:32)
    at ./node_modules/matrix-react-sdk/src/SecurityManager.ts (AccessSecretStorageDialog.tsx:447:5)
    at u (bootstrap:19:32)
rageshake.ts:69 Configuring rageshake persistence...
rageshake.ts:69 returning explicit theme: dark
rageshake.ts:69 returning explicit theme: dark
rageshake.ts:69 set language to ru
rageshake.ts:69 Application is running in production mode
rageshake.ts:69 Vector starting at vector://vector/webapp/
rageshake.ts:69 Verifying homeserver configuration
rageshake.ts:69 Config uses a default_server_name - doing .well-known lookup
rageshake.ts:69 DEPRECATED CONFIG OPTION: In the future, default_server_name will not be accepted. Please use default_server_config instead.
Object.keys.forEach.e.<computed> @ rageshake.ts:69
Show 1 more frame
Show less
rageshake.ts:69 Invalid /v2 response
Object.keys.forEach.e.<computed> @ rageshake.ts:69
Show 1 more frame
Show less
rageshake.ts:69 Error determining preferred identity server URL: Object
Object.keys.forEach.e.<computed> @ rageshake.ts:69
Show 1 more frame
Show less
rageshake.ts:69 FetchHttpApi: --> GET https://matrix-client.matrix.org/_matrix/client/unstable/org.matrix.msc2965/auth_issuer
matrix-client.matrix.org/_matrix/client/unstable/org.matrix.msc2965/auth_issuer:1 
        
        
       Failed to load resource: the server responded with a status of 404 ()
rageshake.ts:69 FetchHttpApi: <-- GET https://matrix-client.matrix.org/_matrix/client/unstable/org.matrix.msc2965/auth_issuer [322ms 404]
rageshake.ts:69 Using homeserver config: ObjectdelegatedAuthentication: undefinedhsName: "matrix.org"hsNameIsDifferent: truehsUrl: "https://matrix-client.matrix.org"isDefault: trueisNameResolvable: trueisUrl: "https://vector.im"warning: "Identity server URL does not appear to be a valid identity server"[[Prototype]]: Objectconstructor: ƒ Object()hasOwnProperty: ƒ hasOwnProperty()isPrototypeOf: ƒ isPrototypeOf()propertyIsEnumerable: ƒ propertyIsEnumerable()toLocaleString: ƒ toLocaleString()toString: ƒ toString()valueOf: ƒ valueOf()__defineGetter__: ƒ __defineGetter__()__defineSetter__: ƒ __defineSetter__()__lookupGetter__: ƒ __lookupGetter__()__lookupSetter__: ƒ __lookupSetter__()__proto__: (...)get __proto__: ƒ __proto__()set __proto__: ƒ __proto__()
rageshake.ts:69 Updating SdkConfig with validated discovery information
rageshake.ts:69 returning explicit theme: dark

1a11 avatar Oct 08 '24 17:10 1a11

@ewof: your choice of phrasing is somewhat offensive. I appreciate the issue may be frustrating, but please remain civil in your interactions.

yea my bad i was annoyed since then though ive realized this seams to be related to system time? whenever i run into this i use ntpdate and it seams to fix it

ewof avatar Oct 08 '24 18:10 ewof

@1a11 thanks. Can you click "Continue" and share the console log after doing so?

richvdh avatar Oct 08 '24 20:10 richvdh

@ewof:

since then though ive realized this seams to be related to system time? whenever i run into this i use ntpdate and it seams to fix it

well, yes: if your instance of element desktop is not stopped cleanly (eg, you turn your system off), and then time on your system goes backwards to a time when the old instance was still running, the new instance will see a lock claim apparently from the future, from the new instance. I thoroughly recommend having a reasonably accurate clock on your computer.

richvdh avatar Oct 08 '24 20:10 richvdh

oh, I think I see the bug. Do you just see a spinner after clicking "Continue"?

richvdh avatar Oct 08 '24 20:10 richvdh

Yep. I'm pretty sure it's a time issue as it resolved after fixing the time server. FYI the log is after clicking the "Continue" button

1a11 avatar Oct 08 '24 20:10 1a11

Ok thanks all. I'll have a think about how to fix this.

richvdh avatar Oct 08 '24 21:10 richvdh

I get the same error in the console as @1a11 :

init.js:1 Uncaught (in promise) ReferenceError: Cannot access 'V' before initialization
    at Object.J (init.js:1:77347)
    at b.start (ReadyWatchingStore.ts:30:30)
    at get instance (WidgetLayoutStore.ts:63:35)
    at ./src/stores/widgets/WidgetLayoutStore.ts (WidgetLayoutStore.ts:518:48)
    at l (bootstrap:19:32)
    at ./src/utils/WidgetUtils.ts (init.js:1:1399311)
    at l (bootstrap:19:32)
    at ./src/stores/ActiveWidgetStore.ts (init.js:1:1186380)
    at l (bootstrap:19:32)
    at ./src/stores/WidgetStore.ts (init.js:1:1213116)
J @ init.js:1
start @ ReadyWatchingStore.ts:30
get instance @ WidgetLayoutStore.ts:63
./src/stores/widgets/WidgetLayoutStore.ts @ WidgetLayoutStore.ts:518
l @ bootstrap:19
./src/utils/WidgetUtils.ts @ init.js:1
l @ bootstrap:19
./src/stores/ActiveWidgetStore.ts @ init.js:1
l @ bootstrap:19
./src/stores/WidgetStore.ts @ init.js:1
l @ bootstrap:19
./src/modules/ModuleRunner.ts @ init.js:1
l @ bootstrap:19
./src/SecurityManager.ts @ init.js:1
l @ bootstrap:19
./src/MatrixClientPeg.ts @ init.js:1
l @ bootstrap:19
./src/settings/controllers/DeviceIsolationModeController.ts @ init.js:1
l @ bootstrap:19
./src/settings/Settings.tsx @ init.js:1
l @ bootstrap:19
./src/settings/SettingsStore.ts @ init.js:1
l @ bootstrap:19
./src/languageHandler.tsx @ init.js:1
l @ bootstrap:19
./src/vector/init.tsx @ init.js:1
l @ bootstrap:19
Promise.then
(anonymous) @ index.ts:119
./src/vector/index.ts @ index.ts:259
l @ bootstrap:19
(anonymous) @ startup:4
l.O @ chunk loaded:23
(anonymous) @ startup:5
(anonymous) @ startup:5
init.js:1 Uncaught (in promise) ReferenceError: Cannot access 'V' before initialization
    at Object.J (init.js:1:77347)
    at l.start (ReadyWatchingStore.ts:30:30)
    at d.start (AsyncStoreWithClient.ts:40:31)
    at WidgetMessagingStore.ts:30:18
    at ./src/stores/widgets/WidgetMessagingStore.ts (WidgetMessagingStore.ts:28:48)
    at l (bootstrap:19:32)
    at ./src/stores/ActiveWidgetStore.ts (init.js:1:1186414)
    at l (bootstrap:19:32)
    at ./src/stores/WidgetStore.ts (init.js:1:1213116)
    at l (bootstrap:19:32)
J @ init.js:1
start @ ReadyWatchingStore.ts:30
start @ AsyncStoreWithClient.ts:40
(anonymous) @ WidgetMessagingStore.ts:30
./src/stores/widgets/WidgetMessagingStore.ts @ WidgetMessagingStore.ts:28
l @ bootstrap:19
./src/stores/ActiveWidgetStore.ts @ init.js:1
l @ bootstrap:19
./src/stores/WidgetStore.ts @ init.js:1
l @ bootstrap:19
./src/modules/ModuleRunner.ts @ init.js:1
l @ bootstrap:19
./src/SecurityManager.ts @ init.js:1
l @ bootstrap:19
./src/MatrixClientPeg.ts @ init.js:1
l @ bootstrap:19
./src/settings/controllers/DeviceIsolationModeController.ts @ init.js:1
l @ bootstrap:19
./src/settings/Settings.tsx @ init.js:1
l @ bootstrap:19
./src/settings/SettingsStore.ts @ init.js:1
l @ bootstrap:19
./src/languageHandler.tsx @ init.js:1
l @ bootstrap:19
./src/vector/init.tsx @ init.js:1
l @ bootstrap:19
await in l
(anonymous) @ WidgetMessagingStore.ts:30
./src/stores/widgets/WidgetMessagingStore.ts @ WidgetMessagingStore.ts:28
l @ bootstrap:19
./src/stores/ActiveWidgetStore.ts @ init.js:1
l @ bootstrap:19
./src/stores/WidgetStore.ts @ init.js:1
l @ bootstrap:19
./src/modules/ModuleRunner.ts @ init.js:1
l @ bootstrap:19
./src/SecurityManager.ts @ init.js:1
l @ bootstrap:19
./src/MatrixClientPeg.ts @ init.js:1
l @ bootstrap:19
./src/settings/controllers/DeviceIsolationModeController.ts @ init.js:1
l @ bootstrap:19
./src/settings/Settings.tsx @ init.js:1
l @ bootstrap:19
./src/settings/SettingsStore.ts @ init.js:1
l @ bootstrap:19
./src/languageHandler.tsx @ init.js:1
l @ bootstrap:19
./src/vector/init.tsx @ init.js:1
l @ bootstrap:19
Promise.then
(anonymous) @ index.ts:119
./src/vector/index.ts @ index.ts:259
l @ bootstrap:19
(anonymous) @ startup:4
l.O @ chunk loaded:23
(anonymous) @ startup:5
(anonymous) @ startup:5
init.js:1 Uncaught (in promise) ReferenceError: Cannot access 'V' before initialization
    at Object.J (init.js:1:77347)
    at l.start (ReadyWatchingStore.ts:30:30)
    at p.start (AsyncStoreWithClient.ts:40:31)
    at WidgetStore.ts:48:18
    at ./src/stores/WidgetStore.ts (WidgetStore.ts:46:48)
    at l (bootstrap:19:32)
    at ./src/modules/ModuleRunner.ts (init.js:1:1099717)
    at l (bootstrap:19:32)
    at ./src/SecurityManager.ts (init.js:1:135166)
    at l (bootstrap:19:32)

Do you know what could be causing it?

kosmos avatar Nov 02 '24 11:11 kosmos

Had the same Problem. I had to make a testcase where i had to set the computer clock manually a few days into the future. After setting the clock back today, my element wouldn't start anymore. I Had to Uninstall and delete all caches for it to run again.

Mr-Pearce avatar Dec 13 '24 12:12 Mr-Pearce

I haven't forgotten about this, I just haven't found time to come back and fix it.

The problem is that the "last ping time" from the other session is set in the future, so the new session thinks it's still alive despite us telling it we want to steal the lock. I think the solution is that, if we find the "last ping time" is in the future, to check if it is still changing once we've sent the memo, and if not, assume that (a) it is dead, (b) someone wound back the clock.

richvdh avatar Dec 13 '24 12:12 richvdh

I get the same error in the console as @1a11 :

unrelated: it's https://github.com/element-hq/element-web/issues/27606

richvdh avatar Dec 13 '24 12:12 richvdh

also having this issue, my power went out and now i can't log back in

lands39 avatar Apr 07 '25 11:04 lands39