Access to the path "/tmp/sonarr_update/Sonarr.main.3.0.6.1265.linux.tar.gz.part" is denied

Sonarr version: 3.0.6.1196
Package Version:3.0.6 by Team Sonarr
Mono version:6.12.0.145
OS: Ubuntu Server (Headless) 20.04
Debug logs: Event Log
Description of issue: Attempt to update using the built-in updater. It starts and then fails.
Assumption is that it’s a permission issue, but sonarr is otherwise functioning properly (moving files, renaming, creating directories etc.)
looking at the permissions of the /tmp directory it shows

d--------- 2 colin colin 4096 Jun 18 18:40 sonarr_update

NB: the sonarr user (colin) is the owner user/group, so should have rights. But I gather that the permission on that update folder (d------------) mean no-one has access? Note that this is just a factory install of sonarr V3 using the guide on the wiki - I haven’t changed any of the permissions there. Also, interestingly, I have tried to chmod 777 -R the directory, which does work, however when I run the update again (which fails) it seems to revert the update directory back to that d--------- permission combination.

UPDATE (re: sonarr creating new directories)
just started a new series. Sonarr created the folder, but it creates it with the same d--------- permission combination (and so of course can’t import the DL’s). Seems related to the above update issue - seems sonarr can only create directories/files with no permission for anyone… not sure how to correct this. My work-around for this is running a cron job to chmod 777 the media directories every 10 minutes. But this doesn’t work for the update issue… plus it would be good not to have to run the chron just for the sake of being able to let sonarr create series directories.

My guess would be that the service umask is set to 777 (which should never be done).

check it with systemctl cat sonarr and also check sonarr Settings->Media management->Permissions… although I don’t think that one applies to updates.

1 Like

Right you are!

What should I change it to?

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

[Service]
User=colin
Group=colin
UMask=0777

Type=simple
ExecStart=/usr/bin/mono --debug /usr/lib/sonarr/bin/Sonarr.exe -nobrowser -data=/var/lib/sonarr
TimeoutStopSec=20
KillMode=process
Restart=on-failure

[Install]
WantedBy=multi-user.target

well, umask is kinda like the inverse of permission flags. so it’d be 0000. But please don’t do that. Setting stuff to 777 permissions is bad practice, very bad practice. Instead the users should be in the appropriate groups and the file permissions set to 775 (umask 0002).
But that’s fairly generic linux stuff, so if you want to know more about it please google umask, group and permissions.

Perfect, thank you! went with 002.
Update is working and appears directories have permissions again.

1 Like

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