Lets focus on the telegram-desktop snap to begin with. Can you run snap connections telegram-desktop and paste the output here, please? This will let us see if the desktop and x11 interfaces are correctly connected (they are supposed to automatically connect, but sometimes things go awry). Another useful pair of commands to post the output of are snap version and snap changes.
snap 2.39.1-3.9
snapd 2.39.1-3.9
series 16
opensuse-tumbleweed 20190904
kernel 5.2.11-1-default
ID Status Spawn Ready Summary
1 Done today at 09:49 MSK today at 09:49 MSK Initialize system state
2 Done today at 09:51 MSK today at 09:54 MSK Install “telegram-desktop” snap
3 Done today at 09:51 MSK today at 09:51 MSK Initialize device
4 Done today at 10:15 MSK today at 10:16 MSK Install “notepadqq” snap
5 Done today at 10:50 MSK today at 10:50 MSK Remove “notepadqq” snap
I also have that problem. Snaps with a GUI do not run because they cannot connect to :0. (I hope you don’t mind that I will be using chromium instead of telegram-desktop). The message is:
/snap/bin/chromium
No protocol specified
[4520:4520:0616/011650.598989:ERROR:browser_main_loop.cc(1473)] Unable to open X display.
If I execute xhost +local:, so that local connections are always accepted by X, chromium runs normally.
I have checked that from inside the the snap the DISPLAY and XAUTHORITY variables are set properly and the .Xauthority file is readable:
I am also using a laptop with an Intel graphics chip (the regular modesetting driver) and an Nvidia graphics card (proprietary nvidia driver), and using prime-select (package suse-prime) to set the graphics card that should be used. However, I have rolled back to a file system snapshot from before I installed the proprietary drivers and suse-prime and confirmed that the snap doesn’t work with the default OS setup either.
I haven’t yet figured out how to get proper debug messages from X about the rejected connection. If you have any tips on that or you need further information, please tell me.
Two things I forgot: I have tried installing chromium in devmode and it didn’t help.
Also, after installing a snap I get the following message:
Warning: /snap/bin was not found in your $PATH. If you've not restarted your session since you
installed snapd, try doing that. Please see https://forum.snapcraft.io/t/9469 for more
details.
But in fact /snap/bin is inside my PATH. I don’t know if that message could be relevant to this issue in any way.
This is caused by sudo resetting $PATH to some known set of locations. Unfortunately we have no way of extending this. Recently, we have merged a change that will no longer show when warning when snap install is invoked under sudo.
Ok thanks, good to know. I just wanted to let you guys know in case the environment scrubbing has some kind of impact on the X11 connection (even though the DISPLAY and XAUTHORITY variables seem to be set correctly inside the snap).
I was having this issue on OpenSuse 15.4. It turned out that a non-standard home directory other than /home/$USER was the cause in my case (a google search showed I wasn’t the only one). The error reported when attempting to start a snap was:
cannot change profile for the next exec call: No such file or directory
The instructions in the link:
followed by restarting the apparmor service fixed it. Hopefully this will help some of us.