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

Authorization grant [ID] already used - MAS

Open JokerGermany opened this issue 8 months ago • 29 comments

Steps to reproduce

The new Implementation of SSS was to Buggy for my USE-Case, therefore I decided to Logout and Login to switch to the old very slow Sync Method... I tried to Login and redirected to account.matrix.org (MAS), but when I click on continue nothing happens, when I clicked a second time on continue, I get the Error Message Authorization grant [ID] already used https://youtu.be/M5AiMuc0g3E

Note: I use multiple Profiles. In the Video you see the try where i have closed all other Element-Desktop Profiles before.

Outcome

What did you expect?

Login

What happened instead?

Nothing..

Operating system

Linux Mint 22.1

Application version

Version von Element: 1.11.99 Krypto-Version: Rust SDK 0.10.0 (3cc301d), Vodozemac 0.9.0

How did you install the app?

packages.element.io

Homeserver

matrix.org

Will you send logs?

No

€dit: Another Error can be:

pool timed out while waiting for an open connection

JokerGermany avatar Apr 25 '25 06:04 JokerGermany

How did you install the app? app.element.io

So is this element web or desktop..?

t3chguy avatar Apr 25 '25 07:04 t3chguy

Element Desktop https://github.com/Linux-Installation/Linux-Mint-Installations-Script/blob/0e29c78af7218f43046b7ac30813560f03e533f0/22.sh#L398

JokerGermany avatar Apr 25 '25 07:04 JokerGermany

We don't support nala - nor have I ever heard of it. Seems like something on your system is breaking the freedesktop x-schema handler definitions. https://specifications.freedesktop.org/desktop-entry-spec/latest/ you may want to follow something like https://superuser.com/a/309343 to ensure there is a handler for Element Desktop specified in a place your system looks for those, we include such in our .desktop file in the deb package

t3chguy avatar Apr 25 '25 07:04 t3chguy

This is what was happening in ver 1.11.98.

So maybe there are some files conflicting from previous installation.

Download from element.io website and do a clean install (after deleting the old files).

This is what I did in my Windows desktop and it works now.

Steps to reproduce

The new Implementation of SSS was to Buggy for my USE-Case, therefore I decided to Logout and Login to switch to the old very slow Sync Method... I tried to Login and redirected to account.matrix.org (MAS), but when I click on continue nothing happens, when I clicked a second time on continue, I get the Error Message Authorization grant [ID] already used https://youtu.be/M5AiMuc0g3E

Note: I use multiple Profiles. In the Video you see the try where i have closed all other Element-Desktop Profiles before.

Outcome

What did you expect?

Login

What happened instead?

Nothing..

Operating system

Linux Mint 22.1

Application version

Version von Element: 1.11.99 Krypto-Version: Rust SDK 0.10.0 (3cc301d), Vodozemac 0.9.0

How did you install the app?

packages.element.io

Homeserver

matrix.org

Will you send logs?

No

€dit: Another Error can be:

pool timed out while waiting for an open connection

escix avatar Apr 25 '25 08:04 escix

1.11.98 had a bug with authority-less URIs in the element-desktop binary, unrelated to .desktop files.

t3chguy avatar Apr 25 '25 08:04 t3chguy

We don't support nala - nor have I ever heard of it.

https://github.com/volitank/nala

Nala is a front-end for libapt-pkg. Specifically we interface using the python-apt api.

JokerGermany avatar Apr 25 '25 09:04 JokerGermany

Seems like something on your system is breaking the freedesktop x-schema handler definitions. https://specifications.freedesktop.org/desktop-entry-spec/latest/ you may want to follow something like https://superuser.com/a/309343 to ensure there is a handler for Element Desktop specified in a place your system looks for those, we include such in our .desktop file in the deb package

I think multiple Element-Desktop Profiles are the Problem -__- I had the Problem before that matrix.org links are opened in a "random" Element Profile...

JokerGermany avatar Apr 25 '25 09:04 JokerGermany

We don't support nala - nor have I ever heard of it. volitank/nala Nala is a front-end for libapt-pkg. Specifically we interface using the python-apt api.

Sure, but if you're not following our instructions then you're not going to be supported unfortunately, we don't have time to reproduce uncommon environments: https://element.io/download

t3chguy avatar Apr 25 '25 09:04 t3chguy

We don't support nala - nor have I ever heard of it. volitank/nala Nala is a front-end for libapt-pkg. Specifically we interface using the python-apt api.

Sure, but if you're not following our instructions then you're not going to be supported unfortunately, we don't have time to reproduce uncommon environments: https://element.io/download


jokergermany@huppyryzen:~$ sudo apt-get remove element-desktop
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
Das folgende Paket wurde automatisch installiert und wird nicht mehr benötigt:
  element-io-archive-keyring
Verwenden Sie »sudo apt autoremove«, um es zu entfernen.
Die folgenden Pakete werden ENTFERNT:
  element-desktop
0 aktualisiert, 0 neu installiert, 1 zu entfernen und 0 nicht aktualisiert.
Nach dieser Operation werden 466 MB Plattenplatz freigegeben.
Möchten Sie fortfahren? [J/n] J
(Lese Datenbank ... 788004 Dateien und Verzeichnisse sind derzeit installiert.)
Entfernen von element-desktop (1.11.99) ...
update-alternatives: Warnung: Alternative /opt/Element/element-desktop (Teil der Link-Gruppe element-desktop) existiert nicht;
sie wird aus der Liste der Alternativen entfernt
update-alternatives: Warnung: /etc/alternatives/element-desktop ist ein ins Leere zeigender Link; wird mit der besten Auswahl aktualisiert
Trigger für hicolor-icon-theme (0.17-2) werden verarbeitet ...
Trigger für gnome-menus (3.36.0-1.1ubuntu3) werden verarbeitet ...
Trigger für mate-menus (1.26.1+mint1) werden verarbeitet ...
Trigger für mailcap (3.70+nmu1ubuntu1) werden verarbeitet ...
Trigger für desktop-file-utils (0.27-2build1) werden verarbeitet ...
jokergermany@huppyryzen:~$ sudo apt install element-desktop
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
Die folgenden NEUEN Pakete werden installiert:
  element-desktop
0 aktualisiert, 1 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
Es müssen noch 0 B von 107 MB an Archiven heruntergeladen werden.
Nach dieser Operation werden 466 MB Plattenplatz zusätzlich benutzt.
Vormals nicht ausgewähltes Paket element-desktop wird gewählt.
(Lese Datenbank ... 787895 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../element-desktop_1.11.99_amd64.deb ...
Entpacken von element-desktop (1.11.99) ...
element-desktop (1.11.99) wird eingerichtet ...
update-alternatives ist /usr/bin/update-alternatives
update-alternatives: /opt/Element/element-desktop wird verwendet, um /usr/bin/element-desktop (element-desktop) im automatischen Modus bereitzustellen
Trigger für desktop-file-utils (0.27-2build1) werden verarbeitet ...
Trigger für hicolor-icon-theme (0.17-2) werden verarbeitet ...
Trigger für gnome-menus (3.36.0-1.1ubuntu3) werden verarbeitet ...
Trigger für mate-menus (1.26.1+mint1) werden verarbeitet ...
Trigger für mailcap (3.70+nmu1ubuntu1) werden verarbeitet ...

Is my Environment now supported? Same Error appears

JokerGermany avatar Apr 25 '25 09:04 JokerGermany

What does gio mime x-scheme-handler/io.element.desktop print?

t3chguy avatar Apr 25 '25 09:04 t3chguy

It's missing like you assumed.

gio mime x-scheme-handler/io.element.desktop
Keine Vorgabeanwendungen für »x-scheme-handler/io.element.desktop«

But why isn't it installed?

JokerGermany avatar Apr 25 '25 09:04 JokerGermany

You'd have to query your system vendor, as it does not seem to be following the freedesktop specifications which state that x-scheme-handlers registered in .desktop files in /usr/share/applications should be respected.

Image

t3chguy avatar Apr 25 '25 09:04 t3chguy

Which one? Linux Mint which is basically a Ubuntu which is basically a Debian?

JokerGermany avatar Apr 25 '25 09:04 JokerGermany

There is no .desktop file in /usr/local/share/applications

jokergermany@huppyryzen:~$ ll /usr/local/share/applications
insgesamt 20
drwxr-xr-x  2 root root 4096 Apr 25 11:15 ./
drwxr-xr-x 13 root root 4096 Apr  1 18:32 ../
-rw-r--r--  1 root root   13 Apr 25 11:15 mimeinfo.cache
-rw-r--r--  1 root root  474 Sep 24  2024 scrcpy-console.desktop
-rw-r--r--  1 root root  438 Sep 24  2024 scrcpy.desktop

JokerGermany avatar Apr 25 '25 09:04 JokerGermany

Whichever vendor provided your distro. If they have a different place for your .desktop files to live which is non-standard then you would need to follow their instruction instead.

t3chguy avatar Apr 25 '25 09:04 t3chguy

There is no .desktop file in /usr/local/share/applications

Then it seems like your use of apt-alternatives did end up breaking things, as you can see in my dpkg -L call above, the package contains one.

t3chguy avatar Apr 25 '25 09:04 t3chguy

Sorry, its /usr/share/applications - not local.

t3chguy avatar Apr 25 '25 09:04 t3chguy

It should be specified within $XDG_DATA_DIRS. The freedesktop specifies the default path for this to be /usr/local/share/:/usr/share/ which includes /usr/share/applications https://specifications.freedesktop.org/basedir-spec/latest/#variables

t3chguy avatar Apr 25 '25 09:04 t3chguy

It should be specified within $XDG_DATA_DIRS. The freedesktop specifies the default path for this to be /usr/local/share/:/usr/share/ which includes /usr/share/applications https://specifications.freedesktop.org/basedir-spec/latest/#variables


echo $XDG_DATA_DIRS
/usr/share/cinnamon:/usr/share/gnome:/home/jokergermany/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share

JokerGermany avatar Apr 25 '25 09:04 JokerGermany

@JokerGermany thanks, so that confirms that /usr/share/applications should be included for .desktop entry parsing, do you have /usr/share/applications/element-desktop.desktop containing the MimeType line?

t3chguy avatar Apr 25 '25 09:04 t3chguy

ll /usr/share/applications/element-desktop.desktop
-rw-r--r-- 1 root root 307 Apr 23 13:25 /usr/share/applications/element-desktop.desktop
cat /usr/share/applications/element-desktop.desktop
[Desktop Entry]
Name=Element
Exec=/opt/Element/element-desktop %U
Terminal=false
Type=Application
Icon=element-desktop
StartupWMClass=Element
Comment=Element: the future of secure communication
MimeType=x-scheme-handler/io.element.desktop;x-scheme-handler/element;
Categories=Network;InstantMessaging;Chat;

JokerGermany avatar Apr 25 '25 09:04 JokerGermany

Okay, so you need to query your system vendor as to why your system is not following freedesktop specification, a .desktop file with MimeType x-scheme-handler entry is not being respected even though it is within the $XDG_DATA_DIRS.

t3chguy avatar Apr 25 '25 09:04 t3chguy

Okay, i don't know why it don't worked default, but i inserted into
~/.config/mimeapps.list

x-scheme-handler/io.element.desktop=element-desktop.desktop
x-scheme-handler/element=element-desktop.desktop

And I am glad that I tried to login into my "default" profile. What do I had to do when I would want to login in another element-profile? 🤔

JokerGermany avatar Apr 26 '25 20:04 JokerGermany

I think the problem is, that element is not inserted into /usr/share/applications/mimeapps.list 🤔 I needed to create a /etc/xdg/mimeapps.list file

JokerGermany avatar Apr 26 '25 21:04 JokerGermany

I think the problem is, that element is not inserted into /usr/share/applications/mimeapps.list 🤔

It shouldn't need to be as per https://specifications.freedesktop.org/mime-apps-spec/latest-single/

Your $XDG_DATA_DIRS contains /usr/share

So as per the freedesktop specification $XDG_DATA_DIRS/applications/mimeapps.list would be /usr/share/applications/mimeapps.list then see the following from the freedesktop specification:

add to the results list any .desktop file found in the same directory as the mimeapps.list which lists the given type in its MimeType= line, excluding any desktop files already in the blacklist.

t3chguy avatar Apr 28 '25 08:04 t3chguy

I installed Element for the first time today and had the same issue. Same version and everything as @JokerGermany, except I'm on Debian 12. An entry in my ~/.config/mimeapps.list was created, but it looked like this:

x-scheme-handler/io.element.desktop=io.element.desktop
x-scheme-handler/element=element-desktop.desktop

The redirect worked once I changed it to this:

x-scheme-handler/io.element.desktop=element-desktop.desktop
x-scheme-handler/element=element-desktop.desktop

Though the change gets reverted every time I start Element.

abramu avatar May 01 '25 19:05 abramu

changes to ~/.config/mimeapps.list

was not enough for me in Arch.

I had to do the same into /usr/share/applications/mimeinfo.cache

spectrum70 avatar May 05 '25 07:05 spectrum70

I have the same error, the fix described here works, but out-of-the-box Element Desktop 1.1.100 is bugged.

leManied avatar May 18 '25 19:05 leManied

I'm also facing this issue. Getting the error:

"Unexpected error

Authorization grant <ID> already used"

Currently using Element Desktop on NixOS

candsastle avatar Oct 16 '25 22:10 candsastle