Page 1 of 1

SABnzbd trouble starting on Debian after upgrade

Posted: August 20th, 2016, 8:05 pm
by ALbino
Hey all,

All of a sudden today my SABnzbd 1.0.3 on my Debian Wheezy box went from downloading at 30MB/s to 200KB/s to 0, after which I started getting the Lost Connection error over and over. I restarted SAB, but no luck, so I thought this would be a good time to upgrade to 1.1.0RC1. I did that, and it upgraded properly, but I was still getting the Lost Connection error over and over again and unable to do anything. I logged into the box and noticed that it was using 99% CPU even though it wasn't downloading at the time, so I killed the process (kill -9 PID), but now I can't get it to start and am wondering if I'm doing something obviously wrong.

The line I usually use is:

Code: Select all

/usr/bin/sabnzbdplus --daemon --pidfile /var/run/sabnzbdplus/pid
But I also tried:

Code: Select all

/usr/bin/sabnzbdplus --daemon --pidfile /var/run/sabnzbdplus/pid --server 0.0.0.0:9090
And:

Code: Select all

/usr/bin/sabnzbdplus --daemon --pidfile /var/run/sabnzbdplus/pid --server 123.45.56.89:9090
Where 123.45.67.89 represents the actual IP.

There is an error in the logs:

Code: Select all

Traceback (most recent call last):
  File "/usr/share/sabnzbdplus/cherrypy/process/servers.py", line 205, in _start_http_thread
    self.httpserver.start()
  File "/usr/share/sabnzbdplus/cherrypy/wsgiserver/wsgiserver2.py", line 1957, in start
    raise socket.error(msg)
error: No socket could be created -- (('0.0.0.0', 9090): [Errno 98] Address already in use)
And here's a pastebin:

http://pastebin.com/eubVkBa5

Re: SABnzbd trouble starting on Debian after upgrade

Posted: August 21st, 2016, 12:44 am
by sander

Code: Select all

error: No socket could be created -- (('0.0.0.0', 9090): [Errno 98] Address already in use)
So there is already a process listening on port 9090. Use this to find out which process:

Code: Select all

sudo netstat -apon | grep ":9090"
In these circumstances it can be handy to start SAB like this:

Code: Select all

sabnzbdplus
and then find out what SAB says and does

Re: SABnzbd trouble starting on Debian after upgrade

Posted: August 21st, 2016, 1:09 am
by ALbino
Thanks sander. Here was the output:

Code: Select all

tcp        0      0 123.45.67.89:9090        0.0.0.0:*               LISTEN      6424/python      off (0.00/0/0)
Trying to start with just "sabnzbdplus" gives the same output as the pastebin up above:

Code: Select all

2016-08-21 08:08:10,163::INFO::[sabnzbdplus:1501] Starting web-interface on 0.0.0.0:9090
2016-08-21 08:08:10,164::INFO::[_cplogging:217] [21/Aug/2016:08:08:10] ENGINE Bus STARTING
2016-08-21 08:08:10,167::INFO::[_cplogging:217] [21/Aug/2016:08:08:10] ENGINE Started monitor thread '_TimeoutMonitor'.
2016-08-21 08:08:10,260::ERROR::[_cplogging:217] [21/Aug/2016:08:08:10] ENGINE Error in HTTP server: shutting down
Traceback (most recent call last):
  File "/usr/share/sabnzbdplus/cherrypy/process/servers.py", line 205, in _start_http_thread
    self.httpserver.start()
  File "/usr/share/sabnzbdplus/cherrypy/wsgiserver/wsgiserver2.py", line 1957, in start
    raise socket.error(msg)
error: No socket could be created -- (('0.0.0.0', 9090): [Errno 98] Address already in use)

2016-08-21 08:08:10,261::INFO::[_cplogging:217] [21/Aug/2016:08:08:10] ENGINE Bus STOPPING
2016-08-21 08:08:10,261::INFO::[_cplogging:217] [21/Aug/2016:08:08:10] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 9090)) already shut down
2016-08-21 08:08:10,261::INFO::[_cplogging:217] [21/Aug/2016:08:08:10] ENGINE Stopped thread '_TimeoutMonitor'.
2016-08-21 08:08:10,261::INFO::[_cplogging:217] [21/Aug/2016:08:08:10] ENGINE Bus STOPPED
2016-08-21 08:08:10,262::INFO::[_cplogging:217] [21/Aug/2016:08:08:10] ENGINE Bus EXITING
2016-08-21 08:08:10,262::INFO::[_cplogging:217] [21/Aug/2016:08:08:10] ENGINE Bus EXITED

Re: SABnzbd trouble starting on Debian after upgrade

Posted: August 21st, 2016, 1:25 am
by sander
OK, and now ... ?

Find out what that python process is.

Code: Select all

ps -ef | grep 6424
It might be SABnzbd that's already running.

Re: SABnzbd trouble starting on Debian after upgrade

Posted: August 21st, 2016, 1:28 am
by ALbino
Yep, you're exactly right:

Code: Select all

1000      6424     1  0 02:44 ?        00:00:09 /usr/bin/python -OO /usr/bin/sabnzbdplus --daemon --pidfile /var/run/sabnzbdplus/pid --server 123.45.67.89:9090
root     15461 14912  0 08:26 pts/8    00:00:00 grep 6424
Okay, so it's running, but I can't connect to it in my browser. Should I kill 6424 and try restarting it?

FWIW, it doesn't appear in "top" or "ps ux", only in "ps -ef".

Re: SABnzbd trouble starting on Debian after upgrade

Posted: August 21st, 2016, 1:40 am
by sander
I would just reboot the Debian system to get a clean start, and start from there.

Re: SABnzbd trouble starting on Debian after upgrade

Posted: August 21st, 2016, 1:52 am
by ALbino
All right, I went with that :)

No luck though. It's running, but not connectable:

Code: Select all

1000      3112     1  0 08:46 ?        00:00:00 /usr/bin/python -OO /usr/bin/sabnzbdplus --daemon --pidfile /var/run/sabnzbdplus/pid --server 0.0.0.0:8080
Everything else came back up fine and I'm able to connect to other programs on the box, just not SAB.

Re: SABnzbd trouble starting on Debian after upgrade

Posted: August 21st, 2016, 1:53 am
by sander
Which URL do you use to connect? From where?

Re: SABnzbd trouble starting on Debian after upgrade

Posted: August 21st, 2016, 1:57 am
by ALbino
I'm at home, and it's in a datacenter. The URL I'm using is the same one I always use:

https://123.45.67.89:9090/sabnzbd/

I've tried in both Firefox and Chrome, but both say they cannot connect. I even remoted into my office PC and tried to reach it from there, but no luck either.

Re: SABnzbd trouble starting on Debian after upgrade

Posted: August 21st, 2016, 2:00 am
by ALbino
I noticed that the one running is:

Code: Select all

--server 0.0.0.0:8080
And I can connect to it using:

Code: Select all

http://123.45.67.89:8080/sabnzbd/
So it's only the secure 9090 version that isn't running for some reason. Do I need to start :9090 separately? I've never had to do that before, even after a reboot.

Re: SABnzbd trouble starting on Debian after upgrade

Posted: August 21st, 2016, 2:14 am
by sander
You know how you can activate HTTPS in SABnzbd's GUI ... ?

Re: SABnzbd trouble starting on Debian after upgrade

Posted: August 21st, 2016, 2:27 am
by ALbino
That worked! :)

Now, a couple of things...

First, thanks sander, you're the best. I love when you give very clear code examples and walk people through it step by step. Not only is it useful in the moment, but it's useful when reading old threads to see the thought process.

Secondly, I definitely didn't manually disable the HTTPS setting before I upgraded from 1.0.3 to 1.1.0RC1. Especially since I couldn't have gotten to the config page anyway because I kept losing connection and it was pegged at 99% CPU while idle. So I'm wondering if somehow that setting didn't make the migration? Seems unlikely, but might be worth looking into.