Page 1 of 2

No restricted local running posible

Posted: June 12th, 2012, 11:05 pm
by Saiya_Jin_Vegeta
Simple description:

When I set the host to 127.0.0.1, localhost or ::1 the webinterface stays available on all interfaces and is therefore not limited to only the local computer.
Have tried to re-setup, manual change etc. All same result.

Running Sabnzbd 0.7.0 Final

Re: No restricted local running posible

Posted: June 13th, 2012, 12:17 am
by sander
Which os?

Did you restart SABnzbd?

Re: No restricted local running posible

Posted: June 13th, 2012, 1:18 pm
by Saiya_Jin_Vegeta
OpenSuse 12.1 X64
Yes I did multiple times try to get it working by restart.

Re: No restricted local running posible

Posted: June 13th, 2012, 1:33 pm
by sander
Post the output of the following commands :

Code: Select all

 grep -i  starting  ~/.sabnzbd/logs/sabnzbd.log
 grep host ~/.sabnzbd/sabnzbd.ini
 netstat -apon | grep :8080
NB: the last command assumes that SAB is running on port 8080. If not, change the command accordingly.

Re: No restricted local running posible

Posted: June 13th, 2012, 3:40 pm
by Saiya_Jin_Vegeta
I am using an alternate location for my config file:
/etc/sabnzbd/

But underneath it states clearly that it listens on all ports, while in my config file clearly is stated localhost? What is going wrong?

Code: Select all

linux-7ffb:/var/log # grep -i  starting  ~/.sabnzbd/logs/sabnzbd.log
2012-06-11 22:13:17,147::INFO::[SABnzbd:1459] Starting web-interface on 0.0.0.0:8080
2012-06-11 22:13:17,147::INFO::[_cplogging:55] [11/Jun/2012:22:13:17] ENGINE Bus STARTING
2012-06-11 22:13:23,109::INFO::[SABnzbd:1528] Starting SABnzbd.py-0.7.0
2012-06-11 22:13:23,111::INFO::[dirscanner:265] Dirscanner starting up
2012-06-11 22:13:23,112::INFO::[urlgrabber:78] URLGrabber starting up
2012-06-11 22:19:38,820::INFO::[SABnzbd:1459] Starting web-interface on 0.0.0.0:8080
2012-06-11 22:19:38,820::INFO::[_cplogging:55] [11/Jun/2012:22:19:38] ENGINE Bus STARTING
2012-06-11 22:19:41,860::INFO::[SABnzbd:1528] Starting SABnzbd.py-0.7.0
2012-06-11 22:19:41,862::INFO::[dirscanner:265] Dirscanner starting up
2012-06-11 22:19:41,863::INFO::[urlgrabber:78] URLGrabber starting up
linux-7ffb:/var/log # grep host ~/.sabnzbd/sabnzbd.ini
host = 0.0.0.0
host = news.ziggo.nl
linux-7ffb:/var/log # netstat -apon | grep :8080
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      13608/python        off (0.00/0/0)
tcp        0      0 192.168.178.11:8080     192.168.178.12:54437    TIME_WAIT   -                   timewait (9.60/0/0)
tcp        0      0 ::1:8080                :::*                    LISTEN      13608/python        off (0.00/0/0)
linux-7ffb:/var/log # grep host /etc/sabnzbd/sabnzbd.ini
host = localhost
host = test.test.com
linux-7ffb:/var/log #

Re: No restricted local running posible

Posted: June 13th, 2012, 3:50 pm
by shypike
0.0.0.0 means: listen on all interfaces including the IP of your system,
making it accessible for other computers.

Re: No restricted local running posible

Posted: June 13th, 2012, 3:53 pm
by Saiya_Jin_Vegeta
In the sabini, which is used is clearly standing localhost. So or this is wrong or something else is not OK (in config or in SAB)

Re: No restricted local running posible

Posted: June 13th, 2012, 4:21 pm
by sander
Saiya_Jin_Vegeta wrote:In the sabini, which is used is clearly standing localhost. So or this is wrong or something else is not OK (in config or in SAB)
Can you do the grep on that sabini and post the output? And how do you know SABnzbd is using the sabini?

Re: No restricted local running posible

Posted: June 13th, 2012, 4:27 pm
by Saiya_Jin_Vegeta
I already inlcuded the dump from:
/etc/sabnzbd/sabnzbd.ini

In the webinterface is clearly stated it uses this config:

Code: Select all

Version:	0.7.0
Uptime:	45m
Config File:	/etc/sabnzbd/sabnzbd.ini
Used cache:	Cached 0 articles (0 B)
Parameters:	/opt/SABnzbd/SABnzbd.py -f /etc/sabnzbd -d --pid /var/run/sabnzbd
Python Version:	2.7.2 (default, Aug 19 2011, 20:41:43) [GCC]

Re: No restricted local running posible

Posted: June 14th, 2012, 3:22 pm
by Saiya_Jin_Vegeta
No-one?

Re: No restricted local running posible

Posted: June 14th, 2012, 3:34 pm
by shypike
What does it say in Config->General? It shows the host address.

Re: No restricted local running posible

Posted: June 14th, 2012, 3:37 pm
by Saiya_Jin_Vegeta
SABnzbd Host : localhost
Host SABnzbd should listen on.

Re: No restricted local running posible

Posted: June 14th, 2012, 3:59 pm
by sander
Can you do this:

Stop SABnzbd
rename all sabnzbd.ini occurences to something else, for example sabnzbd.NNN
Start SABnzbd ... it shoud start the wizard. If so, fill it out with "listen locally only"
After the wizard, what is the situation with netstat etc ...

Re: No restricted local running posible

Posted: June 14th, 2012, 4:04 pm
by Saiya_Jin_Vegeta
Same result.
Did already do that before and just checked again.

Re: No restricted local running posible

Posted: June 14th, 2012, 4:35 pm
by sander
I found this piece of code in SABnzbd.py:

Code: Select all

    try:
        info = socket.getaddrinfo(socket.gethostname(), None)
    except:
        # Hostname does not resolve, use 0.0.0.0
        cherryhost = '0.0.0.0'
        info = socket.getaddrinfo(localhost, None)
So ... maybe it is caused there? Some ways to check for that:

Easy check #1: edit SABnzbd.py and change that line to cherryhost = '1.2.3.4'. Run SAB and see what port it binds too.
Easy check #2: edit SABnzbd.py, and put in that except something like "logging.error("ouch ... wrong wrong")
Easy check #3: open python, and type two commands like below.

Code: Select all

sander@R540:~$ python
Python 2.7.3 (default, Apr 20 2012, 22:39:59) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> import socket
>>> socket.getaddrinfo(socket.gethostname(), None)

[(2, 1, 6, '', ('127.0.1.1', 0)), (2, 2, 17, '', ('127.0.1.1', 0)), (2, 3, 0, '', ('127.0.1.1', 0))]
>>> 
sander@R540:~$ 

And bit further is also a '0.0.0.0' assignment, but only if it is already '0.0.0.0' ???

Code: Select all

    # 0.0.0.0 will listen on all ipv4 interfaces (no ipv6 addresses)
    elif cherryhost == '0.0.0.0':
        # Just take the gamble for this
        cherryhost = '0.0.0.0'
        browserhost = localhost
So I don't understand this piece of code, but I assume it is not setting it to 0.0.0.0.


HTH