Permission denied, cannot change group

Hi there!
I was looking into selfhosting my songs and I’m now testeing Mopidy+Iris. The “whole house” music streaming aspect with snapcast looks cool.

I have an external HDD mounted at /storage and multiple docker containers uses this drive. (Permission: drwxr-xr-x 10 ubuntu root 4096 May 15 12:07 storage)

My songs are located at /storage/MyData/Music.

The folder /storage/MyData/ have my own data (pictures, music, etc) and permissions are drwxrwx--- 7 ubuntu sambashare 4096 Jun 6 12:58 MyData. I just set up Samba to access/upload music to it easily.

I’d like to avoid changing groups so docker and samba doesn’t break.

I tried creating a symlink in /var/lib/mopidy/Music and set mopidy:audio permission to it but I still have:
PermissionError: [Errno 13] Permission denied: '/storage/MyData/Music'

sudo nano /etc/mopidy/mopidy.conf:

[logging]
#config_file = /etc/mopidy/logging.conf
debug_file = /var/log/mopidy-debug.log

[http]
enabled = true
hostname = 192.168.0.120
port = 6680
zeroconf = Mopidy HTTP server on $hostname
allowed_origins =
csrf_protection = true
default_app = mopidy

[file]
enabled = true
media_dirs =
    /var/lib/mopidy/Music|Music

[local]
enabled = true
media_dir = /var/lib/mopidy/Music
data_dir = /var/lib/mopidy/local

[mpd]
hostname = 192.168.0.120

#[audio]
#output = alsasink

[websettings]
enabled = true
musicbox = false
config_file = /etc/mopidy/mopidy.conf

Note that mopidy-debug.log doesn’t exist so I have to rely on sudo systemctl status mopidy output.

I changed the user mopidy to root in the service configuration but it doesn’t seem to matter (can’t remember the filepath)

Can someone help me solve this?

Thank you very much!

Based on what you wrote, it seems that you are using mopidy as a systemd service. By default it runs with the mopidy user, so you could just add sambashare group to the mopidy user. By the way instead of using a symlink you could also just set the path to your music directory in the mopidy config file.

Hi,

I have the same issue, but setting the path to my music directory in the mopidy config file such as this doesn’t seem to work:
[file]
enabled = true
media_dirs =
/media/username/drive-uuid/Music

Exactly the same issue? The mopidy service runs as user mopidy and must have permission to access your folder.

Actually, no! There was probably some file inside the music directory for which mopidy was spitting out the permission denied. Now I have fixed it, but still the path to that directory in the /etc/mopidy/mopidy.conf config file seems to have no effect.

That config file is probably correct, because if I copy it to ~/.config/mopidy/mopidy.conf and start mopidy manually, it does work.