Snap execution permissions vs current user on get_iplayer

I’ve got the get_iplayer snap (on Ubuntu 20.04.1 LTS) and can save files to my home directory, but when I try to set the output path to my main data directory I get the following error:-

ERROR: Could not create dir ‘/data/iPlayer/Download’: mkdir /data: Read-only file system at /snap/get-iplayer/315/get_iplayer line 3504.

My user does have access to that path, for example I can

touch /data/iPlayer/Download/testfile.txt

and edit the file fine, but it seems the snap command doesn’t have permissions to access that path? Is the snap command somehow executing under a different user, even though I am invoking the command under my user? I have a group datausers that has rwx access to all those paths so does a snap user need adding to that group?


in a snap /data is not what you think it is :wink:

snaps are executed in a confined space on top of their base snap (core, core18, core20), what you are effectively trying to do when running mkdir /data is mkdir /snap/core/current/data and that is ia mounted squashfs filesystem which is indeed read only …

there are two ways around this, you can either bind mount /data into your home dir ($HOME is mapped into the confined environment) or have whatever disk /data normally is mounted (or bind mounted if you do not want to move it) under /mnt or /media and connect the removable-media interface of the snap …