Page 1 of 1

Port resets no matter what [docker]

Posted: February 23rd, 2019, 11:37 pm
by SLR
I'm running sabnzbd inside a docker container on a linux / arm device. I set the port for the docker container, and try setting sabnzbd's port within the interface, cfg file, even within the container, yet it reverts back. Only after setting the port within the container (usr/bin/sabnzbdplus) and (usr/share/sabnzbdplus/cherrypy/_cpserver(DOT)py), the cfg file stays as what I set it, but the log seems to suggest startup arguments that make the port 8080.

I would post more of the log, but it's recognized as a link, and blocked because I'm a new user. Here's the line I suspect:

Arguments = /usr/bin/sabnzbdplus --config-file /config --server 0.0.0.0:8080



Many thanks to anyone who helps.

Re: Port resets no matter what [docker]

Posted: February 24th, 2019, 2:49 am
by safihre
This is set by the Dockerfile. What specific Docker are you using? Because for example the one we usually recommend from linuxserver has a command line option when starting the Docker to set the port.

Re: Port resets no matter what [docker]

Posted: February 24th, 2019, 8:42 am
by SLR
I'm using "lsioarmhf/sabnzbd" which is by linuxserver. I set the port with "-p 8081:8081" with docker, and within sabnzbd's cfg file, but it doesn't work. When I do this with other docker containers (from linuxserver too) it's fine. I've tried many different ports.

Where is the Dockerfile? Maybe I can check if the option is present and correct within there.

Re: Port resets no matter what [docker]

Posted: February 24th, 2019, 2:35 pm
by safihre
I think it's then best to ask them at Github, we don't actually manage these dockers.

It does mention this on the Docker website:
THIS IMAGE IS DEPRECATED. PLEASE USE THE MULTI-ARCH IMAGES AT linuxserver/sabnzbd

Re: Port resets no matter what [docker]

Posted: February 24th, 2019, 4:19 pm
by SLR
Thanks for pointing that out, they still list the old image on their website. I switched to the new version, and the same problem persists. Not being able to set the port to anything but the default is quite a big issue, I think the only option is to report this to them as a bug.

I can't keep port 8080, and I can't find a single other sabnzbd image for arm, so do you have any idea how to edit the Dockerfile or where it's stored? Sorry this is more of a docker question, I'll ask elsewhere if you don't know.

Re: Port resets no matter what [docker]

Posted: February 24th, 2019, 4:53 pm
by sander
SLR wrote: February 24th, 2019, 8:42 am I set the port with "-p 8081:8081" with docker, and within sabnzbd's cfg file, but it doesn't work.
Why don't you use "-p 8081:8080", meaning "map port 8081 of the host unto 8080 of the docker container". Then no need to reconfigure sabnzbd within the docker.

Re: Port resets no matter what [docker]

Posted: February 24th, 2019, 5:29 pm
by SLR
I didn't realize that's why there's two ports, just tried your suggestion and it worked. Problem is, I thought "8080" was being taken up at boot, which would have explained why I couldn't access the interface after rebooting. It seems the interface just doesn't work after a reboot until I remove and create the docker container, regardless of the port.

Again, this only happens with this sabnzbd container. Could there be variables set by the Dockerfile on boot that would cause this effect? I'm stumped.

Re: Port resets no matter what [docker]

Posted: February 25th, 2019, 3:21 am
by safihre
Aaaah that's how that works...

Re: Port resets no matter what [docker]

Posted: February 25th, 2019, 8:33 am
by SLR
I tested manually running with python "sabnzbdplus" after reboot, and it doesn't work - python seems to not work at all within the container after reboot. However, it works when the container is removed and created again. Otherwise, these python errors are printed over ssh:

Code: Select all

Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 563, in <module>
    main()
  File "/usr/lib/python2.7/site.py", line 545, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/lib/python2.7/site.py", line 272, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/lib/python2.7/site.py", line 247, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/lib/python2.7/site.py", line 237, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/lib/python2.7/sysconfig.py", line 582, in get_config_var
    return get_config_vars().get(name)
  File "/usr/lib/python2.7/sysconfig.py", line 528, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/usr/lib/python2.7/sysconfig.py", line 412, in _init_posix
    from _sysconfigdata import build_time_vars
  File "/usr/lib/python2.7/_sysconfigdata.py", line 6, in <module>
    from _sysconfigdata_nd import *
ImportError: No module named _sysconfigdata_nd

Re: Port resets no matter what [docker]

Posted: February 25th, 2019, 9:58 am
by sander
If you have problems with the docker image / container, report them to the docker image maintainers.

A tip about docker containers: treat them like "cattle, not pets". So if it doesn't work, don't try to heal/repair it, but kill it.

Re: Port resets no matter what [docker]

Posted: May 15th, 2019, 2:44 am
by roidflower
Hi SLR,

Just wanted to share my workaround for this problem. I saw the same behavior on my system, what you sometimes need to do with containers is put them on the bridge network rather then the host network.
After changing my docker-compose to set the network_mode: bridge it redirected the port just fine