Sabnzbd permissions problem

Status
Not open for further replies.

Amir2

Cadet
Joined
Mar 8, 2015
Messages
6
Hey so this is my first time using Freenas so there's a bit of a learning curve for me. I've set up a Freenas box, and using parts of Josh Ruehlig guide i've managed to install the plugins to sab, mylar, couchpotato, and sonarr all within one jail. All configured and they seem to be working accept for the permissions part. Whenever i start sab it always starts up with this error,
Cannot change permissions of /mnt/media1/downloads/sabnzbd/incomplete
I have created a user and group within freenas called media, that has a group id of 816. I've also created a dataset called media1, changed its user/group owner to the media group i made in its permission option menu, and mounted it into the jail at /mnt/media1 and i can confirm it is added to the jail as i can see it through ssh. I've tried giving it permissions through
chown -R media:media /mnt/media1
However this doesn't seem to help. Running the command ls -l on /mnt outputs this
root@sabnzbd_1:/mnt # ls -l
total 1
drwxrwxr-x+ 6 media media 6 Mar 8 04:22 media1
drwxr-xr-x 2 root wheel 2 Mar 8 00:33 media2 (old dataset that i removed)
at this point, im pretty stuck and any help would be appreciated

Quick Edit
I have media that i have stored in the /media1 dataset that i have been able to successfully import into both couchpotato and sonarr, so im not sure if thats an important detail. The problem seems to be that sab is unable to write to my media1 dataset although im unsure if the other plugins have the same problem
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
it looks like everything under /mnt/media1 should be writable by sabnzbd
can you show the below
Code:
ls -l /mnt/media1


also did you happen to check Windows permissions on your media dataset?
 

Amir2

Cadet
Joined
Mar 8, 2015
Messages
6
Here's what it outputs,
drwxrwxr-x+ 215 media media 215 Mar 8 04:37 Comics
drwxrwxr-x+ 178 media media 178 Mar 7 11:51 Movies
drwxrwxr-x+ 25 media media 25 Mar 7 22:34 TV
drwxrwxr-x+ 3 media media 3 Mar 7 00:16 downloads

Yes when i first setup the dataset i set permissions for windows, however i have changed permisssions back to unix when i gave ownership to the media user
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Here's what it outputs,


Yes when i first setup the dataset i set permissions for windows, however i have changed permisssions back to unix when i gave ownership to the media user
Well sabnzbd shouldn't have permission problems changing those files? I'm not sure what the problem is here.
 

Amir2

Cadet
Joined
Mar 8, 2015
Messages
6
Huh thats weird, i've been playing around with this for a couple days now, no matter what i do i cant get write permission. Should i just nuke it and start over then
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Huh thats weird, i've been playing around with this for a couple days now, no matter what i do i cant get write permission. Should i just nuke it and start over then
no reason to nuke it yet, jails are free. just install a second sab instance, second download dataset (don;t enable windows this time) and see if it works.
 

Amir2

Cadet
Joined
Mar 8, 2015
Messages
6
Okay i think i have it narrowed down a little bit. I reset my install back to its default boot dataset whatever you call it. I then went through and redid all the permissions thing creating media user that kinda stuff. So i found that if i didnt set permissions with sabnzbd to 777 that it i wouldnt get the error and downloads would actually download. however when the download would finish it would be unable to create a folder in the complete download section and the download/post process would fail. however setting the permission to 777 in sab i would get the error i got earlier and it appears that sab would then lose access to write to the incomplete folder. so im not sure if this is a freenas permissions problem or a sab problem
 

Amir2

Cadet
Joined
Mar 8, 2015
Messages
6
Okay building on my post above i began to suspect that my media1 dataset was the one that was giving me problems. so i went ahead and created an entirely new dataset called test and applied the owner to the user media with the uid of 816. i went through and set up a new jail with sab and sonarr and used storage to tie my test dataset into the new jail. went through and chown the test dataset in the jail to the media user. now going into sab i no longer have the error i had above on boot, and it appears that things download. However now when the download finishes, and when it tries to run PP on the file, it will error out with a permissions error saying it was unable to create a folder in the complete folder. I beleieve i still have a permission problem but now i have no idea what i would do

Ninja edit
Okay think ive found something else. It appears that the categories that you have to set in sab are the culprit. If i manually pass a nzb to sab without specifying a catagory it will successfully place the file, however if i specify the category it will error out because it is unable to create a folder in the specified catagory folder position
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Okay building on my post above i began to suspect that my media1 dataset was the one that was giving me problems. so i went ahead and created an entirely new dataset called test and applied the owner to the user media with the uid of 816. i went through and set up a new jail with sab and sonarr and used storage to tie my test dataset into the new jail. went through and chown the test dataset in the jail to the media user. now going into sab i no longer have the error i had above on boot, and it appears that things download. However now when the download finishes, and when it tries to run PP on the file, it will error out with a permissions error saying it was unable to create a folder in the complete folder. I beleieve i still have a permission problem but now i have no idea what i would do

Ninja edit
Okay think ive found something else. It appears that the categories that you have to set in sab are the culprit. If i manually pass a nzb to sab without specifying a catagory it will successfully place the file, however if i specify the category it will error out because it is unable to create a folder in the specified catagory folder position
Strange, I've never had an issue with category folder in sab, but I think I usually create them first.
 

Amir2

Cadet
Joined
Mar 8, 2015
Messages
6
So i was able to find a fix for this problem although im not a 100% sure why it works. Instead of marking in sab to set permissions to 777 i just leave it blank and everything seems to work. Putting in 777 in that setting and i get that error above. not sure why but thats what happens lol
 

Bobbyg387

Dabbler
Joined
Jan 31, 2015
Messages
32
I've been having this issue as well. I have followed the directions that Joshua posted in his thread, tried group writing, user writing and nothing. It's to the point that I'm stuck and I'm going to start over with a fresh install. I'll follow what you did here and see if it solves my issue.
 

theaddies

Contributor
Joined
Mar 28, 2015
Messages
105
I am having these same issues. I have followed Joshua's guide assiduously and thought I had things working. I then had issues with being able to delete files from Plex either within Plex or from my Amazon Fire TV. I followed the instructions here https://forums.freenas.org/index.php?threads/plex-media-and-file-permissions.20152/, which seemed to work well as I can now delete files from Plex, but now I have the exact issue in Sabnzbd of:
Cannot change permissions of /mnt/media1/downloads/sabnzbd/incomplete
It is frustrating that I seem to get one thing working and meanwhile I break something else. I am admittedly a NOOOB but also a voracious autodidact. Is there a resource that would help me to learn the intricacies of permissions in NFS and CIFS? I feel that my approach currently is somewhat haphazard. I have not tried the instruction pasted above: ls -l /mnt/media1, but will do that tonight to see if there is something obviously wrong.

Thanks in advance for the help.
Andrew
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I am having these same issues. I have followed Joshua's guide assiduously and thought I had things working. I then had issues with being able to delete files from Plex either within Plex or from my Amazon Fire TV. I followed the instructions here https://forums.freenas.org/index.php?threads/plex-media-and-file-permissions.20152/, which seemed to work well as I can now delete files from Plex, but now I have the exact issue in Sabnzbd of:
Cannot change permissions of /mnt/media1/downloads/sabnzbd/incomplete
It is frustrating that I seem to get one thing working and meanwhile I break something else. I am admittedly a NOOOB but also a voracious autodidact. Is there a resource that would help me to learn the intricacies of permissions in NFS and CIFS? I feel that my approach currently is somewhat haphazard. I have not tried the instruction pasted above: ls -l /mnt/media1, but will do that tonight to see if there is something obviously wrong.

Thanks in advance for the help.
Andrew
So you want all the downloading programs to be able to write files (1), and plex (2), and NFS/CIFS (3)?

All the tools you'd need to accomplish (1) and (2) are covered here, but you'd need to be a bit creative to satifsy both 1&2 at the same time.
https://forums.freenas.org/index.ph...plugins-write-permissions-to-your-data.27273/

As for (3), what I always to for CIFS (if it needs to be read+write), is force CIFS to run as the media user (UID=816). It might not be super straight forward to do this on FreeNAS but I know it's possible because this is what I did at a family member's home who wanted to have CIFS access.
But... I'm not a CIFS expert. There are definitely better/more secure ways to accomplish (3).
 

theaddies

Contributor
Joined
Mar 28, 2015
Messages
105
Thanks for the reply Joshua. I did a little bit more digging into this error and found that it is occurring in a sabnzb file misc.py. The error in my sabnzb log file is mentioned as
Code:
File "/usr/pbi/sabnzbd-amd64/share/sabnzbd/SABnzbd/sabnzbd/misc.py", line 1380, in set_chmod
    os.chmod(path, permissions)
OSError: [Errno 1] Operation not permitted: 

I am getting lots and lots of these errors. Looking back through the log file I didn't always get this error. Therefore, it must relate to an "improvement" I made.

The part of the file that I think is being used in misc.py is the following:
Code:
def set_chmod(path, permissions, report):
    """ Set 'permissions' on 'path', report any errors when 'report' is True
    """
    try:
        os.chmod(path, permissions)
    except:
        lpath = path.lower()
        if report and '.appledouble' not in lpath and '.ds_store' not in lpath:
            logging.error(Ta('Cannot change permissions of %s'), path)
            logging.info("Traceback: ", exc_info = True)

I don't know if this helps or not, but I thought it might. I also looked on the sabnzb forum and they referred the OP with this issue to the Synology forum. I will dig into your information above and see if I can learn more. Thanks again for the help.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Thanks for the reply Joshua. I did a little bit more digging into this error and found that it is occurring in a sabnzb file misc.py. The error in my sabnzb log file is mentioned as
Code:
File "/usr/pbi/sabnzbd-amd64/share/sabnzbd/SABnzbd/sabnzbd/misc.py", line 1380, in set_chmod
    os.chmod(path, permissions)
OSError: [Errno 1] Operation not permitted: 

I am getting lots and lots of these errors. Looking back through the log file I didn't always get this error. Therefore, it must relate to an "improvement" I made.

The part of the file that I think is being used in misc.py is the following:
Code:
def set_chmod(path, permissions, report):
    """ Set 'permissions' on 'path', report any errors when 'report' is True
    """
    try:
        os.chmod(path, permissions)
    except:
        lpath = path.lower()
        if report and '.appledouble' not in lpath and '.ds_store' not in lpath:
            logging.error(Ta('Cannot change permissions of %s'), path)
            logging.info("Traceback: ", exc_info = True)

I don't know if this helps or not, but I thought it might. I also looked on the sabnzb forum and they referred the OP with this issue to the Synology forum. I will dig into your information above and see if I can learn more. Thanks again for the help.
You're looking in the wrong direction; this is not an error in sabnzbd's code. The error is in the permissions of your download/media dataset/files relative to sabnzbd's user.

If you follow one of the solutions in the forum post I linked your problem will be solved.
 

Vinh

Dabbler
Joined
Apr 5, 2016
Messages
12
You're looking in the wrong direction; this is not an error in sabnzbd's code. The error is in the permissions of your download/media dataset/files relative to sabnzbd's user.

If you follow one of the solutions in the forum post I linked your problem will be solved.

So I am also having the same permissions issue mention in this post now as well. So i recently had to change over my hardware mobo and such and that's when the problem started. I was running 9.3 and decided to do a fresh install with 9.10. So i followed Joshua's TUT again except i didn't create a new dataset i just imported my old one. I have a user called media with UID of 816. i tried setting the DATA set to media:media and write prives for all 3. i tried creating a new user with UID 816 and change the data set over but that didn't seem to work either. downloads when finished seem to be create and move fine.

Error from Sab
2016-04-17 10:57:08,191 ERROR: Cannot change permissions of

here is the out put for ls -l for /mnt/media/dowloads/sabnzbd
Code:
drwxrwxr-x+  55 media  media       385 Apr 14 17:31 Anime
drwxrwxr-x+   6 media  media         7 Jan  3 15:43 Apps
drwxrwxr-x+  14 media  media        14 Jan 26 17:44 Books
drwxrwxr-x+   3 media  media         4 Jan  3 15:46 Misc
drwxrwxr-x+ 118 media  media       120 Apr 13 08:33 Movies
drwxrwxr-x+  84 media  media        85 Jan  3 15:47 Music
drwxrwxr-x+  67 media  media        67 Apr 17 10:57 TV
 

Vinh

Dabbler
Joined
Apr 5, 2016
Messages
12
I also notice before I would be able to SSH in and chmod -R 777 say /mnt/media/downloads/sabnzbd, but now i get operation not permitted which i find wierd.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I also notice before I would be able to SSH in and chmod -R 777 say /mnt/media/downloads/sabnzbd, but now i get operation not permitted which i find wierd.
you have windows ACLs enabled on those folders, so things are more complicated then just Unix permissions.
 

Vinh

Dabbler
Joined
Apr 5, 2016
Messages
12
you have windows ACLs enabled on those folders, so things are more complicated then just Unix permissions.
So I changed it to Unix and applied recursively for the shoe data set. Does that not remove the windows ACLs? I understand you don't use windows. But can you help me fix it or point me in the right direction?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
So I changed it to Unix and applied recursively for the shoe data set. Does that not remove the windows ACLs? I understand you don't use windows. But can you help me fix it or point me in the right direction?
ls -l /path/to/files
then check if there are "+" at the end.
 
Status
Not open for further replies.
Top