SABnzbd 1.0 and "500 Internal Server Error"

Status
Not open for further replies.

RoadHazard

Explorer
Joined
Nov 29, 2015
Messages
83
Right after upgrading SABnzbd to 1.0, I get now get '500 Internal Server Error' when clicking some of the top-row menu links, such as Status or Config. Here's the full message:

Code:
The server encountered an unexpected condition which prevented it from fulfilling the request.
Traceback (most recent call last):
File "/usr/pbi/sabnzbd-amd64/share/sabnzbdplus/cherrypy/_cprequest.py", line 670, in respond response.body = self.handler()
File "/usr/pbi/sabnzbd-amd64/share/sabnzbdplus/cherrypy/lib/encoding.py", line 217, in __call__ self.body = self.oldhandler(*args, **kwargs)
File "/usr/pbi/sabnzbd-amd64/share/sabnzbdplus/cherrypy/_cpdispatch.py", line 61, in __call__ return self.callable(*self.args, **self.kwargs)
File "/usr/pbi/sabnzbd-amd64/lib/python2.7/site-packages/sabnzbd/interface.py", line 2455, in index header['folders'] = [xml_name(item) for item in sabnzbd.nzbqueue.scan_jobs(all=False, action=False)]
File "/usr/pbi/sabnzbd-amd64/lib/python2.7/site-packages/sabnzbd/decorators.py", line 43, in call_func return func(*params, **kparams)
File "/usr/pbi/sabnzbd-amd64/lib/python2.7/site-packages/sabnzbd/decorators.py", line 31, in newFunction
return f(*args, **kw)
File "/usr/pbi/sabnzbd-amd64/lib/python2.7/site-packages/sabnzbd/nzbqueue.py", line 1044, in scan_jobs
return NzbQueue.do.scan_jobs(all, action)
File "/usr/pbi/sabnzbd-amd64/lib/python2.7/site-packages/sabnzbd/nzbqueue.py", line 154, in scan_jobs
if os.path.isdir(folder) and name not in registered and name not in IGNORED_FOLDERS:
File "/usr/pbi/sabnzbd-amd64/lib/python2.7/genericpath.py", line 41, in isdir st = os.stat(s)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 28-31: ordinal not in range(128)


I'm running FreeNAS-9.3-STABLE-201602031011.
So... what did I do wrong?
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
not sure, I'd ask on the sabnzbd forum if they know what could cause this. or you could replace the plugin installed, if you have other plugins installed to that jail you could delete sabnzbd and reupload the latest pbi.
 

RoadHazard

Explorer
Joined
Nov 29, 2015
Messages
83
not sure, I'd ask on the sabnzbd forum if they know what could cause this. or you could replace the plugin installed, if you have other plugins installed to that jail you could delete sabnzbd and reupload the latest pbi.

Am currently discussing this over at the SABnzbd forum. No solution so far...
In the interim, SABnzbd 1.0.1 just came out, so I installed that, but it doesn't change anything for me.
 

RoadHazard

Explorer
Joined
Nov 29, 2015
Messages
83
Progress! The smart minds over at the SABnzbd forum have tracked the problem down to LANG settings. Specifically, SABnzbd wants to see "LANG=en_US.utf8" (or any other UTF-8 language encoding), but my FreeNAS jail is apparently set to "US-ASCII" by default.

So my new question is, how do I set LANG= to what SABnzbd wants? Or better still, how do I permanently change it, or at least make it auto-start with the right setting?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Progress! The smart minds over at the SABnzbd forum have tracked the problem down to LANG settings. Specifically, SABnzbd wants to see "LANG=en_US.utf8" (or any other UTF-8 language encoding), but my FreeNAS jail is apparently set to "US-ASCII" by default.

So my new question is, how do I set LANG= to what SABnzbd wants? Or better still, how do I permanently change it, or at least make it auto-start with the right setting?
edit /usr/local/etc/rc.d/sabnzbd add the lang to the prestart routine. is this required? if so I can add it
 

RoadHazard

Explorer
Joined
Nov 29, 2015
Messages
83
edit /usr/local/etc/rc.d/sabnzbd add the lang to the prestart routine. is this required? if so I can add it

Could you please? I'm happy to edit the file myself... if I knew what/where to add.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
wondering why it hasn't affected anyone else?

can you try adding
export LC_CTYPE="en_US.UTF-8"
into the prestart routine?
 

RoadHazard

Explorer
Joined
Nov 29, 2015
Messages
83
wondering why it hasn't affected anyone else?
All the time. Once we figure out why mine went south, we can theorize why it has/hasn't affected other systems. Maybe I'm just an early adopter trendsetter!

can you try adding
export LC_CTYPE="en_US.UTF-8"
into the prestart routine?

Sorry, but you'll have to hold my hand a little more than that. I modified the sabnzbd file a few times, adding the extra declaration where I thought it should go, but nothing worked. Give me a line number or an example snippet, and I'm happy to be the unskilled typist. ;-)
 

RoadHazard

Explorer
Joined
Nov 29, 2015
Messages
83
Well, screw it. I just nuked the whole jail, reinstalled SABnzbd 1.0.1 from scratch, and of course it works perfectly now. I guess we'll never know why my particular installation choked on the text encoding, but since nobody else seemed to be having the same problem, I figured there's no point in troubleshooting it any further. Thanks, everyone, for the help thus far. Chalk it up to a random hiccup.
 

RoadHazard

Explorer
Joined
Nov 29, 2015
Messages
83
I spoke too soon. The fresh install did work, but only because the configuration options were all reset to their defaults. Once I started changing a few basic options, SABnzbd failed again in exactly the same way as before.

Specifically, once I changed any of the three download directories (complete, incomplete, and watched) to the ones I wanted, it failed again. Turns out the problem was the presence of a file with Japanese-language characters in the filename located in one of my download directories. Once I deleted the offending file (which was a chore in itself), SABnzbd was happy again. So I think I'm back to the original problem: SABnzbd doesn't like finding non-English characters in an English-language installation. I'm not smart enough to permanently change the language encoding settings... and I'm a little mystified why no one else has stumbled across this problem, since my installation is bone-stock as far as I can tell.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I spoke too soon. The fresh install did work, but only because the configuration options were all reset to their defaults. Once I started changing a few basic options, SABnzbd failed again in exactly the same way as before.

Specifically, once I changed any of the three download directories (complete, incomplete, and watched) to the ones I wanted, it failed again. Turns out the problem was the presence of a file with Japanese-language characters in the filename located in one of my download directories. Once I deleted the offending file (which was a chore in itself), SABnzbd was happy again. So I think I'm back to the original problem: SABnzbd doesn't like finding non-English characters in an English-language installation. I'm not smart enough to permanently change the language encoding settings... and I'm a little mystified why no one else has stumbled across this problem, since my installation is bone-stock as far as I can tell.
I'll put this on my todo list to investigate. Looks like we might need to set UTF-8 encoding to get this to work.
 
Status
Not open for further replies.
Top