Page 1 of 1

Permissions for SABnzbd 3.3.1-49 on DSM7

Posted: September 6th, 2021, 10:01 pm
by houndtt
I recently installed the DSM7 compatible version of SABnzbd however testing a download in Lidarr (20210322-7) I got the following error:

Code: Select all

Couldn't import track /volume1/downloads/complete/Music/Imagine.Dragons-Origins.2018.MP3-AsmoFuscated/Imagine Dragons - Origins - 15 - Real Life.mp3: Access to the path '/volume1/downloads/complete/Music/Imagine.Dragons-Origins.2018.MP3-AsmoFuscated/Imagine Dragons - Origins - 15 - Real Life.mp3' is denied.
Now previously under DSM6 imports with Lidarr worked fine and in this instance the mp3 file did copy across correctly but the original in the download folder remained. I suspect it failed trying to delete the original after the copy operation. Now I tried adding 'sc-lidarr' with read/write access to the download folder (per the permissions instruction at the wiki page for permission management) but this did not fix the issue.

I then examined the permissions on the folder that was downloaded by SABnzbd and it was set to the owner 'sc-sabnzbd' and the folder did not inherit permissions from the higher level folder so the permission for 'sc-lidarr' didn't propagate. Looking back I see that both the download folder and the media folder had a group 'sc-download' with read/write access to both folders and this is what I suspect facilitated the correct functioning of Lidarr. Unfortunately, the group for the new files downloaded by SABnzbd under DSM7 is not this group anymore.

Any advice of how I should setup SABnzbd so the permissions for media management with Lidarr work correctly?

Re: Permissions for SABnzbd 3.3.1-49 on DSM7

Posted: September 6th, 2021, 10:08 pm
by Junkt0wn
Hi Houndtt,

I had run into this as well just today.

You'll need to delete or move that folder to somewhere else, and let SABnzdb create a new folder (ideally with the same name)

I then had to give sc-download read/write so that my other apps could use it (like Download Station/Radarr/Sonarr)

Re: Permissions for SABnzbd 3.3.1-49 on DSM7

Posted: September 6th, 2021, 10:47 pm
by houndtt
Hey, thanks for the feedback. I'm not sure that is the solution. I tried the same thing with a sample movie in Radarr (20210708-15) and got a similar error:

Code: Select all

Couldn't import movie /volume1/downloads/complete/Movies/No_Time_to_Die_1958_DVDRip_XviD/4d53ff5fbe6a5c2989615ccbc0d9f021.avi: Access to the path '/volume1/downloads/complete/Movies/No_Time_to_Die_1958_DVDRip_XviD/4d53ff5fbe6a5c2989615ccbc0d9f021.avi' is denied.
Now when I examine the parent folder the permissions seem good:

Code: Select all

ls -ld /volume1/downloads/complete/Movies/
drwxrwxrwx+ 1 sc-sabnzbd sabnzbd 92 Sep  6 23:22 /volume1/downloads/complete/Movies/

synoacltool -get /volume1/downloads/complete/Movies/
ACL version: 1 
Archive: is_inherit,is_support_ACL 
Owner: [sc-sabnzbd(user)] 
--------------------- 
	 [0] user:sc-sabnzbd:allow:rwxpdDaARWc--:fd-- (level:2)
	 [1] group:sc-download:allow:rwxpdDaARWc--:fd-- (level:2)
	 [2] group:administrators:allow:rwxpdDaARWc--:fd-- (level:2)
	 [3] user:sc-transmission:allow:rwxpdDaARWc--:fd-- (level:2)
However when I compare this to the folder that SABnzbd created on successfully completing the download I see these permissions:

Code: Select all

ls -ld /volume1/downloads/complete/Movies/No_Time_to_Die_1958_DVDRip_XviD/
drwxr-xr-x 1 sc-sabnzbd sabnzbd 72 Sep  6 23:17 /volume1/downloads/complete/Movies/No_Time_to_Die_1958_DVDRip_XviD/

synoacltool -get /volume1/downloads/complete/Movies/No_Time_to_Die_1958_DVDRip_XviD/
(synoacltool.c, 489)It's Linux mode
In this second set of permissions you can see that the file is able to be read because of the read-only permission assigned to everyone but it can't be cleaned up by Radarr without the write permission. Is there a way to change the group that SABnzbd assigns to newly completed downloads?

Re: Permissions for SABnzbd 3.3.1-49 on DSM7

Posted: September 7th, 2021, 4:08 am
by houndtt
I took another look at the permissions and I found a workaround. Setting the Permissions for completed downloads to '777' allowed the downloads to complete and for Lidarr to pick up the files and manage the sorting and deletion.

If anyone needs to use this workaround the configuration is at Config > Folders and check the Advanced Settings box.

Re: Permissions for SABnzbd 3.3.1-49 on DSM7

Posted: September 7th, 2021, 6:09 am
by safihre
Just as a remark: the 777 setting is the default setting or new installations of the DSM package.

Re: Permissions for SABnzbd 3.3.1-49 on DSM7

Posted: September 9th, 2021, 2:11 pm
by houndtt
safihre wrote: September 7th, 2021, 6:09 am Just as a remark: the 777 setting is the default setting or new installations of the DSM package.
Hey @safihre, thanks for jumping in on this conversation. I did a few more tests in a virtual DSM and could not replicate this. By default the new installation of SABnzbd 3.3.1-49 has no default setting in the config file and the following screenshot (both show below):

Code: Select all

sudo cat /volume1/@appdata/sabnzbd/config.ini
__version__ = 19
__encoding__ = utf-8
[misc]
permissions = ""
auto_browser = 0
host = 0.0.0.0
port = 8080
nice = -n15
ionice = -c2 -n4
download_dir = /volume1/downloads/incomplete
complete_dir = /volume1/downloads/complete
dirscan_dir = /volume1/downloads/watch
script_dir = /volume1/@appdata/sabnzbd/scripts
pre_script = None
[---snip---]
Image

I have to manually change it to '777' at which point Lidarr is able to successfully delete the downloaded files after they are processed. In fact, even with '777' set, the extracted folder does not have the full '777' permission since the properties look like this:

Image

With this configuration, the files are successfully deleted by Lidarr but the parent folder is not removed because 'Delete' is missing. To workaround this, I added Lidarr with full read/write access at the grandparent level for folder permissions that look like this:

Image

I don't know if this can be reviewed by the team but if correct, we should update the documentation for DSM7 here: https://github.com/SynoCommunity/spksrc ... Management

Re: Permissions for SABnzbd 3.3.1-49 on DSM7

Posted: September 9th, 2021, 3:13 pm
by safihre

Re: Permissions for SABnzbd 3.3.1-49 on DSM7

Posted: October 23rd, 2021, 1:06 pm
by lordabdul
Hey here, I ran into that same issue this week after upgrading to DSM7 and installing a fresh SABnzbd package (I didn't have it install prior to the upgrade). Sonarr/Radarr/Lidarr/etc were all having permissions issues and were therefore unable to move and rename the downloaded files. Setting SABnzbd's "complete" directory permissions to 777 manually in the options solved it, so I guess either the SynoCommunity package is not up to date, or there's some other package installation issue.