Page 1 of 2
Inescapable Port Error
Posted: September 1st, 2010, 2:21 am
by gescom
I'm now running the new 0.5.4 final. Windows XP SP3. NOD32 antivirus/firewall.
I've been using sabnzb+ for about a year, and now I'm getting this new error after restarting the software.
Welcome to SABnzbd.exe 0.5.4
SABnzbd needs a free tcp/ip port for its internal web server.
Port 8082 on localhost was tried , but it is not available.
Some other software uses the port or SABnzbd is already running.
Please restart SABnzbd with a different port number.
Press Startkey+R and type the line (example):
"C:\Program Files\SABnzbd\SABnzbd.exe" --server localhost:8083
If you get this error message again, please try a different number.
Program did not start!
I've looked all over the forums about this error, tried the various combinations for the host (0.0.0.0, my local IP) and ports. I've tried several ports from 8080 and beyond. Never had this sort of problem before. I've tried disabling my antivirus/firewall. Any port I choose to start up with is "not available" according to the error message. This is totally out of the blue. I was just running 0.5.3, noticed it was hogging lots of memory, shut it down, restarted and got this error. I saw a new version was available (0.5.4), got that, and the error remains. I'm also using Sick Beard if that's relevant.
Re: Inescapable Port Error
Posted: September 1st, 2010, 6:59 am
by shypike
The difference between 0.5.3 and 0.5.4 is small and there are no changes related to this issue.
I suspect it's something in your system.
If you have a router, then you cannot use your ISP-assigned address.
Have you tried "localhost"?
That's the best choice if you do not need access from other computers.
Re: Inescapable Port Error
Posted: September 1st, 2010, 9:20 am
by gescom
I've been using localhost to begin with. I simply tried the alternatives after I started getting the error.
Re: Inescapable Port Error
Posted: September 1st, 2010, 2:46 pm
by shypike
I'd still say it's a problem with the firewall and/or virus scanner.
A lot of them misbehave and are not as transparent as they should be.
Have you tried low port numbers too?
One thing you could try is rename your current profile
c:\documents and settings\USER\local data\application data\sabnzbd
to something else.
If you then start SABnzbd, the Wizard should come up again
and you start with a clean profile.
Re: Inescapable Port Error
Posted: September 1st, 2010, 11:19 pm
by gescom
Thanks for your input. With my antivirus/firewall disabled I have tried the following: changing port numbers high and low, renaming my current profile to start with a clean one, uninstalling completely then reinstalling anew, resetting my router. Nothing has worked, and even after completely reinstalling sabnzb I'm getting this error now.
I attached an image what NOD32 shows me as soon as I try to run sabnzbd (with this command "C:\Program Files\SABnzbd\SABnzbd.exe" --server :8089 ) immediately before it fails to start. I don't know if this is helpful at all. And this is after I re-enabled my antivirus/firewall, of course.
And another try: I installed 0.5.3 instead, and to start off it took me through the setup wizard, then when it 'restarts' it gives me that error.
Re: Inescapable Port Error
Posted: September 2nd, 2010, 1:27 am
by sander
Looking at your picture/screendump:
1) Is sabnzbd really listening on port 4012, and port 4014, and port 4016, and port ... etc?! SAB should be listening on one port, preferrably 8080, but certainly not more ports.
2) If your firewall is disabled, how can you show a screenshot of firewall monitoring? Are you sure your firewall is disabled?
In general: since SAB 0.5.something, SAB should start hunting for a free port (in steps of 5), if the assigned port (8080) is already occupied. So I don't understand the error message, nor the port 8082.
If you remove sabnzbd.ini, and you start SABnzbd.exe, do you get the Setup Wizard?
Re: Inescapable Port Error
Posted: September 2nd, 2010, 2:16 am
by gescom
I re-enabled my firewall to see what was happening with the network activity and to take that screenshot. It's been off for everything else.
That port 8082 was what I'd been using sabnzbd on since I can remember (I don't recall why I changed it from 8080).
If I remove sabnzbd.ini from the directory, then run SABnzbd.exe, I get the port error (regarding port 8080) and a new sabnzbd.ini is created.
During all this trial and error, the interface seemed to show itself only upon running it from the installer after a new install. Once I shutdown and try to restart, though, the error comes back.
I can't explain the thing about all those 40** numbered ports listening.
Re: Inescapable Port Error
Posted: September 2nd, 2010, 3:25 am
by shypike
When you have HTTPS enabled, SABnzbd will listen on two ports (808080 and 9090 by default).
The only other suggestion I have is to to un-install NOD32.
Just disabling it will not stop it from interfering with the network traffic (it will stop blocking).
Re: Inescapable Port Error
Posted: September 2nd, 2010, 6:40 am
by sander
http://forums.sabnzbd.org/index.php?topic=4629.0 describes a method to see which ports are really in use, and which port is in use by SAB.
@ SAB-dev / shypike: IMHO it would informative if SABnzbd would not only say "port in use", but would use "netstat" to check if the port is really in use. If not, SAB should say "possibly a firewall and/or virusscanner is blocking access to the port'
EDIT: and SAB should of course check in the "tasklist" command to see if it's running.
Re: Inescapable Port Error
Posted: September 2nd, 2010, 2:00 pm
by shypike
netstat is a command line utility which varies wildly over platforms.
We prefer to use the Python API.
The same objection can be made about "tasklist".
The error message can indeed be improved.
Re: Inescapable Port Error
Posted: September 2nd, 2010, 2:43 pm
by sander
shypike wrote:
netstat is a command line utility which varies wildly over platforms.
We prefer to use the Python API.
The same objection can be made about "tasklist".
The error message can indeed be improved.
I do understand you prefer the Python API. On the other hand: a lot of problems/questions in this forum are about Port Error. So I think a few lines of code would be very useful. Here's my pseudo-code:
If (Windows): netstat & tasklist
if (Linux): netstat xyz & ps -ef
if (Mac): ...
And as especially Windows has the infamous port / virus scanner / firewall problems, you could start with Windows only. I really think it's only a few lines of python code, with just two lines of OS-dependent stuff.
The clever, OS-indepent stuff should be:
if SABnzbd already running,
don't try to start it, and just open a browser on the port.
else
try to start SABnzbd on the default port. If that doesn't work, see if there is another pogram already listening on that port. If not: report that there is probably a firewall / virusscanner problem (extra check: too low port number, which needs root rights)
repeat the above for a few ports.
I guess you can handle the OS-dependent is separate function, so that the OS-independent logic stays clear. Question: How can I run SABnzbd.py from source on Windows? Only if I can do that, I can write a cross-platform prototype of my idea ...
Windows:
Code: Select all
C:\Users\Sander>tasklist | find /i "sabnzbd"
SABnzbd-console.exe 5760 Console 1 24.252 K
C:\Users\Sander>netstat /ao | find /i "listening" | find "5760"
TCP [::]:8080 Vera-PC:0 LISTENING 5760
Linux:
Code: Select all
sander@athlon64:~$ ps -ef | grep -i sabnzbd | grep -vi grep
sander 7137 4313 0 Aug29 pts/0 00:09:35 /usr/bin/python -OO ./SABnzbd.py
sander@athlon64:~$ netstat --listening --numeric-ports -p | grep 7137
tcp6 0 0 :::8080 :::* LISTEN 7137/python
Re: Inescapable Port Error
Posted: September 2nd, 2010, 3:04 pm
by shypike
Be warned that netstat output is (partly) in the local language.
Running SABnzbd from source is dead easy.
Download the ActiveState Python 2.6 distribution and install it.
Run from a commandline:
pypm install cheetah
You'll miss yEnc and PyOpenSSL, but they aren't really needed.
Re: Inescapable Port Error
Posted: September 3rd, 2010, 12:52 pm
by sander
shypike wrote:
Be warned that netstat output is (partly) in the local language.
I found a non-language dependent one-liner to see the listening processes on Windows:
Example output (Windows Vista, English):
Code: Select all
C:\Users\Sander>netstat -aon | find /i ":0"
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 832
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:554 0.0.0.0:0 LISTENING 3756
TCP 0.0.0.0:2869 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:5357 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:10243 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:49152 0.0.0.0:0 LISTENING 524
TCP 0.0.0.0:49153 0.0.0.0:0 LISTENING 1020
TCP 0.0.0.0:49154 0.0.0.0:0 LISTENING 1072
TCP 0.0.0.0:49155 0.0.0.0:0 LISTENING 580
TCP 0.0.0.0:49156 0.0.0.0:0 LISTENING 1796
TCP 0.0.0.0:49157 0.0.0.0:0 LISTENING 568
TCP 127.0.0.1:5354 0.0.0.0:0 LISTENING 644
TCP 127.0.0.1:27015 0.0.0.0:0 LISTENING 456
TCP 127.0.0.1:50881 0.0.0.0:0 LISTENING 1604
TCP 192.168.1.36:139 0.0.0.0:0 LISTENING 4
TCP [::]:135 [::]:0 LISTENING 832
TCP [::]:445 [::]:0 LISTENING 4
TCP [::]:554 [::]:0 LISTENING 3756
TCP [::]:2869 [::]:0 LISTENING 4
TCP [::]:5357 [::]:0 LISTENING 4
TCP [::]:8080 [::]:0 LISTENING 2644
TCP [::]:10243 [::]:0 LISTENING 4
TCP [::]:49152 [::]:0 LISTENING 524
TCP [::]:49153 [::]:0 LISTENING 1020
TCP [::]:49154 [::]:0 LISTENING 1072
TCP [::]:49155 [::]:0 LISTENING 580
TCP [::]:49156 [::]:0 LISTENING 1796
TCP [::]:49157 [::]:0 LISTENING 568
Re: Inescapable Port Error
Posted: September 4th, 2010, 1:03 pm
by sander
@shypike
The proof of concept is ready: a python function whatisonport(...) that checks which program (in full name) is running on the specified port.
Example calls:
Code: Select all
print whatisonport(8080)
print whatisonport(8085)
print whatisonport(8090)
print whatisonport(39260)
which results in:
Code: Select all
ubuntu@ubuntu:~/port-checker$ python port-checker.py
port searched is 8080
<port not in use>
port searched is 8085
<port not in use>
port searched is 8090
/usr/bin/python -OO ./SABnzbd.py
port searched is 39260
/opt/google/talkplugin/GoogleTalkPlugin
klaar
ubuntu@ubuntu:~/port-checker$
I've tested this on Linux, not yet on Windows (I have no Windows myself, and ActivaState python needs admin rights ...). So, to do: test on Windows, and deveop for Mac OS X.
Usage by SABnzbd: if it can't listen on a port x, call whatisonport(x) to see if there is something running. If so, SAB could mention that program. If not, it is a sign that a firewall/virusscanner is binding to the port. After that SAB should continu hunting for a port, like it does now.
So, how to proceed? Shall I send you the code, or post it? Or should I put in SABnzbd.py?
Re: Inescapable Port Error
Posted: September 4th, 2010, 2:10 pm
by gescom
Ok, I uninstalled NOD32 and everything seems to work fine now. This doesn't make a whole lot of sense to me since the entire time I've been using sabnzbd I've also been using NOD32, but thanks for your help anyway!