SOLVED: Permissions problems with Sabnzbd

guerilla
Posts: 65
Joined: Thu Jan 13, 2011 3:11 pm

SOLVED: Permissions problems with Sabnzbd

Postby guerilla » Wed Nov 11, 2015 1:44 am

One of another niggles i have been having since upgrading. My sabnzbdplus installation appears to be working but it is throwing a lot of errors regarding permissions of downloaded files.

An example of the error in the log:

Code: Select all

2015-11-11 03:50:34,466::ERROR::[misc:1384] Cannot change permissions of /mnt/samba/SAB/complete/TV/[redacted].mkv 2015-11-11 03:50:34,466::INFO::[misc:1385] Traceback: Traceback (most recent call last): File "/var/hda/web-apps/sabnzbdplus/html/sabnzbd/misc.py", line 1380, in set_chmod os.chmod(path, permissions) OSError: [Errno 1] Operation not permitted: '/mnt/samba/SAB/complete/TV/[redacted.mkv'
The folder /mnt/SAB is part of my greyhole share. I created this as I thought my old newsgroups share may of been conflicting with the one created by the install of sabnzbdplus giving me this problem. It appears to be independent of that though.

Code: Select all

[myuser@localhost ~]$ ls -al /mnt/samba/SAB/ total 4 drwxrwx--- 2 myuser users 0 Nov 10 22:06 . drwxr-xr-x 10 root root 4096 Nov 10 22:05 .. drwxrwx--- 2 myuser users 0 Nov 10 22:11 complete drwxrwx--- 2 myuser users 0 Nov 11 03:51 incoming
I'm a little confused as sabnzbdplus is downloading and moving the files to the appropriate places. I've tried setting permissions of downloads to 755 and 777.

User avatar
bigfoot65
Project Manager
Posts: 11297
Joined: Mon May 25, 2009 4:31 pm

Re: Permissions problems with Sabnzbd

Postby bigfoot65 » Wed Nov 11, 2015 4:53 am

The folder /mnt/SAB is part of my greyhole share. I created this as I thought my old newsgroups share may of been conflicting with the one created by the install of sabnzbdplus giving me this problem. It appears to be independent of that though.
If I am not mistaken, you cannot change the permissions of any share that is mounted using the mount_shares_locally script. It's preset by the service. I think if You manually try changing the permissions you will see it won't work.

Recommend you try the share itself in /var/hda/files and see if the issue clears up.
ßîgƒσστ65
Applications Manager

guerilla
Posts: 65
Joined: Thu Jan 13, 2011 3:11 pm

Re: Permissions problems with Sabnzbd

Postby guerilla » Wed Nov 11, 2015 5:00 am

Has there been any changes in the mount_sahre_locally script since Amahi 6.3. This is the same config that I was using with success in that version.

It was my understanding that I shouldn't put files in /var/hda/files as it was bad for greyhole? Have i misinterpreted something in the documentation? I'll admit its a while since i've looked at it.

I'll try that as a fix, it's certainly an easy one.

User avatar
bigfoot65
Project Manager
Posts: 11297
Joined: Mon May 25, 2009 4:31 pm

Re: Permissions problems with Sabnzbd

Postby bigfoot65 » Wed Nov 11, 2015 6:51 am

Has there been any changes in the mount_sahre_locally script since Amahi 6.3.
I believe so. It sets the file permissions in the service so you could change it in the script.

I would recommend you make a non-Greyhole enabled location for downloads, then move them to a share that is Greyhole enabled when they are complete. This will ensure you don't lose anything and Greyhole is not constantly updating due to the file frequent writes/changes when downloading. That is something you want to avoid and I believe the Greyhole web site advises against it.
ßîgƒσστ65
Applications Manager

guerilla
Posts: 65
Joined: Thu Jan 13, 2011 3:11 pm

Re: Permissions problems with Sabnzbd

Postby guerilla » Wed Nov 11, 2015 7:56 am

I think I misunderstand how greyhole works. I thought to get files into the greyhole pool I had to add them via locally mounted shares, i.e., /mnt/samba/TV.

If I add them to /var/hda/files/TV do they get added to the pool?

If so I think I understand the flow:

sabnzbdplus downloads the file to a temporary folder which is not in the pool. When it is complete it moved the file to a folder in the pool at /var/hda/files/TV. Greyhole then does its thing moved the file to a disk under the gh folder and created the simlink in /var/hda/files/TV. All is well. Correct?

User avatar
bigfoot65
Project Manager
Posts: 11297
Joined: Mon May 25, 2009 4:31 pm

Re: Permissions problems with Sabnzbd

Postby bigfoot65 » Wed Nov 11, 2015 9:00 am

Yes that is what I recommend. Keep in mind Greyhole may not make duplicates of the file initially if you have copies set to 1 or more. That will be done with the next fsck.

If you check out the what not to put in Greyhole shares, you will see what I meant.
ßîgƒσστ65
Applications Manager

guerilla
Posts: 65
Joined: Thu Jan 13, 2011 3:11 pm

Re: Permissions problems with Sabnzbd

Postby guerilla » Wed Nov 11, 2015 9:56 am

This is what has me confused, from https://wiki.amahi.org/index.php/Mount_Shares_Locally
Mounting your Samba shares locally is useful when you are using Greyhole, and want to write or in any way work with those files locally. Greyhole data should only be accessed through shares,

For example, your "Pictures" share would be located at /mnt/samba/Pictures. When working with files on the HDA, access them via this share and NOT the traditional /var/hda/files/pictures location
It seems someone else had a similar problem and has written a revised mount shares locally script. They haven't included the script though so I can't try it out.

As the shares are mounted as myuser:users would a simpler solution not be to have sabnzbdplus (and others) run by myuser to alleviate the problem?

on a side note I used to start/restart sabnzbd server with the command

Code: Select all

service sabnzbdplus start
in ubunut. Should i be doing something different in fedora.

User avatar
bigfoot65
Project Manager
Posts: 11297
Joined: Mon May 25, 2009 4:31 pm

Re: Permissions problems with Sabnzbd

Postby bigfoot65 » Wed Nov 11, 2015 11:18 am

We probably need to update that a bit to be clear.
You should be safe reading existing files directly, or adding new files directly, as long as don't care that your new files will only be moved into the storage pool during the next check, which runs automatically at midnight (or manually using greyhole --fsck). Until then, your new files will be stored in your shared directories (normally /var/hda/files/share_name/).
I think this is fairly clear. It's the part that I referred to before that needed to be added. I have updated the wiki to include it.
on a side note I used to start/restart sabnzbd server with the command
In Fedora its:

Code: Select all

systemctl start sabnzbd.service
BTW, is this resolved now?
ßîgƒσστ65
Applications Manager

guerilla
Posts: 65
Joined: Thu Jan 13, 2011 3:11 pm

Re: Permissions problems with Sabnzbd

Postby guerilla » Wed Nov 11, 2015 11:38 am

You should be safe reading existing files directly, or adding new files directly, as long as don't care that your new files will only be moved into the storage pool during the next check, which runs automatically at midnight (or manually using greyhole --fsck). Until then, your new files will be stored in your shared directories (normally /var/hda/files/share_name/).
This is clearer. Is this part to be removed
For example, your "Pictures" share would be located at /mnt/samba/Pictures. When working with files on the HDA, access them via this share and NOT the traditional /var/hda/files/pictures location.
If I add things to my shares but greyhole hasnt run is the file still available at /mnt/samba or will i have to wait till the end of fsck?

I've only just got home so haven't had a chance to test in the new locations.

btw is the syntax similar for starting/restarting for this script?

User avatar
bigfoot65
Project Manager
Posts: 11297
Joined: Mon May 25, 2009 4:31 pm

Re: Permissions problems with Sabnzbd

Postby bigfoot65 » Wed Nov 11, 2015 1:02 pm

Don't plan on removing anything as it's all correct.
If I add things to my shares but greyhole hasnt run is the file still available at /mnt/samba or will i have to wait till the end of fsck?
You can force the fcsk to run via command line on with the Greyhole UI application if you are using it.

Code: Select all

btw is the syntax similar for starting/restarting for this script?
I presume you mean the mount_shares_locally script and no, it's still as noted in the wiki:

Code: Select all

service mount_shares_locally restart
ßîgƒσστ65
Applications Manager

Who is online

Users browsing this forum: No registered users and 1 guest