cmd_run.go:179: WARNING: cannot create user data directory: cannot create "/home/$USER/snap/$SNAP/$VERSION": mkdir /home/$USER/snap/$SNAP: permission-denied

Bug #1625279 reported by Chris J Arges
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Snappy
Expired
Undecided
Unassigned

Bug Description

[ Test Case ]

1) Setup clean Xenial VM without logging into the snap store
2) Update snapd to 2.15.2
3) $ git clone https://github.com/arges/go-client-daemon.git
4) $ snapcraft
5) $ sudo snap install --force-dangerous client-daemon_1_amd64.snap
6) $ client-daemon.client
2016/09/19 17:04:24.925319 cmd_run.go:179: WARNING: cannot create user data directory: cannot create "/home/ubuntu/snap/client-daemon/x1": mkdir /home/ubuntu/snap/client-daemon: permission denied
failed to create user data directory. errmsg: Permission denied

Additional info:

ls -l ~/snap shows it is root:root
ls -l /root/snap shows it is also created and root:root

The test program snaps both a client and daemon, the daemon runs as a systemd service, and the client can connect to the service via a socket that resides in the SNAP_DATA directory. The application makes no use of the SNAP_USER_DATA directory. The problem only occurs when the userspace/client program is invoked.

Revision history for this message
Danilo Cominotti Marques (dcominottim) wrote :

I get the following when trying to launch the latest Libre Office snap on Ubuntu 16.04.3:

$ snap run libreoffice
cannot create user data directory: /home/danilocm/snap/libreoffice/21: Permission denied

$ sudo snap run libreoffice
[sudo] password for danilocm:
mkdir: cannot create directory '/run/user/0': Permission denied
No protocol specified
No protocol specified
mkdir: cannot create directory '/run/user/0': Permission denied
No protocol specified
No protocol specified

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Hello

Can you please provide the apparmor denial? It should be possible to find it by looking for the message "DENIED" and the specific path, e.g. "/run/user/0" in syslog/journal. I will look from the source code but having the denial would help.

Changed in snappy:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Snappy because there has been no activity for 60 days.]

Changed in snappy:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.