Page 1 of 1

Incorrect "Please restart SABnzbd with a different port number." + solution sugg

Posted: September 17th, 2010, 9:00 am
by sander
It has been discussed before: the error message "Please restart SABnzbd with a different port number." happens a lot, and ... can be incorrect.

Here's my explanation, and my proposal:

SABnzbd will give the infamous error message below, including the advice "Please restart SABnzbd with a different port number.", if it cannot bind to the IP address & port it tried. The advice is true if the port/socket is in use, but it's incorrect if the IP address is incorrect (read: not local). So, if SAB tries to bind to 192.168.1.10:8080 with 192.168.1.10 not locatl on this computer, SAB will advice ... to use a differente port. That's incorrect; SAB should say something like "Please restart SABnzbd with a different port number AND/OR a different IP address.". But (read on) ...

As that's quite complex for a user, and SAB itself can help, I suggest the following: instead of only port-hunting, SAB should do some kind of IP address hunting, and in an easy and pre-defined way:

If SAB cannot bind to the IP:PORT specified, it should try in this sequence:
127.0.0.1:PORT
[::1]:PORT
127.0.0.1:8085
[::1]:8085
127.0.0.1:16016
[::1]:16016

(I'm not sure about trying 0.0.0.0: is 0.0.0.0 'easier' / more tolerant than 127.0.0.1? And is it too unsecure as it makes SAB open to the network?)

With the above, I think we solve a bug, and make it easier for users to get and keep SAB working.

How about it?



Welcome to SABnzbd-console.exe 0.5.4



    SABnzbd needs a free tcp/ip port for its internal web server.
    Port 8080 on 192.168.1.10 was tried , but the account used for SABnzbd has no permission to use it.
    On OSX and Linux systems, normal users must use ports above 1023.


    Please restart SABnzbd with a different port number.

    Press Startkey+R and type the line (example):
        "C:\Program Files\SABnzbd\SABnzbd-console.exe" --server 192.168.1.10:8081


    If you get this error message again, please try a different number.


Program did not start!

Re: Incorrect "Please restart SABnzbd with a different port number." + solution sugg

Posted: October 1st, 2010, 12:41 pm
by shypike
Your assumption is that localhost is what the user wants.
When people specify their own IP address, it's usually because they want external access.
So trying different flavors of localhost isn't going to help.

The "simple user" scenario will default to localhost.
We already improved localhost handling for odd OS'ses and browsers (Chrome).

It's not clear to me how this is a major improvement.

It worth investing if we can get a better feedback from the Python socket library
about the difference between a port problem and an IP problem.

Re: Incorrect "Please restart SABnzbd with a different port number." + solution sugg

Posted: October 1st, 2010, 2:31 pm
by sander
shypike wrote: Your assumption is that localhost is what the user wants.
When people specify their own IP address, it's usually because they want external access.
So trying different flavors of localhost isn't going to help.
No, I'm talking about the troubleshooting situation after SAB has discovered it can't bind to the IP:PORT that is specified in sabnzbd.ini (or command line). Yes, SAB tries another port, but when that fails, SAB says "try another port". Which often is not correct: the IP address can be wrong.

Do we agree about that?

Instead of hunting for hust another PORT, I think SAB should find another IP address, for which "throttling back" to 127.0.0.1 would be fail-safe & good. Remember: SAB is in a troubleshooting situation ...

Furthermore, I've never understood why can you fill out an IP address at all. Why fill out 82.67.34.34? Is there a use for that? I would think that is only a source for trouble. It's my experience that users incorrectly fill out the name/ IP address of the newsserver there.
To me, it should be a radio button check box: localhost only, or IPv4 LAN (thus 0.0.0.0), or IPv6+IPv4 (thus ::).

Re: Incorrect "Please restart SABnzbd with a different port number." + solution sugg

Posted: October 2nd, 2010, 6:32 am
by shypike
sander wrote: Which often is not correct: the IP address can be wrong.
Do we agree about that?
Yes, like I already wrote, currently we don't get the right feedback from the socket library.
I will look into that, it would be great to know whether it's the port or the IP.
Instead of hunting for hust another PORT, I think SAB should find another IP address, for which "throttling back" to 127.0.0.1 would be fail-safe & good. Remember: SAB is in a troubleshooting situation ...
This will not help in an embedded situation.
So it's not a universal solution.
Furthermore, I've never understood why can you fill out an IP address at all.
On some systems blank or 0.0.0.0 won't work, usually because of a lousy DNS setup.
Older versions of Ubuntu suffered from that.
Also some systems (say laptops with wired and wireless network) have multiple IP addresses.

The trouble is providing a solution that works for most people with least hassle AND
giving options for more complex situations.
The Wizard doesn't give you the option to set an IP.
It only distinguishes between local and open access.
Even this sometimes doesn't work because the OS is not properly configured.
Or there's a dumb-ass browser (like Chrome on OSX).
That's were trouble starts.