'Continue' button on login screen fails silently if no browser is installed
Steps to reproduce
- Where are you starting? What can you see? I have element-desktop logged in for a long time, more than 1 year. I recently logged out. I am trying to log back in but I don't understand why it is failing.
- What do you click? Log out and log back in.
Outcome
What did you expect?
The login screen to enter username and password to appear.
What happened instead?
Can't click past "Continue" on the "Sign in" section of the homeserver. Every other button on this screen works, but not "Continue". Same thing if I try the "Create account", the "Continue button doesn't work.
$ apt list --installed element-desktop
Listing... Done
element-desktop/unknown,now 1.11.110 amd64 [installed]
user@element:~/.config$ element-desktop --throw-deprecation --trace-deprecation --trace-warnings --enable-logging --log-level=4 --disable-gpu
/home/user/.config/Element exists: yes
/home/user/.config/Riot exists: no
[8413:0907/105126.676104:WARNING:electron/shell/common/asar/archive.cc:196] Opening /opt/Element/resources/app.asar/webapp.asar: FILE_ERROR_NOT_A_DIRECTORY
Unhandled exception DeprecationWarning: fs.Stats constructor is deprecated.
at asarStatsToFsStats (node:electron/js2c/node_init:2:1796)
at t.lstat (node:electron/js2c/node_init:2:5284)
at node:electron/js2c/node_init:2:5609
at process.processTicksAndRejections (node:internal/process/task_queues:85:11) {
code: 'DEP0180'
}
Loading app config: /opt/Element/resources/webapp.asar/config.json
Loading local config: /home/user/.config/Element/config.json
Skipping nonexistent file: /home/user/.config/Element/config.json
Reached Electron ready state
[8452:0907/105127.287191:WARNING:ui/gfx/linux/gpu_memory_buffer_support_x11.cc:49] dri3 extension not supported.
[8452:0907/105127.299907:WARNING:sandbox/policy/linux/sandbox_linux.cc:415] InitializeSandbox() called with multiple threads in process gpu-process.
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 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'
Unhandled exception DeprecationWarning: The `util.isArray` API is deprecated. Please use `Array.isArray()` instead.
at Counterpart.translate (/opt/Element/resources/app.asar/node_modules/counterpart/index.js:189:8)
at _t (file:///opt/Element/resources/app.asar/lib/language-helper.js:32:34)
at buildMenuTemplate (file:///opt/Element/resources/app.asar/lib/vectormenu.js:15:20)
at global.appLocalization.AppLocalization.components (file:///opt/Element/resources/app.asar/lib/electron-main.js:400:86)
at file:///opt/Element/resources/app.asar/lib/language-helper.js:100:17
at Set.forEach (<anonymous>)
at AppLocalization.resetLocalizedUI (file:///opt/Element/resources/app.asar/lib/language-helper.js:98:35)
at AppLocalization.setAppLocale (file:///opt/Element/resources/app.asar/lib/language-helper.js:94:14)
at new AppLocalization (file:///opt/Element/resources/app.asar/lib/language-helper.js:55:18)
at App.<anonymous> (file:///opt/Element/resources/app.asar/lib/electron-main.js:399:30) {
code: 'DEP0044'
}
[8413:0907/105129.260817:INFO:CONSOLE:1] "Initialised rageshake.", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105129.266165:INFO:CONSOLE:1] "To fix line numbers in Chrome: Meatball menu → Settings → Ignore list → Add /rageshake\.ts & /logger\.ts$", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105129.266479:INFO:CONSOLE:1] "Using Electron platform", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105129.269210:INFO:CONSOLE:1] "Uncaught (in promise) ReferenceError: Cannot access 'B' before initialization", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105129.269347:INFO:CONSOLE:1] "Uncaught (in promise) ReferenceError: Cannot access 'B' before initialization", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105129.271007:INFO:CONSOLE:1] "Uncaught (in promise) ReferenceError: Cannot access 'B' before initialization", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105129.277322:INFO:CONSOLE:1] "Configuring rageshake persistence...", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
Changing application language to en
Fetching translation json for locale: en
Resetting the UI components after locale change
[8413:0907/105129.488061:INFO:CONSOLE:1] "set language to en", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105130.750592:INFO:CONSOLE:1] "Application is running in production mode", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105130.754383:INFO:CONSOLE:1] "Vector starting at vector://vector/webapp/", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105130.762566:INFO:CONSOLE:1] "Verifying homeserver configuration", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105130.762766:INFO:CONSOLE:1] "Config uses a default_server_name - doing .well-known lookup", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105130.762917:INFO:CONSOLE:1] "DEPRECATED CONFIG OPTION: In the future, default_server_name will not be accepted. Please use default_server_config instead.", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105132.016356:INFO:CONSOLE:1] "FetchHttpApi: --> GET https://matrix-client.matrix.org/_matrix/client/unstable/org.matrix.msc2965/auth_metadata", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105132.174015:INFO:CONSOLE:1] "FetchHttpApi: <-- GET https://matrix-client.matrix.org/_matrix/client/unstable/org.matrix.msc2965/auth_metadata [151ms 200]", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105132.279255:INFO:CONSOLE:1] "Using homeserver config: [object Object]", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105132.280007:INFO:CONSOLE:1] "Updating SdkConfig with validated discovery information", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105132.322601:INFO:CONSOLE:1] "checkSessionLockFree Last ping (from 4a094eb8-d76c-4ec7-b621-9c04c3d7cca2) was 74149ms ago: lock is free", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105132.324416:INFO:CONSOLE:1] "getSessionLock[c71f0ebb-3f0d-4d6f-83be-f818b98ca7fe] Last ping (from 4a094eb8-d76c-4ec7-b621-9c04c3d7cca2) was 74151ms ago: proceeding with startup", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105132.430038:INFO:CONSOLE:1] "No previous session found.", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105132.431255:INFO:CONSOLE:1] "Doing guest login on https://matrix-client.matrix.org", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105132.435976:INFO:CONSOLE:1] "FetchHttpApi: --> POST https://matrix-client.matrix.org/_matrix/client/v3/register?kind=xxx", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105133.356653:INFO:CONSOLE:1] "FetchHttpApi: <-- POST https://matrix-client.matrix.org/_matrix/client/v3/register?kind=xxx [919ms 403]", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105133.378826:INFO:CONSOLE:1] "Failed to register as guest M_FORBIDDEN: MatrixError: [403] Registration has been disabled. Only m.login.application_service registrations are allowed. (https://matrix-client.matrix.org/_matrix/client/v3/register?kind=guest)", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105133.383898:INFO:CONSOLE:1] "newscreen welcome", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105146.204922:INFO:CONSOLE:1] "Routing URL vector://vector/webapp/#/login", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105146.209088:INFO:CONSOLE:1] "newscreen login", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105146.624441:INFO:CONSOLE:1] "FetchHttpApi: --> GET https://matrix-client.matrix.org/_matrix/client/unstable/org.matrix.msc2965/auth_metadata", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105146.704254:INFO:CONSOLE:1] "FetchHttpApi: <-- GET https://matrix-client.matrix.org/_matrix/client/unstable/org.matrix.msc2965/auth_metadata [80ms 200]", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105151.370452:INFO:CONSOLE:1] "element-web closing", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105153.989589:INFO:CONSOLE:1] "element-web closing", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105154.563529:INFO:CONSOLE:1] "element-web closing", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
element-web is the name of another package, which I don't have installed and it's description does not match
Operating system
Debian 12
Application version
Element version 1.11.110
How did you install the app?
https://element.io/download#linux
Homeserver
matrix.org
Will you send logs?
Yes
This is working for me on 1.11.110 with matrix.org: the continue button opens the sign in page for matrix.org in my default browser.
Thanks for the response.
This is working for me on 1.11.110 with matrix.org: the continue button opens the sign in page for matrix.org in my default browser.
I didn't have a browser in this system, maybe I had in the past (more than an year ago) when logging in the first time, or this was a new requirement. Can an informative error message be added in case the xdg-open fails? I presume it is here:
https://github.com/element-hq/element-desktop/blob/f1039d3fc2ce0a391fd2d57f4e9600837f386310/src/webcontents-handler.ts#L46
@ben-grande when running the app from the command line do you see any errors when it tries to open a browser? If not then its likely openExternal doesn't pass the xdg-open failure to us - I'm not seeing any error in the logs you included in the OP, which would show an uncaught rejection if there was an error to be caught.
or this was a new requirement.
Yes, your chosen Matrix homeserver (matrix.org) switched to OIDC which requires the auth to happen in a browser.
Looks like openExternal indeed does not signal any errors back to the caller: https://github.com/electron/electron/issues/28141
Looks like
openExternalindeed does not signal any errors back to the caller: electron/electron#28141
Correct, no error message reported. Each of these lines is a click on "Continue":
[8413:0907/105151.370452:INFO:CONSOLE:1] "element-web closing", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105153.989589:INFO:CONSOLE:1] "element-web closing", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
[8413:0907/105154.563529:INFO:CONSOLE:1] "element-web closing", source: vector://vector/webapp/bundles/4cb917bfa6c2afdfec1e/init.js (1)
Another option would be to display something (possibly after the continue button is pressed) indicating that the user should continue in the browser that's just opened which would be a good tip as to what was wrong if one did not appear. This would be up to design though.
This is working for me on 1.11.110 with matrix.org: the continue button opens the sign in page for matrix.org in my default browser.
As the OP was saying, it doesn't work (obviously) when no browser is installed. I've been meaning to "complain" (with all due respect for all the work the team is doing for free) about this ever since the browser authentication was introduced:
It shouldn't be necessary - or rather - it should be entirely optional per homeserver per user to decide whether they want to trust their desktop client to authenticate vs. the homeserver, or if they really want to have to separately tell the homeserver "yes, I do intend to authenticate this session to log in".
I mean - I don't even understand the point in avoiding to type in my homeserver password into my matrix client, when then I can use my (arguably much more sensitive) riot recovery key in that same client to authenticate my session.
It shouldn't be necessary - or rather - it should be entirely optional per homeserver per user to decide whether they want to trust their desktop client to authenticate vs. the homeserver, or if they really want to have to separately tell the homeserver "yes, I do intend to authenticate this session to log in".
I mean - I don't even understand the point in avoiding to type in my homeserver password into my matrix client, when then I can use my (arguably much more sensitive) riot recovery key in that same client to authenticate my session.
That isn't really something the Element team can do anything about, that'd be a request for the Matrix spec, maybe there is an oAuth extension that can be added to the spec which allows such a behaviour though it is unlikely given alot of MAS deployments use a delegated auth to a different IdP.