You are not logged in.

#1 2013-02-28 06:57:33

ridley
Member
Registered: 2004-03-05
Posts: 19

Sabnzbd and transmission can't write to directory [solved]

After a recent update, sabnzbd is unable to write files to its directory.

When I start sabnzbd, I get an error saying that it can't create a directory

# systemctl status sabnzbd
sabnzbd.service - SABnzbd binary newsreader
          Loaded: loaded (/usr/lib/systemd/system/sabnzbd.service; enabled)
          Active: active (running) since Thu 2013-02-28 01:23:19 EST; 4s ago
        Main PID: 13203 (python2)
          CGroup: name=systemd:/system/sabnzbd.service
                  `-13203 python2 /opt/sabnzbd/SABnzbd.py -l0

Feb 28 01:23:19 server systemd[1]: Starting SABnzbd binary newsreader...
Feb 28 01:23:19 server systemd[1]: Started SABnzbd binary newsreader.
Feb 28 01:23:20 server sh[13203]: 2013-02-28 01:23:20,467::ERROR::[misc:366] Cannot create directory /home/net/Data/Download/sabnzb/incomplete
Feb 28 01:23:20 server sh[13203]: 2013-02-28 01:23:20,470::ERROR::[misc:366] Cannot create directory /home/net/Data/Download/sabnzb/incomplete
Feb 28 01:23:20 server sh[13203]: 2013-02-28 01:23:20,472::ERROR::[misc:1345] Cannot change permissions of /home/net/Data/Download/sabnzb/incomplete
Feb 28 01:23:20 server sh[13203]: 2013-02-28 01:23:20,475::ERROR::[misc:366] Cannot create directory /home/net/Data/Download/sabnzb/nzb
Feb 28 01:23:20 server sh[13203]: 2013-02-28 01:23:20,479::ERROR::[misc:366] Cannot create directory /home/net/Data/Download/sabnzb/incomplete

It seems like a permissions issue, but I can't seems to get a handle on it.

I have chowned  /home/net/Data/Download/sabnzb/ to sabnzbd:sabnzbd
chmod and umask to 777
Set the permisions in the UI to 777

All the latest chatter on the AUR package page is about systemd, which I (as far as I know) is not the issue and wiki page is flagged as out of date. Most of the wiki page is about getting it to run as a different user anyway, and I had this running just fine as the default user.

I recently moved my install to a bigger hard drive, so this may be related to that, rather than the upgraded package.

If anyone could point me in the right direction, I would appreciate it.

Last edited by ridley (2013-03-09 22:42:07)


this space for rent

Offline

#2 2013-03-02 00:25:57

ridley
Member
Registered: 2004-03-05
Posts: 19

Re: Sabnzbd and transmission can't write to directory [solved]

OK now it is happening with transmission too. What  else controls the permissions of a directory?
I can still edit and make files and folders over ssh and smb, but these programs cannot. Why would some programs have access and not others?

Last edited by ridley (2013-03-02 00:29:52)


this space for rent

Offline

#3 2013-03-02 01:09:56

Beg
Member
Registered: 2013-02-24
Posts: 18

Re: Sabnzbd and transmission can't write to directory [solved]

It depends if they are run by the same user.
If not check if your home/<user> map is owned by you, also you could try.

chown -r sabnzbd:sabnzbd /home/net

This will recursivly set all maps to be owned by sabnzbd.

I'm sorry if I make little sense, I'm just bad at explaining.

Last edited by Beg (2013-03-02 01:11:01)

Offline

#4 2013-03-02 16:51:56

ridley
Member
Registered: 2004-03-05
Posts: 19

Re: Sabnzbd and transmission can't write to directory [solved]

I took Beg's advice and looked at the ownership of the home directory. Turns out that everything was owned by root:root, but the permissions were wide open.

drwxrwxrwx 46 net  users  4096 Jan  5 15:30 Audiobook
drwxrwxrwx 13 root root   4096 Feb 24 22:39 Backup
drwxrwxrwx 13 root root   4096 Feb 24 16:42 Documents
drwxrwxrwx 16 root root   4096 Feb 24 16:50 Download
drwxrwxrwx 25 root root   4096 Feb 24 16:59 Ebook
drwxrwxrwx 53 root root  12288 Mar  2 10:02 Incoming
drwxrwxrwx 67 root root   4096 Feb 17 17:22 Movie
drwxrwxrwx 36 root root   4096 Nov 18 17:38 Music
drwxrwxrwx  7 root root   4096 Apr  8  2012 Pictures
drwxrwxrwx 59 root root   4096 Feb 19 19:54 TV

so I chowned it (recursively) to net:users.
Then I chrooted the download directory to sabnzbd:sabnzbd

I looked at sabnzbd.service and it is running it as sabnzbd:sabnzbd

[Unit]
Description=SABnzbd binary newsreader
After=network.target

[Service]
Type=simple
ExecStart=/bin/sh -c "python2 /opt/sabnzbd/SABnzbd.py -l0"
User=sabnzbd
Group=sabnzbd

[Install]
WantedBy=multi-user.target

But when I try to

[root@server ~]# systemctl restart sabnzbd
[root@server ~]# systemctl status sabnzbd
sabnzbd.service - SABnzbd binary newsreader
          Loaded: loaded (/usr/lib/systemd/system/sabnzbd.service; enabled)
          Active: active (running) since Sat 2013-03-02 11:42:55 EST; 5s ago
        Main PID: 10578 (python2)
          CGroup: name=systemd:/system/sabnzbd.service
                  `-10578 python2 /opt/sabnzbd/SABnzbd.py -l0

Mar 02 11:42:55 server systemd[1]: Starting SABnzbd binary newsreader...
Mar 02 11:42:55 server systemd[1]: Started SABnzbd binary newsreader.
Mar 02 11:42:55 server sh[10297]: 2013-03-02 11:42:55,463::WARNING::[__init__:169] Signal 15 caught, saving and exiting...
Mar 02 11:42:56 server sh[10578]: 2013-03-02 11:42:56,885::ERROR::[misc:366] Cannot create directory /home/net/Data/Download/sabnzb/incomplete
Mar 02 11:42:56 server sh[10578]: 2013-03-02 11:42:56,888::ERROR::[misc:366] Cannot create directory /home/net/Data/Download/sabnzb/incomplete
Mar 02 11:42:56 server sh[10578]: 2013-03-02 11:42:56,889::ERROR::[misc:1345] Cannot change permissions of /home/net/Data/Download/sabnzb/incomplete
Mar 02 11:42:56 server sh[10578]: 2013-03-02 11:42:56,891::ERROR::[misc:366] Cannot create directory /home/net/Data/Download/sabnzb/nzb
Mar 02 11:42:56 server sh[10578]: 2013-03-02 11:42:56,893::ERROR::[misc:366] Cannot create directory /home/net/Data/Download/sabnzb/incomplete

I still get the same error

I tried running the program as user 'net' and had the same problem
Transmission has the same error as well

 Couldn't create "/home/net/Data/Incoming": Permission denied (fdlimit.c:348)

So permissions are wide open and owned by the proper users, but sabnzbd and transmission can't write, but samba can.

What does that mean?


this space for rent

Offline

#5 2013-03-02 23:42:21

Beg
Member
Registered: 2013-02-24
Posts: 18

Re: Sabnzbd and transmission can't write to directory [solved]

What does return?

ls -lR /home/net/ | grep root

Last edited by Beg (2013-03-02 23:42:41)

Offline

#6 2013-03-03 02:37:28

ridley
Member
Registered: 2004-03-05
Posts: 19

Re: Sabnzbd and transmission can't write to directory [solved]

Beg wrote:

What does return?

ls -lR /home/net/ | grep root
ls -lR /home/net/ | grep root
-rw-r--r-- 1 root root  46462304 Mar  2 20:57 cpfmf
-rw-r--r-- 1 root root  24019611 Mar  2 21:34 cpfmfp
-rw-r--r-- 1 root root  17224004 Mar  2 21:34 cpfmfx
-rw-r--r-- 1 root root  54398347 Mar  2 20:57 cphdf
-rwxrwxrwx 1 net users  123 May 29  2006 root.png
-rwxrwxrwx 1 net users   7626 Jun 10  2008 root2art_dark_background_bitmap.gif
-rwxrwxrwx 1 net users  123 May 29  2006 root.png
-rwxrwxrwx 1 net users  978414 Aug 11  2011 z4root.1.3.0.apk
-rwxrwxrwx 1 net users  978414 Dec 21  2010 z4root.1.3.0.apk

Those first nonsense files are probably encrypted files from my backup program. The rest is just files that happen to have the word "root" in them


this space for rent

Offline

#7 2013-03-03 12:34:37

Beg
Member
Registered: 2013-02-24
Posts: 18

Re: Sabnzbd and transmission can't write to directory [solved]

I have no clue then mate, I'm sorry. I'm to new to linux. I tried helping my best.

Offline

#8 2013-03-03 13:13:53

Spider.007
Member
Registered: 2004-06-20
Posts: 1,166

Re: Sabnzbd and transmission can't write to directory [solved]

Wow you are seriously screwing up you permissions here! Anyway, could you post the output from `stat /home/net/Data/Download/sabnzb/ /home/net/Data/Download/sabnzb/incomplete`? Also, the fdlimit seems to indicate that its not a permission problem; but actually related to ulimit, could you post the output from `ulimit -a` too?

Offline

#9 2013-03-03 20:45:20

ridley
Member
Registered: 2004-03-05
Posts: 19

Re: Sabnzbd and transmission can't write to directory [solved]

For some reason, /home/net was owned by root - once I changed that, sabnzbd and transmission were able to write to those directories again.

Spider.007 wrote:

Wow you are seriously screwing up you permissions here!

I knew I was thrashing around, but it was a last-ditch effort before I just re-installed the whole thing. What have I done wrong?

Spider.007 wrote:

Anyway, could you post the output from `stat /home/net/Data/Download/sabnzb/ /home/net/Data/Download/sabnzb/incomplete`?

[root@server ~]# stat /home/net/Data/Download/sabnzb/
  File: '/home/net/Data/Download/sabnzb/'
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 806h/2054d      Inode: 49938894    Links: 6
Access: (0777/drwxrwxrwx)  Uid: (  998/ sabnzbd)   Gid: (  998/ sabnzbd)
Access: 2013-03-02 23:35:52.290984219 -0500
Modify: 2013-03-02 23:02:49.856426389 -0500
Change: 2013-03-02 23:02:49.856426389 -0500
 Birth: -
[root@server ~]# stat /home/net/Data/Download/sabnzb/incomplete/
  File: '/home/net/Data/Download/sabnzb/incomplete/'
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 806h/2054d      Inode: 49938910    Links: 2
Access: (0777/drwxrwxrwx)  Uid: (  998/ sabnzbd)   Gid: (  998/ sabnzbd)
Access: 2013-03-03 00:07:36.311429362 -0500
Modify: 2013-03-03 00:25:49.954948394 -0500
Change: 2013-03-03 06:39:58.884148332 -0500
 Birth: -
Spider.007 wrote:

Also, the fdlimit seems to indicate that its not a permission problem; but actually related to ulimit, could you post the output from `ulimit -a` too?

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 20
file size               (blocks, -f) unlimited
pending signals                 (-i) 7956
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 7956
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

I don't know if it is related, but I added these lines to /etc/sysctl.conf

#Watch more files for Crashplan
fs.inotify.max_user_watches=1048576

#Transmission asked for this
net.core.rmem_max = 4194304e

How badly did I screw up my permissions?


this space for rent

Offline

#10 2013-03-03 20:46:01

ridley
Member
Registered: 2004-03-05
Posts: 19

Re: Sabnzbd and transmission can't write to directory [solved]

Beg wrote:

I have no clue then mate, I'm sorry. I'm to new to linux. I tried helping my best.

I appreciate you taking the time!


this space for rent

Offline

Board footer

Powered by FluxBB