So the snap uses fuse-support plug and was trying to mount to /media/mstp directory which did not work. The snappy-debug suggested to use the mount points from SNAP directories and so I tried to create a directory in $SNAP_COMMON and tried to mount which resulted in permission denied error. Any idea how to overcome this issue ? Please let me know if you need more info.
Thanks
= AppArmor =
Time: Feb 16 06:38:29
Log: apparmor="DENIED" operation="mkdir" profile="snap.usermstp.usermstpser" name="/media/mstp/"
pid=17467 comm="mkdir" requested_mask="c" denied_mask="c" fsuid=0 ouid=0
File: /media/mstp/ (write)
Suggestion:
* adjust program to write to $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or
$SNAP_USER_COMMON
= AppArmor =
Time: Feb 16 06:41:22
Log: apparmor="DENIED" operation="mount" info="failed mntpnt match" error=-13
profile="snap.usermstp.fusemstp" name="/var/snap/usermstp/common/mstp/" pid=17993
comm="fuse_mstp" fstype="fuse.fuse_mstp" srcname="fuse_mstp" flags="rw, nosuid, nodev"
that translates to “I tried to create a directory in /var/snap/<snapname>/common” … is your app running as root (did you use sudo) ? Else you wont have permissions to create a dir there …
If you want this to work without sudo permissions use $SNAP_USER_COMMON (which translates to ~/snap/<snapname>/common) where the user definitely has write permissions.
@ogra, the directory was created in a startup script with mkdir -p /$SNAP_USER_COMMON/mstp command . Do you think that might be the reason behind the permission denied error ? Thanks .
no, as @jdstrand said above, the interface currently only allows $SNAP_USER_DATA and $SNAP_DATA as mountpoints (not _COMMON). So try to change this and it should work … (or wait til the next batch of updates that will allow _COMMON too)
To expand on @ogra’s answer (which I agree with), we are being very careful with the mount locations that fuse-support can do. Specifically we limit them to the snap’s directories so that the snap can’t interfere with other parts of the system.