Page 1 of 1

SABnzbd not starting on Ubuntu 14.04

Posted: May 30th, 2016, 12:22 am
by petri0
Have had this installed and working a couple of years now but suddenly it fails to start. Here's the lines when I try to start it manually:

Code: Select all

~ $ sudo service sabnzbdplus restart
[sudo] password for : 
 * SABnzbd+ binary newsgrabber: not running
 * Starting SABnzbd+ binary newsgrabber                                         Traceback (most recent call last):
  File "/usr/bin/sabnzbdplus", line 86, in <module>
    import sabnzbd
  File "/usr/share/sabnzbdplus/sabnzbd/__init__.py", line 78, in <module>
    from sabnzbd.nzbqueue import NzbQueue
  File "/usr/share/sabnzbdplus/sabnzbd/nzbqueue.py", line 29, in <module>
    from sabnzbd.nzbstuff import NzbObject
  File "/usr/share/sabnzbdplus/sabnzbd/nzbstuff.py", line 48, in <module>
    from sabnzbd.misc import to_units, cat_to_opts, cat_convert, sanitize_foldername, \
  File "/usr/share/sabnzbdplus/sabnzbd/misc.py", line 44, in <module>
    import sabnzbd.config as config
  File "/usr/share/sabnzbdplus/sabnzbd/config.py", line 30, in <module>
    import configobj
ImportError: No module named configobj
                                                                         [fail]
EDIT: What have I done?

Re: SABnzbd not starting on Ubuntu 14.04

Posted: May 30th, 2016, 1:25 am
by jcfp
Looks like something wrong with the configobj module, try reinstalling that:

Code: Select all

sudo apt-get install --reinstall python-configobj

Re: SABnzbd not starting on Ubuntu 14.04

Posted: May 30th, 2016, 2:19 am
by petri0
Thank you for responding, unfortunately the error remains

Code: Select all

~ $ sudo service sabnzbdplus restart
[sudo] password for : 
 * SABnzbd+ binary newsgrabber: not running
 * Starting SABnzbd+ binary newsgrabber                                         Traceback (most recent call last):
  File "/usr/bin/sabnzbdplus", line 1893, in <module>
    main()
  File "/usr/bin/sabnzbdplus", line 1063, in main
    res, msg = config.read_config(inifile)
  File "/usr/share/sabnzbdplus/sabnzbd/decorators.py", line 31, in newFunction
    return f(*args, **kw)
  File "/usr/share/sabnzbdplus/sabnzbd/config.py", line 692, in read_config
    return _read_config(path)
  File "/usr/share/sabnzbdplus/sabnzbd/config.py", line 740, in _read_config
    CFG = configobj.ConfigObj(lines, default_encoding='cp1252', encoding='cp1252')
  File "/usr/lib/python2.7/dist-packages/configobj.py", line 1230, in __init__
    self._load(infile, configspec)
  File "/usr/lib/python2.7/dist-packages/configobj.py", line 1290, in _load
    infile = self._handle_bom(infile)
  File "/usr/lib/python2.7/dist-packages/configobj.py", line 1400, in _handle_bom
    return self._decode(infile, self.encoding)
  File "/usr/lib/python2.7/dist-packages/configobj.py", line 1497, in _decode
    infile[i] = line.decode(encoding)
LookupError: unknown encoding: cp1252
                                                                         [fail]

Re: SABnzbd not starting on Ubuntu 14.04

Posted: May 30th, 2016, 10:14 am
by sander
LookupError: unknown encoding: cp1252
... so that's a different error, isn't it?

Let's check your python setup:
Start

Code: Select all

python
and type

Code: Select all

'hello'.encode('cp1251')
Post the result here.

This is from my Ubuntu 14.04:

Code: Select all

$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 'hello'.encode('cp1251')
'hello'
>>> 

Re: SABnzbd not starting on Ubuntu 14.04

Posted: May 30th, 2016, 1:13 pm
by petri0
Yes it is different ... I was thinking about the result which was fail.

This is my result

Code: Select all

~ $ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 'hello'.encode('cp1251')
'hello'
>>>
Could this be something with my hardware? It is getting a little old and now my HDD:s have started to "disappear". I have to go to "Discs" to wake them up and to mount them. Not all of them but one Raid0 and one encrypted. I even installed another Mint 17.3 to a new partition using the same /home though and sabnzb is still failing to start. Is there something in my home partition that might causing sabnzb to fail?

Re: SABnzbd not starting on Ubuntu 14.04

Posted: May 30th, 2016, 1:44 pm
by sander
Well, the problem is outside SABnzbd, and in your Python / system setup. Not very SABnzbd related. Hopefully not an intermittent error, as those are very hard to solve.

Anyway ... as that command did NOT cause the same error, let's try this:

In python, execute these commands:

Code: Select all

import configobj
lines = "blabla\n"
CFG = configobj.ConfigObj(lines, default_encoding='cp1252', encoding='cp1252')
print CFG
Result on my Ubuntu 14.04:

Code: Select all

$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import configobj
>>> lines = "blabla\n"
>>> CFG = configobj.ConfigObj(lines, default_encoding='cp1252', encoding='cp1252')
>>> print CFG
{}
>>> 
So, no error. What does your system say?

Re: SABnzbd not starting on Ubuntu 14.04

Posted: May 30th, 2016, 3:17 pm
by petri0
That's good to know because I like SABnzbd. I wonder how did I mess up my python. Maybe following the guides for Plex in htpcguides.com


Mine looks the same as yours

Code: Select all

$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import configobj
>>> lines = "blabla\n"
>>> CFG = configobj.ConfigObj(lines, default_encoding='cp1252', encoding='cp1252')
>>> print CFG
{}
>>>

Re: SABnzbd not starting on Ubuntu 14.04

Posted: May 30th, 2016, 3:26 pm
by sander
Wow. No error. Weird.

And if you start sabnzbd, you get the error again?!

Re: SABnzbd not starting on Ubuntu 14.04

Posted: May 31st, 2016, 1:19 am
by petri0
Yes the error is still the same as last time. Now it's starting to sound like a reinstallation is needed.
EDIT: Meaning reinstall the whole OS not just SABnzbd which I have already tried to a couple of times.

Code: Select all

$ sudo service sabnzbdplus restart
[sudo] password for : 
 * SABnzbd+ binary newsgrabber: not running
 * Starting SABnzbd+ binary newsgrabber                                         Traceback (most recent call last):
  File "/usr/bin/sabnzbdplus", line 1893, in <module>
    main()
  File "/usr/bin/sabnzbdplus", line 1063, in main
    res, msg = config.read_config(inifile)
  File "/usr/share/sabnzbdplus/sabnzbd/decorators.py", line 31, in newFunction
    return f(*args, **kw)
  File "/usr/share/sabnzbdplus/sabnzbd/config.py", line 692, in read_config
    return _read_config(path)
  File "/usr/share/sabnzbdplus/sabnzbd/config.py", line 740, in _read_config
    CFG = configobj.ConfigObj(lines, default_encoding='cp1252', encoding='cp1252')
  File "/usr/lib/python2.7/dist-packages/configobj.py", line 1230, in __init__
    self._load(infile, configspec)
  File "/usr/lib/python2.7/dist-packages/configobj.py", line 1290, in _load
    infile = self._handle_bom(infile)
  File "/usr/lib/python2.7/dist-packages/configobj.py", line 1400, in _handle_bom
    return self._decode(infile, self.encoding)
  File "/usr/lib/python2.7/dist-packages/configobj.py", line 1497, in _decode
    infile[i] = line.decode(encoding)
LookupError: unknown encoding: cp1252
                                                                         [fail]

Re: SABnzbd not starting on Ubuntu 14.04

Posted: May 31st, 2016, 2:13 am
by sander
Yes, I would try that.

Re: SABnzbd not starting on Ubuntu 14.04

Posted: May 31st, 2016, 2:27 am
by petri0
It is the last resort coming too close. The funny thing is that I already installed a separate version which is using the same home partition and the trouble continues. This error message above is pointing at root folders but can there be something in my home folders that is spreading this disease because the new installation is having the same problem?

Re: SABnzbd not starting on Ubuntu 14.04

Posted: May 31st, 2016, 2:33 am
by sander
Worth a try (1% chance it will give useful info): start sabnzbd with a fresh, new ini.

So:
Make sure SAB is not running, then:

Code: Select all

sabnzbdplus -f sab-some-test.ini
Fill out the wizard, do a download, stop SABnzbd, and start it again with

Code: Select all

sabnzbdplus -f sab-some-test.ini
Does that work, or do you get an error message?

Re: SABnzbd not starting on Ubuntu 14.04

Posted: May 31st, 2016, 8:55 am
by petri0
Thanks sander but now I can't even get to my Desktop. Got to install this OS and everything else. Luckily this isn't MS Windows and won't take rest of the week... :)

Re: SABnzbd not starting on Ubuntu 14.04

Posted: May 31st, 2016, 9:09 am
by jcfp
petri0 wrote:Could this be something with my hardware? It is getting a little old and now my HDD:s have started to "disappear". I have to go to "Discs" to wake them up and to mount them.
petri0 wrote:now I can't even get to my Desktop.
99% chance your issues are caused by broken hardware. No point in just reinstalling and watching it fail again after.