Some snaps won't run anymore due to Permission denied

I am using Fedora 32 and have some snaps installed.
Recently, some of them stopped working.

They all complain about permission denied. I can run them with sudo though, but that’s not the point.

$ p3x-onenote 
2020/10/30 09:09:12.035332 cmd_run.go:927: WARNING: cannot start document portal: Expected portal at "/run/user/1000/doc", got "/home/wojciech/.cache/doc"
mkdir: cannot create directory '/run/user/1000/snap.p3x-onenote': Permission denied
$ discord
2020/10/30 09:11:01.162855 cmd_run.go:927: WARNING: cannot start document portal: Expected portal at "/run/user/1000/doc", got "/home/wojciech/.cache/doc"
mkdir: cannot create directory '/run/user/1000/snap.discord': Permission denied
Discord 0.0.12
Gtk-Message: 09:11:03.116: Failed to load module "pk-gtk-module"
Gtk-Message: 09:11:03.117: Failed to load module "pk-gtk-module"

(Discord:48748): dconf-CRITICAL **: 09:11:03.435: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.435: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.435: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.435: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.435: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.435: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.435: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.437: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.438: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.438: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.438: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.438: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.438: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.
Starting app.
Starting updater.
[Modules] Modules initializing
[Modules] Distribution: remote
[Modules] Host updates: enabled
[Modules] Module updates: enabled
[Modules] Module install path: /home/wojciech/snap/discord/115/.config/discord/0.0.12/modules
[Modules] Module installed file path: /home/wojciech/snap/discord/115/.config/discord/0.0.12/modules/installed.json
[Modules] Module download path: /home/wojciech/snap/discord/115/.config/discord/0.0.12/modules/pending

(Discord:48748): dconf-CRITICAL **: 09:11:03.748: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.748: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.748: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.748: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.748: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.748: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.748: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.749: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.751: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.751: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.751: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.751: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.

(Discord:48748): dconf-CRITICAL **: 09:11:03.751: unable to create directory '/run/user/1000/snap.discord/dconf': Permission denied.  dconf will not work properly.
[48927:1030/091103.948542:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
$ ls -la ~/.cache/ | grep doc
dr-x------.   2 wojciech wojciech      0 1970-01-01  doc

Hi, sorry for late reply. Are there any SELinux denials logged when this happens?

What is the output of $ stat /run/user/1000?

Hi @mborzecki, thanks for response, but since my original posting, I’ve reinstalled Fedora and now I am on version 33. The problem is gone as well, as for now. On F32 it was also good in the beginning, then something broke. I’ll update this thread if this happens again.

Hi team, I’m having the same issue on Fedora 34. Installing some programs works just fine while most others complain about various permissions:


My cd is /home/$USER but /home/$USER/snap points to /var/lib/snapd/snap

How can I fix snap’s location if that’s the problem? / How do I make sure it’s installed into the correct location?


I installed Discord just to compare error messages:

2021/11/03 23:44:54.027145 cmd_run.go:1002: WARNING: cannot create user data directory: cannot create "/home/jannik/snap/discord/common": mkdir /home/jannik/snap/discord/common: permission denied
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
cannot create user data directory: /home/jannik/snap/discord/130: Not a directory

– starting discord with sudo works with a few runtime errors

Todoist:

➜  ~ todoist
2021/11/03 23:46:34.818369 cmd_run.go:1002: WARNING: cannot create user data directory: cannot create "/home/jannik/snap/todoist/common": mkdir /home/jannik/snap/todoist/common: permission denied
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
cannot create user data directory: /home/jannik/snap/todoist/14: Not a directory

– starting with sudo works but breaks essential functionality anyway

➜  ~ sudo todoist
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
Gtk-Message: 23:47:12.017: Failed to load module "pk-gtk-module"
Gtk-Message: 23:47:12.018: Failed to load module "pk-gtk-module"
Failed to open connection to "session" message bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
23:47:12.320 › SNAP env is defined, updater is disabled

(todoist:7591): libappindicator-WARNING **: 23:47:12.503: Unable to get the session bus: Unknown or unsupported transport “disabled” for address “disabled:”

(todoist:7591): LIBDBUSMENU-GLIB-WARNING **: 23:47:12.503: Unable to get session bus: Unknown or unsupported transport “disabled” for address “disabled:”

-> I’m not able to redirect to the browser for login

Notion:

➜  ~ notion-snap
2021/11/03 23:51:44.794304 cmd_run.go:1002: WARNING: cannot create user data directory: cannot create "/home/jannik/snap/notion-snap/common": mkdir /home/jannik/snap/notion-snap/common: permission denied
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
cannot create user data directory: /home/jannik/snap/notion-snap/6: Not a directory

– sudo notion-snap seems to resolve most issues

➜  ~ sudo notion-snap
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
Gtk-Message: 23:52:26.347: Failed to load module "pk-gtk-module"
Gtk-Message: 23:52:26.348: Failed to load module "pk-gtk-module"
(node:8069) electron: The default of contextIsolation is deprecated and will be changing from false to true in a future release of Electron.  See https://github.com/electron/electron/issues/23506 for more information

obs:

➜  ~ obs
obs: error while loading shared libraries: libQt5Svg.so.5: cannot open shared object file: No such file or directory

stat /run/user/1000 output for good measure:

➜  ~ stat /run/user/1000

  File: /run/user/1000
  Size: 360       	Blocks: 0          IO Block: 4096   directory
Device: 3ah/58d	Inode: 1           Links: 11
Access: (0700/drwx------)  Uid: ( 1000/  jannik)   Gid: ( 1000/  jannik)
Context: system_u:object_r:user_tmp_t:s0
Access: 2021-11-03 23:29:59.926100408 +0100
Modify: 2021-11-03 23:37:35.637599012 +0100
Change: 2021-11-03 23:37:35.637599012 +0100
 Birth: -

It looks like you at some point tried to create a symlink of /snap -> /var/lib/snapd/snap to enable classic snaps but forgot to use /snap and ended up symlinking $HOME/snap to /var/lib/snapd/snap. If $HOME/snap is indeed a symlink, then you should remove it and just run the snap application normally, in which case a proper directory at $HOME/snap with be created with the app specific locations inside.