Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sab RC4 notifications tab in config #672

Closed
sparklyballs opened this issue Aug 31, 2016 · 64 comments
Closed

Sab RC4 notifications tab in config #672

sparklyballs opened this issue Aug 31, 2016 · 64 comments
Assignees
Milestone

Comments

@sparklyballs
Copy link

sparklyballs commented Aug 31, 2016

Hi i'm part of linuxserver.io and author of the sabnzbd docker we make.
https://github.com/linuxserver
https://github.com/linuxserver/docker-sabnzbd

Testing out RC4 in my personal repo and the notifications tab in settings gives

Unable to connect

(in firefox at least)

same container but using 1.0.3 and the notifications tab loads.

@Safihre
Copy link
Member

Safihre commented Aug 31, 2016

Is there any more information? Like an error?
Does it work in Chrome?

@sparklyballs
Copy link
Author

I don't have chrome.

the error is the tab doesn't load, surely ?

@sparklyballs
Copy link
Author

it doesn't work in safari (mac latest version, if relevant) either

@Safihre
Copy link
Member

Safihre commented Aug 31, 2016

Is it a 404, 500 or just a timeout?
Maybe try to see what happens if you get the files from the repro as a zip instead of the src file?

@sparklyballs
Copy link
Author

kk.
screen shot 2016-08-31 at 12 16 04

firefox ^^^

screen shot 2016-08-31 at 12 16 40

safari ^^^

@sparklyballs
Copy link
Author

@shypike
Copy link
Member

shypike commented Aug 31, 2016

Did you set a fixed numerical IP in Config->General?
Is this the correct one or did your router assign a new IP address to the system?
We usually recommend "127.0.0.1" for local only or "0.0.0.0" if you need external access.

@shypike
Copy link
Member

shypike commented Aug 31, 2016

Maybe I missed something. The problem only happens for the Config->Notify page?

@sparklyballs
Copy link
Author

it's a docker container, 0.0.0.0 and 127.0.0.1 are not going to work

the ip used is the ip of the host system running docker.

the tab works in 1.0.3 but not in RC4 in an identical docker

@shypike, yes only the notifications tab.

@shypike
Copy link
Member

shypike commented Aug 31, 2016

@sparklyballs Right, then I misinterpreted the problem.
We'll get to the bottom of this.

@shypike shypike self-assigned this Aug 31, 2016
@shypike shypike added this to the 1.1.0 milestone Aug 31, 2016
@sparklyballs
Copy link
Author

sidenote, have you checked out our docker ? lol.

https://github.com/linuxserver/docker-sabnzbd

@shypike
Copy link
Member

shypike commented Aug 31, 2016

@sparklyballs It's something that has been forever on my to-do list: have a good lock at Docker in general and SABnzbd's docker specifically :(

@sparklyballs
Copy link
Author

we'll be more than happy to help, or you could link us as an install option ?

some of the other containers we build, the original app authors do that.

couchpotato for example.

@shypike
Copy link
Member

shypike commented Aug 31, 2016

@sparklyballs That is a good suggestion. I'll talk to the webmaster about offering it as an install option.

@sparklyballs
Copy link
Author

cool, i don't turn every other support issue into a "sell" , honest...

@Safihre
Copy link
Member

Safihre commented Aug 31, 2016

I tried to reproduce it by downloading the src file and running it in with python SABnzbd.py in my Ubuntu linux and the page works as expected.
Granted, it does have the PPA installed so all dependencies available, maybe that helps?

@Safihre
Copy link
Member

Safihre commented Aug 31, 2016

Looking at the code (https://github.com/sabnzbd/sabnzbd/blob/develop/sabnzbd/interface.py#L2851-L2892) I cannot see anything special about this page that would make it fail?

Could you maybe try with any of the other older RC's? Does it fail from the first beta/RC of 1.1.0?

@Safihre
Copy link
Member

Safihre commented Aug 31, 2016

It is also very strange that the browsers say 'Cannot connect', because if you request a nonsense address from SABnzbd, say:
http://localhost:8080/sabnzbd/config/categoriessssssssssssssss
CherryPy will redirect you to SABnzbd main page.
So something like a timeout must happen for it to say 'Cannot connect'.
Does the loading take really long before the browsers say 'Cannot connect'?

@sparklyballs
Copy link
Author

sparklyballs commented Aug 31, 2016

the loading is less than 2 seconds or so, a little longer than usual for a normal page, but not excessively long.

it's weird it's the only tab that doesn't load.

i tried this file

https://github.com/sabnzbd/sabnzbd/releases/download/1.1.0Beta1/SABnzbd-1.1.0Beta1a-src.tar.gz

with the same result as the RC4.

@Safihre
Copy link
Member

Safihre commented Aug 31, 2016

I have no clue how this could happen.. No timeout and no redirect? It almost seems impossible..
Maybe @shypike will have am answer.

@sparklyballs
Copy link
Author

this is the dockerfile of the baseimage used for our sab docker

https://github.com/linuxserver/docker-baseimage-alpine-python/blob/master/Dockerfile

if there's anything that you can see that may be missing..

@shypike
Copy link
Member

shypike commented Sep 1, 2016

I tried the 1.0.3 docker release. I cannot get it working: I see it starting up and listening to 0.0.0.0:8080, but I cannot get Firefox to connect to it at all.
(Using Ubuntu Desktop 15.10)

@sparklyballs
Copy link
Author

you have to use the ip of the host system and not 127.0.0.1 etc.

@shypike
Copy link
Member

shypike commented Sep 1, 2016

That's what I do, but no response. I assume this is the actual IP and not the one listed by ifconfig for "docker0"?

@sparklyballs
Copy link
Author

docker0 is a bridge usually (it varies from host to host)
to allow communication between the host and docker containers and containers to the host and the outside world etc..

my ifconfig output

docker0 Link encap:Ethernet HWaddr XXXXXXXX
inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

enp2s2 Link encap:Ethernet HWaddr XXXXXXXXX
inet addr:192.168.1.40 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fXXXXXXXX/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2056604 errors:0 dropped:6 overruns:0 frame:0
TX packets:2249 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:711275586 (711.2 MB) TX bytes:1362577 (1.3 MB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:160 errors:0 dropped:0 overruns:0 frame:0
TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:11840 (11.8 KB) TX bytes:11840 (11.8 KB)

in this instance i would use
192.168.1.40

@shypike
Copy link
Member

shypike commented Sep 1, 2016

Yes, similar to mine. I picked the address equivalent to yours.
Now, my Ubuntu is running under VMWare Desktop for Windows.
Does that complicate matters?

@sparklyballs
Copy link
Author

not sure, have no experience with VMWARE and little with windows, lol.

but i shouldn't imagine so, that output is from a VM on unraid as the host, my dev server so to speak.

@sparklyballs
Copy link
Author

if you ssh in to the VM , use the same ip you use for that...

@sparklyballs
Copy link
Author

kk, i was afk yesterday (50th birthday) and my head is still a little fuzzy today, lol

at least know it wasn't my imagination there is something going on with that tab.

@shypike
Copy link
Member

shypike commented Sep 3, 2016

We don't understand what's going on. It looks like the Notify template runs into some limit. If we remove one section (any), it works. Why this only happens in a docker, no idea.

@shypike
Copy link
Member

shypike commented Sep 4, 2016

Whenever you call up the Notifications page, SABnzbd simply crashes (or stops or is terminated). The Docker service starts it again immediately. What kind of crash it is, I don't know. There is absolutely zero logging available.
@sparklyballs Are there limits (memory, file handles, threads, responsiveness) for Docker apps that do not apply for native apps?

@sparklyballs
Copy link
Author

on a test version local to me i moved the startup of sab to an init routine in the dockerfile, the services files in our dockers restart crashed apps.

about the only extra infomation i can get is that it is a segmentation fault.

as for the docker specifics you asked about, not sure.

@sparklyballs
Copy link
Author

2016-09-04 11:46:21.011311500 /var/run/s6/etc/cont-init.d/30-startup: line 5: 205 Segmentation fault (core dumped) s6-setuidgid abc python /app/sabnzbd/SABnzbd.py -l 2 -f /config/sabnzbd.ini -b 0 -s 0.0.0.0:8080
2016-09-04 11:46:21.011912500 [cont-init.d] 30-startup: exited 139.

@Safihre
Copy link
Member

Safihre commented Sep 4, 2016

Looks more like a Docker/python problem than a Sabnzbd problem?

@sparklyballs
Copy link
Author

@Safihre looks like you could be right, just spun up an ubuntu xenial version of the docker running sabnzbd RC4 from the ppa and the notifications page is loading.

@sparklyballs
Copy link
Author

so there is something in the alpine version of the docker.
that between 1.0.3 and the 1.10 of the notifications tab is causing it to crash.

@sparklyballs
Copy link
Author

noticed something strange...

https://youtu.be/v4eU0j2uRZQ

@thezoggy
Copy link
Contributor

thezoggy commented Sep 5, 2016

each time you check off the box its trying to save.. if you told sab to change apikey but havent restarted.. that might explain the session key not being right. just tried 1.1.0RC4 on windows and ubuntu.. no problems here. you can load up firebug and see what is being passed and see whats going on..

the only thing on the config page that I cant really test is the whole ncenter part.. but thats osx related.

speaking of, if you want to debug some.. navigate to where sab's installed, go modify the file interfaces/Config/templates/config_notify.tmpl and nuke out the segments and see if that makes a difference.. just be sure to revert the file when you are done so you dont have local changes that would prevent git/package manager from updating.

@shypike
Copy link
Member

shypike commented Sep 8, 2016

@thezoggy
There is some problem in the Alpine image, according to sparklyballs.
If you remove any random section from Notify, the problem goes away.
The crash occurs when Cheetah is creating the HTML from the template.
Something is overflowing, but it doesn't seem to be in SABnzbd or Cheetah.

@thezoggy
Copy link
Contributor

thezoggy commented Sep 8, 2016

yep.. so its due to too many variables it has to process... was able to prove this.. created config_notify.tmpl with only $T('email-never') on a line with it being repeated over and over...

page fails to load:

sabnzbd/interfaces/Config/templates$ grep -o '\$' config_notify.tmpl | wc -l
783

I delete one line.. works

sabnzbd/interfaces/Config/templates$ grep -o '\$' config_notify.tmpl | wc -l
782

added two lines back with just text, no variables.. still works. so deff the issue is 782+ variables for it to deal with...

changing $T('email-never') to $T('testNotify') just to see if the length of the variable contents matter.. it did not. still works with 782 instances of testNotify..

@sparklyballs
Copy link
Author

further to @thezoggy's message...

built a version without installing cherrypy, issue persists.

@shypike
Copy link
Member

shypike commented Sep 8, 2016

CherryPy is not a factor, only Cheetah is.

@shypike
Copy link
Member

shypike commented Sep 8, 2016

Is it possible to use another version of Cheetah on your Docker?

@sparklyballs
Copy link
Author

i could build from source i suppose, do you mean version number or alternative cheetah author ?

@thezoggy
Copy link
Contributor

thezoggy commented Sep 9, 2016

on another docker image there is issues with alpine:
http://forum.kodi.tv/showthread.php?tid=290259&pid=2411449#pid2411449

wonder if this is also causing this issue...

@sparklyballs
Copy link
Author

@thezoggy that's a red herring with kodi, since that particular problem is also happening with an ubuntu based kodi-headless docker.

@shypike
Copy link
Member

shypike commented Sep 9, 2016

@sparklyballs
Try an older official version first. Cheetah has good compatibility between versions.

@sparklyballs
Copy link
Author

i compiled python from scratch using the offiicial python alpine docker recipe and adding in the requirements for sab.

the notify issue remains with that, but interestingly the same issue then happens on the switches tab of the config section, which doesn't happen in the current linuxserver.io python base.

@shypike
Copy link
Member

shypike commented Sep 9, 2016

@sparklyballs Like thezoggy said, it seems to be connected to the amount of variables Cheetah has to substitute. So it must be that Cheetah crosses some internal limit inside Python. I have no clue what that limit would be. Incidently: Cheetah uses a file called _namemapper.so, which is compiled C. Can you try to remove that file? Cheetah will print an ugly warning, but it will function.

@sparklyballs
Copy link
Author

i see the warning, but the notifications tab is still not loading after removing the file.

@shypike
Copy link
Member

shypike commented Sep 9, 2016

I give up.
It works fine on any other platform, except this Alpine Docker.
Or does the problem also occur in Dockers based on other distros?

@sparklyballs
Copy link
Author

yeah, i don't get it either.
i'm convinced there's something in python itself that gets tripped by too many variables when it's running on alpine.

With various different compiles of python, different sections of the configuration tabs fail with the same error, again still on alpine.

I have a ubuntu xenial based image in a branch of my personal repo, i've been trying to put off using it, it's 100MB+ bigger than the alpine version, but it's looking increasingly like there may not be any option but to use it.

@shypike
Copy link
Member

shypike commented Sep 9, 2016

Well, it's really an Alpine issue. I just made a VMWare image of Alpine 3.4.3 64bit and it gives a segfault as soon as you open Notifications in SABnzbd.
Plain native Alpine, installed git, unpacked the Cheetah-tgz file (so without _namemapper), cloned SABnzbd repo, ran tools/make_mo.py. Start ./SABnzbd.py -p -s 0.0.0.0:8080 -b0

@sparklyballs
Copy link
Author

I've made a PR from my personal repository branch using xenial to the linuxserver image.

Thanks for your assistance.

@shypike
Copy link
Member

shypike commented Sep 9, 2016

@sparklyballs You're welcome. I really appreciate your effort to make SABnzbd available as a Docker image.

@shypike shypike closed this as completed Sep 9, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants