SABnzbd trouble starting on Debian after upgrade

Support for the Debian/Ubuntu package, created by JCFP.
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
ALbino
Full Member
Full Member
Posts: 214
Joined: October 23rd, 2014, 12:28 am

SABnzbd trouble starting on Debian after upgrade

Post 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
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: SABnzbd trouble starting on Debian after upgrade

Post 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
ALbino
Full Member
Full Member
Posts: 214
Joined: October 23rd, 2014, 12:28 am

Re: SABnzbd trouble starting on Debian after upgrade

Post 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
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: SABnzbd trouble starting on Debian after upgrade

Post 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.
ALbino
Full Member
Full Member
Posts: 214
Joined: October 23rd, 2014, 12:28 am

Re: SABnzbd trouble starting on Debian after upgrade

Post 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".
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: SABnzbd trouble starting on Debian after upgrade

Post by sander »

I would just reboot the Debian system to get a clean start, and start from there.
ALbino
Full Member
Full Member
Posts: 214
Joined: October 23rd, 2014, 12:28 am

Re: SABnzbd trouble starting on Debian after upgrade

Post 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.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: SABnzbd trouble starting on Debian after upgrade

Post by sander »

Which URL do you use to connect? From where?
ALbino
Full Member
Full Member
Posts: 214
Joined: October 23rd, 2014, 12:28 am

Re: SABnzbd trouble starting on Debian after upgrade

Post 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.
ALbino
Full Member
Full Member
Posts: 214
Joined: October 23rd, 2014, 12:28 am

Re: SABnzbd trouble starting on Debian after upgrade

Post 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.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: SABnzbd trouble starting on Debian after upgrade

Post by sander »

You know how you can activate HTTPS in SABnzbd's GUI ... ?
ALbino
Full Member
Full Member
Posts: 214
Joined: October 23rd, 2014, 12:28 am

Re: SABnzbd trouble starting on Debian after upgrade

Post 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.
Post Reply