All Flatpak apps fail to launch

I use Flatpak for a few essential applications (Spotify, Discord and Bitwarden) and none of them will launch when selecting them in the application menu in KDE. There are no error messages. Or anything and I have no idea how to fix the problem or even diagnose what the problem is because I don’t know what log files to look in. Can anyone provide any help on the subject, please? I use these apps ALL the time, so them not working is a bit of a problem for me.

Thank you.

Try starting from the command line to see any errors generated

I just had a bit of a play around in the terminal and got the following errors. The first one when trying to launch Spotify at this location:


/var/lib/flatpak/app/com.spotify.Client/current/active/files/bin

shows these errors:


./spotify: line 3: get-scale-factor.py: command not found
./spotify: line 41: set-dark-theme-variant.py: command not found

the second one at this location:


/var/lib/flatpak/app/com.spotify.Client/current/active/files/extra/bin

shows this error:


./spotify: error while loading shared libraries: libcurl-gnutls.so.4: cannot open shared object file: No such file or directory

Any help is appreciated. I’m not even sure what is the correct binary for Spotify. There are so many bin directories I’m a bit confused.

I think he meant run the flatpak command in the command line. That would be

flatpak run com.spotify.Client

I’m new to Flatpak. Sorry I didn’t know you could do that. Here is the output from that command.


flatpak run com.spotify.Client 
Invalid MIT-MAGIC-COOKIE-1 keysimon@localhost:~> /app/extra/bin/spotify: /app/lib/libcurl-gnutls.so.4: no version information available (required by /app/extra/bin/spotify)
Traceback (most recent call last):
  File "/app/bin/set-dark-theme-variant.py", line 8, in <module>
    disp = Xlib.display.Display()
  File "/app/lib/python3.7/site-packages/Xlib/display.py", line 89, in __init__
    self.display = _BaseDisplay(display)
  File "/app/lib/python3.7/site-packages/Xlib/display.py", line 71, in __init__
    protocol_display.Display.__init__(self, *args, **keys)
  File "/app/lib/python3.7/site-packages/Xlib/protocol/display.py", line 167, in __init__
    raise error.DisplayConnectionError(self.display_name, r.reason)
Xlib.error.DisplayConnectionError: Can't connect to display ":99.0": b'Invalid MIT-MAGIC-COOKIE-1 key'
Gtk-Message: 22:31:36.441: Failed to load module "unity-gtk-module"
Gtk-Message: 22:31:36.441: Failed to load module "canberra-gtk-module"
Invalid MIT-MAGIC-COOKIE-1 key
(spotify:6): Gtk-WARNING **: 22:31:36.441: cannot open display: :99.0

Woah, display :99? It should be trying to use :0
I see you’re using KDE, are you in Xorg mode or Wayland mode?
Run this command and see:

echo $XDG_SESSION_TYPE

That command returns x11.


x11

What happens if you try launching KDE in a wayland session, does that solve it? Also, something you may or may not be happy to hear is that all 3 of those apps are webapps, meaning you can use them in the browser. In some cases ( like discord ) is works better in firefox than the desktop client ( anecdotal, but consistent opinion among my friends )

Yeah, I’ve been using the web apps while I’ve been having these problems with Flatpak. They are OK but I prefer to have real applications. That is probably out of habit though.

I don’t know how to start a Wayland session, unfortunately. Is it fairly easy to do? I’ve heard of Wayland but never really looked into it so have no knowledge of how to use it.

Yeah, you logout into the display manager, and select the wayland session. What button this is, depends on your display manager. Here’s a link on how to do for every major display manager:
GDM
LightDM
SDDM(Very Obvious on what it is imo)

Ah, sorry. I’ve never bothered looking around much in the login screen so didn’t know about that.

I tried Wayland and Full Wayland (no idea what the difference is between them but it seemed reasonable to try them both) and neither worked at all. Full Wayland showed the last few lines of text from the boot sequence and basically hung forcing a hard reset and Wayland just showed an underscore at the top left of the screen and hung as well also forcing a hard reset.

You didn’t say, but what GPU do you have? AMD, Nvidia, or just Intel Integrated Graphics? Because i’m starting to suspect driver issues

Nvidia 1080Ti running at stock speed. I’m running the G05 drivers with all the latest updates on OpenSUSE installed.

Ah, nvidia, should’ve known. Nvidia has always been a pain, and it could be anything. The driver could be improperly installed or it could be a bug in the drivers itself, Unfortunately, I don’t use nvidia, so the only thing I can tell you, is that this is 100% either a driver or xorg configuration issue. Also, the reason wayland didn’t work is because wayland doesn’t work on nvidia.

Only idea I have is this: Do you have the package

x11-video-nvidiaG05

installed? Maybe you’re missing the x11 driver.

Yep. All installed.

I got pissed off with Flatpak so I went back to the snap version which is the official distribution method and now that doesn’t work either. I’m just going to annoy Spotify technical support until I get this fixed. I do pay for it afterall.

Thank you very much for your help though. I’ll post a solution here if Spotify technical support come up with a fix.