SAB can't create folders on NAS connected to RPi

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
CdeP2007
Newbie
Newbie
Posts: 2
Joined: December 13th, 2013, 11:47 pm

SAB can't create folders on NAS connected to RPi

Post by CdeP2007 »

Hi, first post on the forum, let me know if you need any more info about my issue and thanks in advance for helping!

I am trying to setup a Raspberry Pi running the latest Raspbian as a headless Usenet downloader with SABnzbdplus, Sick Beard, and Couch Potato. I want SAB to download files to a WD My Cloud NAS drive, and I am setting it all up using my MacBook Pro running OSX Mavericks (i.e. ssh-ing into RPi). I am following the directions from HowToGeek.com at http://www.howtogeek.com/142249/ for SAB and http://www.howtogeek.com/139433/how-to- ... ge-device/ for mounting the drive. As such, I made a directory in the home folder called "WDMyCloud" and edited the /etc/fstab file to add:
//10.0.0.xx/Videos /home/pi/WDMyCloud cifs guest 0 0
It seems to be mounting properly and has permissions:
drwxr-xr-x 2 root root 0 Dec 13 19:23 WDMyCloud
I installed SABnzbd using

Code: Select all

sudo apt-get install sabnzbdplus
ran it, entered my Usenet info, and set it to be viewable by any PC on my network. I then installed unrar and set SAB to start on boot by setting USER=pi in /etc/default/sabnzbdplus.

My problem is this: When trying to set the temporary download folder in the WebUI it keeps giving me the following error:
Incorrect parameter
Cannot create download_dir folder /home/pi/WDMyCloud/SABnzbd/incomplete
I'm sure the path is correct and that the drive is mounted. I tried setting the download folder to /home/pi/Desktop/SABnzbd/incomplete and it had no issues. I then mounted a flash drive to the pi (thinking it was a NAS mounting problem) and tried setting the folder there, but got the same error. I was thinking it was a permissions issue, so I went back to /etc/default/sabnzbdplus and set USER=root, but get the same problem.

Here's what I get when I run

Code: Select all

sh -x /etc/init.d/sabnzbdplus start

Code: Select all

+ DAEMON=/usr/bin/sabnzbdplus
+ SETTINGS=/etc/default/sabnzbdplus
+ [ -x /usr/bin/sabnzbdplus ]
+ [ -r /etc/default/sabnzbdplus ]
+ DESC=SABnzbd+ binary newsgrabber
+ DEFOPTS=--daemon
+ sed -n 1s/^#\!\([a-z0-9\.\/]\+\)\(.*\)/\1(\2)?/p /usr/bin/sabnzbdplus
+ PYTHONEXEC=^/usr/bin/python( -OO)?
+ PIDFILE=/var/run/sabnzbdplus.pid
+ SETTINGS_LOADED=FALSE
+ unset USER CONFIG HOST PORT EXTRAOPTS
+ . /lib/lsb/init-functions
+ run-parts --lsbsysinit --list /lib/lsb/init-functions.d
+ [ -r /lib/lsb/init-functions.d/20-left-info-blocks ]
+ . /lib/lsb/init-functions.d/20-left-info-blocks
+ FANCYTTY=
+ [ -e /etc/lsb-base-logging.sh ]
+ true
+ start_sab
+ load_settings
+ [ FALSE != TRUE ]
+ . /etc/default/sabnzbdplus
+ USER=root
+ CONFIG=
+ HOST=
+ PORT=
+ EXTRAOPTS=
+ [ -z root ]
+ [ -z root ]
+ OPTIONS=--daemon
+ [ -n  ]
+ [ -n  ]
+ SERVER=
+ [ -n  ]
+ [ -n  ]
+ [ -n  ]
+ SETTINGS_LOADED=TRUE
+ return 0
+ is_running
+ pgrep -f -x -u root ^/usr/bin/python( -OO)? /usr/bin/sabnzbdplus --daemon.*
+ PID=
+ RET=1
+ [ 1 -gt 1 ]
+ return 1
+ log_daemon_msg Starting SABnzbd+ binary newsgrabber
+ [ -z Starting SABnzbd+ binary newsgrabber ]
+ log_daemon_msg_pre Starting SABnzbd+ binary newsgrabber
+ log_use_fancy_output
+ TPUT=/usr/bin/tput
+ EXPR=/usr/bin/expr
+ [ -t 1 ]
+ [ xxterm-256color != x ]
+ [ xxterm-256color != xdumb ]
+ [ -x /usr/bin/tput ]
+ [ -x /usr/bin/expr ]
+ /usr/bin/tput hpa 60
+ /usr/bin/tput setaf 1
+ [ -z ]
+ FANCYTTY=1
+ true
+ /bin/echo -n [....] 
[....] + [ -z  ]
+ /bin/echo -n Starting SABnzbd+ binary newsgrabber:
Starting SABnzbd+ binary newsgrabber:+ return
+ start-stop-daemon --quiet --chuid root --start --exec /usr/bin/sabnzbdplus -- --daemon
start-stop-daemon: unable to set gid to 0 (Operation not permitted)
+ check_retval
+ [ 2 -eq 0 ]
+ log_end_msg 1
+ [ -z 1 ]
+ local retval
+ retval=1
+ log_end_msg_pre 1
+ log_use_fancy_output
+ TPUT=/usr/bin/tput
+ EXPR=/usr/bin/expr
+ [ -t 1 ]
+ [ xxterm-256color != x ]
+ [ xxterm-256color != xdumb ]
+ [ -x /usr/bin/tput ]
+ [ -x /usr/bin/expr ]
+ /usr/bin/tput hpa 60
+ /usr/bin/tput setaf 1
+ [ -z 1 ]
+ true
+ true
+ /usr/bin/tput setaf 1
+ RED=
+ /usr/bin/tput setaf 2
+ GREEN=
+ /usr/bin/tput setaf 3
+ YELLOW=
+ /usr/bin/tput op
+ NORMAL=
+ /usr/bin/tput civis
+ /usr/bin/tput sc
+ /usr/bin/tput hpa 0
+ [ 1 -eq 0 ]
+ [ 1 -eq 255 ]
+ /bin/echo -ne [FAIL
[FAIL+ /usr/bin/tput rc
+ /usr/bin/tput cnorm
+ log_use_fancy_output
+ TPUT=/usr/bin/tput
+ EXPR=/usr/bin/expr
+ [ -t 1 ]
+ [ xxterm-256color != x ]
+ [ xxterm-256color != xdumb ]
+ [ -x /usr/bin/tput ]
+ [ -x /usr/bin/expr ]
+ /usr/bin/tput hpa 60
+ /usr/bin/tput setaf 1
+ [ -z 1 ]
+ true
+ true
+ /usr/bin/tput setaf 1
+ RED=
+ /usr/bin/tput setaf 3
+ YELLOW=
+ /usr/bin/tput op
+ NORMAL=
+ [ 1 -eq 0 ]
+ [ 1 -eq 255 ]
+ /bin/echo -e  failed!
 failed!
+ log_end_msg_post 1
+ :
+ return 1
+ exit 1
Any idea what I'm doing wrong? How do I get SAB to be able to write to the drive?
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: SAB can't create folders on NAS connected to RPi

Post by sander »

"drwxr-xr-x 2 root root 0 Dec 13 19:23 WDMyCloud" means that only root can write. But you're running SABnzbd as the user "pi". So that's not going to work.

What if you run SABnzbd as user root?
User avatar
jcfp
Release Testers
Release Testers
Posts: 1032
Joined: February 7th, 2008, 12:45 pm

Re: SAB can't create folders on NAS connected to RPi

Post by jcfp »

sander wrote:"drwxr-xr-x 2 root root 0 Dec 13 19:23 WDMyCloud" means that only root can write.
+1. Probably want to add an option in fstab to set ownership of the cifs mount (guest,uid=pi ? Don't use smb/cifs myself but it's something like this)
sander wrote:What if you run SABnzbd as user root?
Although this is generally a very bad idea, he was trying to do that. Unfortunately for him, self-levitation (running an init script as a normal user yet expecting it to start some program as root) doesn't work in linux:
[...]
+ start_sab
+ load_settings
[...]
+ . /etc/default/sabnzbdplus
+ USER=root
[...]
+ /bin/echo -n Starting SABnzbd+ binary newsgrabber:
Starting SABnzbd+ binary newsgrabber:+ return
+ start-stop-daemon --quiet --chuid root --start --exec /usr/bin/sabnzbdplus -- --daemon
start-stop-daemon: unable to set gid to 0 (Operation not permitted)
[...]
In short: fix the cifs mount, best configure programs that do not need privileges (like sabnzbd) to start under a non-root user, but always invoke init scripts as root.
CdeP2007
Newbie
Newbie
Posts: 2
Joined: December 13th, 2013, 11:47 pm

Re: SAB can't create folders on NAS connected to RPi

Post by CdeP2007 »

In short: fix the cifs mount, best configure programs that do not need privileges (like sabnzbd) to start under a non-root user, but always invoke init scripts as root.
Thanks for the fast replies you guys. I'm too much of a noob to be able to do what you said--can you explain it?
Post Reply