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

Container crashing without any apparent reason #107

Closed
fl0wfr opened this issue Jan 21, 2023 · 39 comments
Closed

Container crashing without any apparent reason #107

fl0wfr opened this issue Jan 21, 2023 · 39 comments

Comments

@fl0wfr
Copy link

fl0wfr commented Jan 21, 2023

Specifications

  • Image hash or version: PR-106 and latest
  • Platform: amd64
  • Subsystem:

Expected Behavior

Simply start and feed FR24/PiAware

Actual Behavior

Crash loop without any error

Steps to Reproduce the Problem

  1. Start the container with this command: docker run -d -p 8080:8080 -p 8754:8754
    --device=/dev/bus/usb:/dev/bus/usb
    -v "/etc/localtime:/etc/localtime:ro"
    -e "FR24FEED_FR24KEY=<>"
    -e "PIAWARE_FEEDER_DASH_ID=<>"
    -e "HTML_SITE_LAT=<>"
    -e "HTML_SITE_LON=<>"
    -e "HTML_SITE_NAME=<>"
    -e "SERVICE_ENABLE_ADSBEXCHANGE=false"
    -e "MLAT_EXACT_LAT=<>"
    -e "MLAT_EXACT_LON=<>"
    -e "MLAT_ALTITUDE_MSL_METERS=<>"
    -e "SERVICE_ENABLE_PLANEFINDER=false"
    -e "TZ=Etc/GMT+0"
    --tmpfs /run:exec,size=32M
    --tmpfs /planefinder/log:exec,size=32M
    --tmpfs /usr/lib/fr24/public_html/data:size=32M
    --restart=unless-stopped
    --network=myNetwork
    --name fr24feed
    thomx/fr24feed-piaware:PR-106
  2. USB Tuner is: Bus 002 Device 003: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T

I've attached some logs.
fr24feed.log

@Thom-x
Copy link
Owner

Thom-x commented Jan 23, 2023

Could you try disabling services one by one to see the culprit ?

@fl0wfr
Copy link
Author

fl0wfr commented Jan 23, 2023

Hi Thom-x, thanks for your reply
Seems to come from SERVICE_ENABLE_HTTP, no issue with :
SERVICE_ENABLE_DUMP1090
SERVICE_ENABLE_PIAWARE
SERVICE_ENABLE_FR24FEED
set to true

@Thom-x
Copy link
Owner

Thom-x commented Jan 23, 2023

Ok, at least everything else is OK.
Could you try to start manually the HTTP server by executing the same command ?

/thttpd -D -h 0.0.0.0 -p 8080 -d /usr/lib/fr24/public_html -l - -M 60 2>&1 | mawk -W interactive '{printf "%c[32m[http]%c[0m %s\n", 27, 27, $0}'

@fl0wfr
Copy link
Author

fl0wfr commented Jan 23, 2023

No return of the command, I don't have ps in the image so I can't check if it's running, but I doubt it runs. Also, no message in logs following the start of thttpd. And no access to the page with the published port.

@Thom-x
Copy link
Owner

Thom-x commented Jan 23, 2023

Probably not working (it should be blocking). You could check the exit code $?.
Could you change the port by a random one -p 4242?

@fl0wfr
Copy link
Author

fl0wfr commented Jan 23, 2023

Same issue with port 4242, and I get a "1" exit code.

@Thom-x
Copy link
Owner

Thom-x commented Jan 23, 2023

Strange, I would suggest changing path, ports, etc to see what's wrong.
I'm not sure if I can help more. 😕

@fl0wfr
Copy link
Author

fl0wfr commented Jan 23, 2023

Okay, seems strange, I just popped the container on a new host, no persistent storage, basic options. In the meantime I will run without the WebUI.
Thanks anyway!

@Thom-x
Copy link
Owner

Thom-x commented Jan 23, 2023

Sorry for that :/

@fl0wfr
Copy link
Author

fl0wfr commented Jan 23, 2023

No worries, you already did a great work, thanks!

@rpavlyuk
Copy link

rpavlyuk commented Feb 9, 2023

I can confirm the same problem: as soon as you enable SERVICE_ENABLE_HTTP -- it crashes. Starting thttpd inside the container crashes it as well.

@Thom-x, if you can provide any instructions on how and where to check thttpd logs (I'm RedHat guy, not Debian :)) so I can troubleshot the issue.

@Thom-x
Copy link
Owner

Thom-x commented Feb 14, 2023

@Thom-x, if you can provide any instructions on how and where to check thttpd logs (I'm RedHat guy, not Debian :)) so I can troubleshot the issue.

thttpd is logging on stdout (no daemon), what strange is that I'm also using it on amd64 without error.

@Littlejth
Copy link

This is also occurring for me on my PI Zero 2 W now. Host OS is Manjaro ARM aarch64. I can do any troubleshooting steps that might be needed to get to the bottom of this :) Only thing common I can see with fl0wfr is the same RTL2838 SDR but not sure how that could affect thttpd.

@Thom-x
Copy link
Owner

Thom-x commented Mar 2, 2023

@Littlejth Did you try starting the container with only HTTPD enabled ?

@Littlejth
Copy link

With only the HTTP service enabled, it still just starts and stops again. Attached is the log file of a single time I attempted to start it after creating the container with only HTTP enabled.

fr24feed-piaware.log

@Thom-x
Copy link
Owner

Thom-x commented Mar 3, 2023

I created a branch to switch from thttpd to httpd, I'll let you now when the image is available so you can test and give me the feedback #114.

@Thom-x Thom-x linked a pull request Mar 3, 2023 that will close this issue
@Thom-x
Copy link
Owner

Thom-x commented Mar 4, 2023

You can test it with docker pull thomx/fr24feed-piaware:PR-114

@fl0wfr
Copy link
Author

fl0wfr commented Mar 4, 2023

Hello Thom-x,
Same issue, and I see this message in logs:
[http] /httpd-foreground: 7: exec: httpd: not found

@Thom-x
Copy link
Owner

Thom-x commented Mar 4, 2023

What is the content of /usr/local/apache2/bin it's probably not the same between different arch ?

@fl0wfr
Copy link
Author

fl0wfr commented Mar 4, 2023

Screenshot_20230304-173130-01

@Thom-x
Copy link
Owner

Thom-x commented Mar 4, 2023

Ok funny, it's probably not compatible for all arch...
I need to find another candidate 😄.

@Littlejth
Copy link

It did start working on my aarch64 pi but obviously not a great solution if it doesn't work for AMD64 as well :)

@MaxWinterstein
Copy link
Contributor

@fl0wfr which docker version are you running? v23?

Users of my Home Assistant Add-On raised the same issue: MaxWinterstein/homeassistant-addons#149

I guess, thttpd does what is explained here: https://developers.home-assistant.io/blog/2023/04/13/new_limits_for_add_ons/

With Home Assistant OS 10, we update to the latest Docker release 23.0. With the new Docker version the maximum number of open file descriptors for add-ons changed to infinity (sort of).
...
Also in all three cases, memory got allocated dynamically depending on the number of open file descriptors allowed (which can be determined via prlimit64 syscall, which returns a limit of 1073741816).

@fl0wfr
Copy link
Author

fl0wfr commented Apr 20, 2023

@MaxWinterstein yes I'm using Docker 23.0.4

@MaxWinterstein
Copy link
Contributor

MaxWinterstein commented Apr 20, 2023

@fl0wfr no linux memory expert here, but can you give the ulimit idea a try?

https://docs.docker.com/engine/reference/commandline/run/#ulimit

Something like

docker run --ulimit nofile=1048576 ......

might be worth a shot

@fl0wfr
Copy link
Author

fl0wfr commented Apr 20, 2023

@MaxWinterstein it works now. That should do the trick for now, thanks.

@MaxWinterstein
Copy link
Contributor

@Thom-x this might hit more and more people who switch to docker 23

I created #118 as quickfix, but switching to some more recent webserver might be a better approach ;)

@Thom-x
Copy link
Owner

Thom-x commented Apr 20, 2023

Thanks, I'll do a PR image for testing quickly and release of it's all good 👍 !

@MaxWinterstein
Copy link
Contributor

Thanks, I'll do a PR image for testing quickly and release of it's all good 👍 !

Awesome! Can't really test it myself here, hope it works 🤞

@fl0wfr
Copy link
Author

fl0wfr commented Apr 20, 2023

You let me know and I will test it ;)

@CoMPaTech
Copy link

I still ran into issues with Max' update on his HA-addon. Still OOM errors on thttp. See screenshot in MaxWinterstein/homeassistant-addons#149 (comment) if helpful

@MaxWinterstein
Copy link
Contributor

I still ran into issues with Max' update on his HA-addon. Still OOM errors on thttp. See screenshot in MaxWinterstein/homeassistant-addons#149 (comment) if helpful

I guess the fix in my addon is placed wrongly. I think s6 starts the httpd stuff in another shell/session/thread/... where my adjustment is not read.

#118 is made a little bit different

@Thom-x
Copy link
Owner

Thom-x commented Apr 25, 2023

You can try with the image thomx/fr24feed-piaware:PR-118

@fl0wfr
Copy link
Author

fl0wfr commented Apr 26, 2023

It works, thank you :)

@Thom-x
Copy link
Owner

Thom-x commented Apr 26, 2023

Nice 😄 let's do a release then.

@Thom-x
Copy link
Owner

Thom-x commented Apr 26, 2023

It's now available with 1.21.0 or latest 👍

@Thom-x Thom-x closed this as completed Apr 26, 2023
@TheDom42
Copy link

It's now available with 1.21.0 or latest 👍

Running Unraid 6.11.5 (latest stable version), which has Docker v20.10.21.

At least on my system, this update to 1.21.0 does not seem to work. After I update, my (otherwise so far completely stable) container stops automatically without any error logged. This happens a few seconds after start of the container.

Downgrading back to v1.20.0 fixes the issue, so I would assume, that this is related to this issue? If I have time later on, I can try the dedicated PR tag/image, if that gives a clearer picture.

@MaxWinterstein
Copy link
Contributor

It works, thank you :)

@fl0wfr did you see any difference with the cpu usage?

@fl0wfr
Copy link
Author

fl0wfr commented Apr 27, 2023

It works, thank you :)

@fl0wfr did you see any difference with the cpu usage?

No, around 3 and 7% CPU usage, running on a Celeron N5105.

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

Successfully merging a pull request may close this issue.

7 participants