Closed sbosman84 closed 2 years ago
Currenlty it's not completly clear when the issue appears. The first thing I'd like to address:
Looking at the last log it seems that the webserver is running like it should. Can you start the container and then execute this command:
docker exec -ti dsmr bash -c 'curl --connect-timeout 15 --silent --show-error --fail "http://localhost/about" -o /dev/null -w "%{http_code}\n"'
If the output is 200, then we at least know the webinterface is running properly within the container, from there on we can investigate further.
The thing that's not completly clear to me is the curl error. When do you see this error? After restarting the container or after trying to run the reload script?
Did you try:
docker system prune -a -f
To clean up some possible Docker leftovers? Are you using portainer by any chance?
It's not related to the issue you are facing, but indeed there was an error in the healthcheck :) Fixed it and creating a new release.
-> docker inspect --format='{{json .State.Health}}' dsmr | jq
{
"Status": "unhealthy",
"FailingStreak": 16298,
"Log": [
{
"Start": "2021-12-24T08:06:39.097925957+01:00",
"End": "2021-12-24T08:06:39.174677066+01:00",
"ExitCode": 1,
"Output": "curl: option --connect-timeout 15 --silent --show-error --fail: is unknown\ncurl: try 'curl --help' or 'curl --manual' for more information\n"
},
{
"Start": "2021-12-24T08:06:49.537514638+01:00",
"End": "2021-12-24T08:06:49.611489137+01:00",
"ExitCode": 1,
"Output": "curl: option --connect-timeout 15 --silent --show-error --fail: is unknown\ncurl: try 'curl --help' or 'curl --manual' for more information\n"
},
{
"Start": "2021-12-24T08:06:59.886476807+01:00",
"End": "2021-12-24T08:06:59.957856964+01:00",
"ExitCode": 1,
"Output": "curl: option --connect-timeout 15 --silent --show-error --fail: is unknown\ncurl: try 'curl --help' or 'curl --manual' for more information\n"
},
{
"Start": "2021-12-24T08:07:10.137309887+01:00",
"End": "2021-12-24T08:07:10.215368499+01:00",
"ExitCode": 1,
"Output": "curl: option --connect-timeout 15 --silent --show-error --fail: is unknown\ncurl: try 'curl --help' or 'curl --manual' for more information\n"
},
{
"Start": "2021-12-24T08:07:20.531156376+01:00",
"End": "2021-12-24T08:07:20.603078468+01:00",
"ExitCode": 1,
"Output": "curl: option --connect-timeout 15 --silent --show-error --fail: is unknown\ncurl: try 'curl --help' or 'curl --manual' for more information\n"
}
]
}
I'm indeed using portainer, so your last comment explains the health check output indeed.
Just ran the command:
docker exec -ti dsmr bash -c 'curl --connect-timeout 15 --silent --show-error --fail "http://localhost/about" -o /dev/null -w "%{http_code}\n"'
But got an 302 reponse. That triggered me that it might be my traefik configuration. But after removing this configuration I still got an 302.
Aaah, then Portainer is causing the issue. Portainer sucks π, it messes up things when Docker images contain big changes. Reason is unknown to me.
Maybe this will help or the docker system prune -a -f
command can help here.
https://github.com/xirixiz/dsmr-reader-docker/issues/242 https://github.com/xirixiz/dsmr-reader-docker/issues?q=is%3Aissue+is%3Aclosed+portainer
New release is comming up in about half an hour, where at least the health check is working properly.
Healthcheck at least fixed in the latest release now:
-> docker inspect --format='{{json .State.Health}}' dsmr | jq
{
"Status": "healthy",
"FailingStreak": 0,
"Log": [
{
"Start": "2021-12-24T13:37:36.766172379+01:00",
"End": "2021-12-24T13:37:37.70885549+01:00",
"ExitCode": 0,
"Output": "HTTP_200"
},
{
"Start": "2021-12-24T13:37:42.779393686+01:00",
"End": "2021-12-24T13:37:42.881481349+01:00",
"ExitCode": 0,
"Output": "HTTP_200"
},
{
"Start": "2021-12-24T13:37:47.93278271+01:00",
"End": "2021-12-24T13:37:48.039101163+01:00",
"ExitCode": 0,
"Output": "HTTP_200"
},
{
"Start": "2021-12-24T13:37:53.084808646+01:00",
"End": "2021-12-24T13:37:53.193379264+01:00",
"ExitCode": 0,
"Output": "HTTP_200"
},
{
"Start": "2021-12-24T13:37:58.215012823+01:00",
"End": "2021-12-24T13:37:58.328030048+01:00",
"ExitCode": 0,
"Output": "HTTP_200"
}
]
}
Thanks! I upgraded to the latest version and the healthcheck is working again!
I also figured out what my issue was. I got the 302 when executing the following command:
docker exec -ti dsmr bash -c 'curl --connect-timeout 15 --silent --show-error --fail "http://localhost/about" -o /dev/null -w "%{http_code}\n"'
Because it was redirecting the /about towards /admin/login/?next=/about due to the authentication I had enabled for the whole page.
This triggered me to check my Traefik config again and noticed that (probably due to an upgrade as well) it requires that I need to specify a port as well. Which it didn't need before. :-(
So long story -> short; this was a Traefik configuration issue and not a DSMR or Portainer issue. Thanks for the support and also for solving the health check issue this quick. My dashboards are green again and DSMR is working. :-)
Good to hear and also good to hear it wasn't portainer π
Thanks for providing the information!
Support guidelines
I've found an issue and checked that ...
Description
After recreating the container based on the latest image (created at 2021-12-21 22:41:09). It won't start the webinterface part.
The latest output of the container keeps on repeating: curl: option --connect-timeout 15 --silent --show-error --fail: is unknown curl: try 'curl --help' or 'curl --manual' for more information
After running the reload.sh script inside the container it shows that the dsmr_webinterface is not running as well:
Expected behaviour
The container used to start normal before. But after the upgrade it doesn't start the web interface.
Actual behaviour
After the upgrade to the latest image version to start as normal
Steps to reproduce
Docker info
Version
Docker compose version (type
docker-compose --version
): docker-compose version 1.25.0, build unknown docker-py version: 4.1.0 CPython version: 3.8.10 OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020System info (type
uname -a
):Linux thor 5.4.0-1047-raspi #52-Ubuntu SMP PREEMPT Wed Nov 24 08:16:38 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
Docker compose
Container logs
[s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] 10-set-app-defaults: executing...
[ INFO ] DSMR release: 4.19.0
[ INFO ] Creating log directory...
[ INFO ] Setting architecture requirements...
[ INFO ] ARM Architecture
[ INFO ] Verifying if the DSMR web credential variables have been set...
[ INFO ] Verifying database connectivity to host: postgres with port: 5432...
[ INFO ] Database connectivity successfully verified!
[ INFO ] Running post configuration... Operations to perform: Apply all migrations: admin, auth, contenttypes, dsmr_api, dsmr_backend, dsmr_backup, dsmr_consumption, dsmr_datalogger, dsmr_dropbox, dsmr_frontend, dsmr_influxdb, dsmr_mindergas, dsmr_mqtt, dsmr_notification, dsmr_pvoutput, dsmr_stats, dsmr_weather, sessions Running migrations: No migrations to apply. 563 static files copied to '/var/www/dsmrreader/static'. Updating password of superuser "admin" Deactivating any other existing superusers
[ INFO ] Checking for NGINX SSL configuration...
[ INFO ] ENABLE_NGINX_SSL is disabled, nothing to see here. Continuing...
[ INFO ] Checking for HTTP AUTHENTICATION configuration... [ INFO ] ENABLE_HTTP_AUTH is disabled, nothing to see here. Continuing...
[ INFO ] Configuring DSMR in receiver datalogger mode.... [cont-init.d] 10-set-app-defaults: exited 0. [cont-init.d] done. [services.d] starting services Starting DSMR Reader - webinterface... Starting DSMR Reader - backend... Starting DSMR Reader - nginx... [services.d] done. [2021-12-23 18:30:23 +0100] [240] [INFO] Starting gunicorn 20.1.0 [2021-12-23 18:30:23 +0100] [240] [INFO] Listening at: unix:/var/tmp/gunicorn--dsmr_webinterface.socket (240) [2021-12-23 18:30:23 +0100] [240] [INFO] Using worker: sync [2021-12-23 18:30:23 +0100] [268] [INFO] Booting worker with pid: 268
Additional info
No response