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 and in-app restart with docker #2835

Open
thezoggy opened this issue Apr 15, 2024 · 0 comments
Open

sab and in-app restart with docker #2835

thezoggy opened this issue Apr 15, 2024 · 0 comments

Comments

@thezoggy
Copy link
Contributor

Description

generally you dont update/restart/do much with the app when you run it in a container like docker as you let the docker itself manage the life cycle of the app. however we do push restarting the app on people at times in our config or people just dont know better and restart sab there themselves.. and noticed that sab 'breaks' (basically doesnt fully restart) so gui isnt working.

after some debugging we found that restarting sab via glitter (just calling api restart) seems to always work just fine.
when you go to config>general and restart there.. that one will cause it sometimes for sab to get stuck and you have to rebuild the container to fix.

the other quirk restarting from the config>general is that we try to handle the scenario if users change http/https ports.. or enable http->https.. so on that restart we redirect them to the host:http port that we have in sab config..but that port not actually be what the user is using (as docker maintainers would use 8080 inside the container but users then remap outside container that port to something else) thus sab is redirecting them 8080 because thats what it knows and is wrong.

docker maintainer dev:

OK so this is interesting. If I recreate the container then the restart works from either the hamburger or the config/general page until the first time I do a restart from the config/general page (which works) but then any further restart attempts hang.
So I can restart endlessly from the main page and it always works
But as soon as I restart from config/general any subsequent restart attempt hangs until I recreate the container
I wonder if it's related to the redirect being wrong
If you restart from the homepage it refreshes the page correctly, but from config/general it tries to redirect to, in my case, http://sabnzbd.hostname:8080 which is not the URL I'm accessing it from and not one that would work under any circumstances.

--

so to fix this i'm suggesting that we just leverage the sabnzbd.DOCKER to know if sab is being ran in docker.
and if so then have our config restart be 'dumb' and restart like glitter does (just calling api command restart) rather than the config js do_restart method that tries to do redirect logic and more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant