Permission denied while downloading

Sonarr version (exact version): 2.0.0.4645
Mono version (if Sonarr is not running on Windows): 4.6.2
OS: Synology
((Debug logs)): see picture here: http://i.imgur.com/RmbLH5E.jpg
Description of issue:

Hi,

I’ve finished setting up everything. I made sure to give read/write permission for my folder “downloads” where torrent files go. However it seems to have an issue with permission.

Indeed, after launching a download via Sonarr, torrent starts downloading (via Transmission on my Synology) but after 30 seconds I get the error "Error : permission denied (/downloads/name_of_torrent). And it does the same, whatever torrent source I use.

I tested on submitting a torrent directly via Transmission and it works well, so the error has to be linked to Sonarr…

Would you be able to help me with this ? It’s really frustrating not being able to make this work! :slight_smile:

Thanks a lot!

Sonarr doesn’t explicitly set permissions on downloads.

If it’s Sonarr related it could be due to specifying the download folder in Sonarr’s transmission settings. What’s the difference in save location for a download Sonarr queues vs one you added manually?

Thanks for your answer.

It is exactly the same folder…
I’ve downloaded another torrent client (Deluge) and it works well, so I guess I’ll stick with this one instead of Transmission.

This may be of interest to you. I have a few different accounts that need to access the data for Sonarr. I’m not sure if this is the most efficient method but it’s the method that has been working for me. I created an account called “tor” which runs rTorrent, ruTorrent, sonarr and radarr.

Assuming that Synology will let you edit user groups and setup cron jobs, I would set this cron to run with root permissions. It’s currently written to go off every 5 minutes. tor:tor is the username:group (both identical in this case.)

*/5 * * * * chown -R tor:tor /path/to/data/ && chmod -R g+w /path/to/data/ > /dev/null 2>&1

It’s recursive, but if you have another mount point, you can add this as many times as you need into the cron. I actually have it 4 times.

Then edit groups (/etc/group). For group tor, I have this:

tor:x:1002:gtwy,root,tor,www-data

Where the first tor is the group name, “x” followed by a group ID (1002) are system generated and shouldn’t be changed, gtwy is my local account with no privileges, root is the admin, tor is the user that normally is in this group, and www-data is what Ubuntu uses for apache (since I am running ruTorrent that also needs to have access to read/write to that folder.)

cronjob to set chown/chmod? no, sry I can’t leave that unanswered.

Afaik this is just a matter setting your umask and group properly for the download client.
Also, synology has it’s own acl mechanism iirc, so it’s a bit different (and more flexible, coz it supports inherited parent permissions).

Ok so I’ve made the following changes to try and make my solution less “messy”

I set a UMask in my systemd for rtorrent.

[Unit]
Description=rTorrent Daemon
After=network.target

[Service]
Type=forking
KillMode=none
User=tor
ExecStart=/usr/bin/tmux new-session -s rtorrent -n rtorrent -d rtorrent
ExecStop=/usr/bin/tmux send-keys -t rtorrent C-q && /usr/bin/tmux kill-session -t rtorrent
WorkingDirectory=/home/tor/
Restart=on-failure
UMask=002

[Install]
WantedBy=multi-user.target

I set permissions, users, and groups in my smb.conf

[global]
workgroup = WORKGROUP
server role = standalone server
server string = Multimedia Server
netbios name = SERVER
security = user
map to guest = bad user
dns proxy = no
guest account = tor
create mask = 0664
directory mask = 0775
force user = tor
force group = tor

[Media]
path = /storage/media
available = yes
browseable = yes
writeable = no
guest ok = yes
read only = yes

[Uploads]
path = /storage/uploads
available = yes
browseable = yes
writeable = yes
guest ok = yes

[Watch$]
path = /storage/watch
available = yes
browseable = yes
writeable = yes
guest ok = yes

And I updated Sonarr and Radarr to adjust the permissions using the web gui

However, when I upload a file through ruTorrent (which runs on apache) it is still not adding write permissions to the group. The files in question are simply the .torrent files that get sent to ruTorrent to being the transfer.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.