Inescapable Port Error

Get help with all aspects of SABnzbd
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.
gescom
Newbie
Newbie
Posts: 5
Joined: September 1st, 2010, 2:07 am

Inescapable Port Error

Post 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.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Inescapable Port Error

Post 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.
gescom
Newbie
Newbie
Posts: 5
Joined: September 1st, 2010, 2:07 am

Re: Inescapable Port Error

Post by gescom »

I've been using localhost to begin with. I simply tried the alternatives after I started getting the error.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Inescapable Port Error

Post 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.
gescom
Newbie
Newbie
Posts: 5
Joined: September 1st, 2010, 2:07 am

Re: Inescapable Port Error

Post 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.
Last edited by gescom on September 1st, 2010, 11:58 pm, edited 1 time in total.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Inescapable Port Error

Post 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?
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
gescom
Newbie
Newbie
Posts: 5
Joined: September 1st, 2010, 2:07 am

Re: Inescapable Port Error

Post 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.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Inescapable Port Error

Post 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).
Last edited by shypike on September 2nd, 2010, 1:56 pm, edited 1 time in total.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Inescapable Port Error

Post 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.
Last edited by sander on September 2nd, 2010, 9:49 am, edited 1 time in total.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Inescapable Port Error

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

Re: Inescapable Port Error

Post 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


If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Inescapable Port Error

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

Re: Inescapable Port Error

Post 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:

Code: Select all

netstat -aon | find /i ":0"
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


If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Inescapable Port Error

Post 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?
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
gescom
Newbie
Newbie
Posts: 5
Joined: September 1st, 2010, 2:07 am

Re: Inescapable Port Error

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