SABnzbd fails when nzb added (iocage jail)

Status
Not open for further replies.

Laurence Milton

Dabbler
Joined
Apr 2, 2017
Messages
16
I want to upgrade to 11.2 but not until I have my plugins running in iocage instead of warden. I have successfully done this with all my plugins but I am having trouble with SABnzbd when I try and add an nzb. I get the following error:-

Code:
HTTP
Traceback (most recent call last):
  File "/usr/local/share/sabnzbdplus/cherrypy/_cprequest.py", line 663, in respond
	self.body.process()
  File "/usr/local/share/sabnzbdplus/cherrypy/_cpreqbody.py", line 989, in process
	super(RequestBody, self).process()
  File "/usr/local/share/sabnzbdplus/cherrypy/_cpreqbody.py", line 558, in process
	proc(self)
  File "/usr/local/share/sabnzbdplus/cherrypy/_cpreqbody.py", line 223, in process_multipart_form_data
	process_multipart(entity)
  File "/usr/local/share/sabnzbdplus/cherrypy/_cpreqbody.py", line 215, in process_multipart
	part.process()
  File "/usr/local/share/sabnzbdplus/cherrypy/_cpreqbody.py", line 556, in process
	self.default_proc()
  File "/usr/local/share/sabnzbdplus/cherrypy/_cpreqbody.py", line 715, in default_proc
	self.file = self.read_into_file()
  File "/usr/local/share/sabnzbdplus/cherrypy/_cpreqbody.py", line 729, in read_into_file
	fp_out = self.make_file()
  File "/usr/local/share/sabnzbdplus/cherrypy/_cpreqbody.py", line 512, in make_file
	return tempfile.TemporaryFile()
  File "/usr/local/lib/python2.7/tempfile.py", line 504, in TemporaryFile
	dir = gettempdir()
  File "/usr/local/lib/python2.7/tempfile.py", line 275, in gettempdir
	tempdir = _get_default_tempdir()
  File "/usr/local/lib/python2.7/tempfile.py", line 217, in _get_default_tempdir
	("No usable temporary directory found in %s" % dirlist))
IOError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/usr/local/share/sabnzbdplus']


If I ssh into Freenas and look for the directories mentioned in the last line above they do exist under the Root directory of the iocage jail. The directory /usr/local/share/sabnzbdplus/cherrypy also exists.

I am assuming that python is expecting one or other of these directories to be readable, writeable or both. I am not sure what permissions I need to change on which folders to get this to work?

I used the directions in this post to setup sabnzbd and my other plugins. https://forums.freenas.org/index.ph...lidarr-jackett-ombi-transmission-organizr.58/ so I am not sure why I am getting this error when no one else is.

Any assistance to resolve this would be appreciated.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
I used the directions in this post to setup sabnzbd and my other plugins. https://forums.freenas.org/index.ph...lidarr-jackett-ombi-transmission-organizr.58/ so I am not sure why I am getting this error when no one else is.

Any assistance to resolve this would be appreciated.

Add user media
pw user add media -c media -u 8675309 -d /nonexistent -s /usr/bin/nologin"
Make user:group media
chown -R media:media /mnt/torrents/sabnzbd /config

Edit sonarr in rc.d directory, usr and group to media

Make sure your data has user media and group media

I hope that works.[/CMD]
 
Last edited:

Laurence Milton

Dabbler
Joined
Apr 2, 2017
Messages
16
Thanks NasKar, I am a bit of a noob at times can you explain what I need to do for Edit sonarr in rc.d directory, usr and group to media

I am assuming you mean edit 'sabnzbd' but where do I find the rc.d directory?

thanks
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
in the sonarr jail not freenas
nano /usr/local/etc/rc.d/sabnzbd
paste this in and save.
Code:
#!/bin/sh
#
# $FreeBSD: branches/2018Q2/news/sabnzbdplus/files/sabnzbd.in 425499 2016-11-06 15:39:54Z riggs $
#
# PROVIDE: sabnzbd
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# sabnzbd_enable (bool):		Set to NO by default.
#					   Set it to YES to enable it.
# sabnzbd_conf_dir:	 Directory where sabnzbd configuration
#					   data is stored.
#					   Default: /usr/local/sabnzbd
# sabnzbd_user:		 The user account sabnzbd daemon runs as what
#					   you want it to be. It uses '_sabnzbd' user by
#					   default. Do not sets it as empty or it will run
#					   as root.
# sabnzbd_group:		The group account sabnzbd daemon runs as what
#					   you want it to be. It uses '_sabnzbd' group by
#					   default. Do not sets it as empty or it will run
#					   as wheel.
# sabnzbd_pidfile:	  Set the location of the sabnzbd pidfile

. /etc/rc.subr

name=sabnzbd
rcvar=sabnzbd_enable
load_rc_config ${name}

: ${sabnzbd_enable:=NO}
: ${sabnzbd_user:=media}
: ${sabnzbd_group:=media}
: ${sabnzbd_conf_dir="/config/sabnzbd"}
: ${sabnzbd_pidfile:="/config/sabnzbd/sabnzbd.pid"}

pidfile=${sabnzbd_pidfile}

start_precmd="${name}_prestart"
command_interpreter="/usr/local/bin/python2.7"
command="/usr/local/bin/SABnzbd.py"
command_args="--daemon -f ${sabnzbd_conf_dir}/sabnzbd.ini --pidfile ${pidfile}"

sabnzbd_prestart()
{
		PATH=${PATH}:/usr/local/bin:/usr/local/sbin
		export LC_CTYPE="en_US.UTF-8"
		for sabdir in ${sabnzbd_conf_dir} ${pidfile%/*}; do
				if [ ! -d "${sabdir}" ]; then																
						install -d -o ${sabnzbd_user} -g ${sabnzbd_group} ${sabdir}
				fi
		done
}

run_rc_command "$1"

service sabnzbd restart
 

Laurence Milton

Dabbler
Joined
Apr 2, 2017
Messages
16
Hi NasKar
Thanks for the help.
I did this in the sabnzbd jail and it didn't work. I still get the above error message when I add an nzb or when sonarr or radarr add an nzb.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
Would recommend you destroy the jail with sabnzbd and reinstall following the directions and adjust per my instructions. If you get traceback errors trying to destroy the jail then you will have to create a new jail like sabnzbd2 with a new IP and go from there. I think there is a bug that was fixed in a later version of iocage. I'm using 1.0 ALPHA in FN 11.1 U4. The only way to fix the error that I'm aware of is to wipe all iocage jails with the clean command. You would then be starting from scratch and all your iocage jails would be gone.
 

Laurence Milton

Dabbler
Joined
Apr 2, 2017
Messages
16
Thanks NasKar you gave me a good hint. I destroyed the sabnzbd jail and then recreated it in iocage 11.2-RELEASE using the original instructions. It works fine in this release. :)
 
Status
Not open for further replies.
Top