speedtest-exporter
speedtest-exporter copied to clipboard
Healthcheck failures
Hello, first thanks for this awesome project.
I was running this project for a while in my homelab and works fine, but the application starts to show a healthcheck error. I've tested with older images (until v3.5.0) and the healthcheck still failing.
Here the log output:
docker run -d -p 9798:9798 miguelndecarvalho/speedtest-exporter:v3.5.4
2a18ceedb1c350a77fcaf19099a411df0839cd227d45d92222da4511ed7c5e63
docker logs -f 2a18
level=INFO datetime=2024-05-18 13:50:15,885 Starting Speedtest-Exporter on http://localhost:9798
{"Status":"unhealthy","FailingStreak":3,"Log":[{"Start":"2024-05-18T10:50:45.647089904-03:00","End":"2024-05-18T10:50:45.707512386-03:00","ExitCode":1,"Output":"Connecting to localhost:9798 ([::1]:9798)\nwget: can't connect to remote host: Connection refused\n"},{"Start":"2024-05-18T10:51:15.708851162-03:00","End":"2024-05-18T10:51:15.799501015-03:00","ExitCode":1,"Output":"Connecting to localhost:9798 ([::1]:9798)\nwget: can't connect to remote host: Connection refused\n"},{"Start":"2024-05-18T10:51:45.800123117-03:00","End":"2024-05-18T10:51:45.855748254-03:00","ExitCode":1,"Output":"Connecting to localhost:9798 ([::1]:9798)\nwget: can't connect to remote host: Connection refused\n"}]}
Docker environment info:
docker info
Client: Docker Engine - Community
Version: 26.1.2
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.14.0
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.27.0
Path: /usr/libexec/docker/cli-plugins/docker-compose
Using a custom healthcheck configuration pointing to 0.0.0.0 instead of localhost works fine:
docker inspect --format '{{json .Config.Healthcheck }}' fda
{"Test":["CMD-SHELL","wget --no-verbose --tries=1 --spider http://0.0.0.0:9798/"],"Interval":30000000000,"Timeout":15000000000,"StartPeriod":60000000000,"Retries":3}
docker inspect --format '{{json .State.Health }}' fda
{"Status":"healthy","FailingStreak":0,"Log":[{"Start":"2024-05-18T11:25:31.440087371-03:00","End":"2024-05-18T11:25:31.506016765-03:00","ExitCode":0,"Output":"Connecting to 0.0.0.0:9798 (0.0.0.0:9798)\nremote file exists\n"},{"Start":"2024-05-18T11:26:01.507290157-03:00","End":"2024-05-18T11:26:01.590485589-03:00","ExitCode":0,"Output":"Connecting to 0.0.0.0:9798 (0.0.0.0:9798)\nremote file exists\n"},{"Start":"2024-05-18T11:26:31.591690522-03:00","End":"2024-05-18T11:26:31.678995386-03:00","ExitCode":0,"Output":"Connecting to 0.0.0.0:9798 (0.0.0.0:9798)\nremote file exists\n"},{"Start":"2024-05-18T11:27:01.679600908-03:00","End":"2024-05-18T11:27:01.761742513-03:00","ExitCode":0,"Output":"Connecting to 0.0.0.0:9798 (0.0.0.0:9798)\nremote file exists\n"},{"Start":"2024-05-18T11:27:31.762580276-03:00","End":"2024-05-18T11:27:31.81281502-03:00","ExitCode":0,"Output":"Connecting to 0.0.0.0:9798 (0.0.0.0:9798)\nremote file exists\n"}]}
Also, I've installed curl
to check if this issue happens with it too, but looks like only happens with wget
command:
/app # wget http://localhost:9798
Connecting to localhost:9798 ([::1]:9798)
wget: can't connect to remote host: Connection refused
/app # curl http://localhost:9798
<h1>Welcome to Speedtest-Exporter.</h1>Click <a href='/metrics'>here</a> to see metrics./app #
If this is an issue that happens with other users too, I can open a PR changing the healthcheck address in Dockerfile.
Also can be similar to this one: #212