deunhealth
deunhealth copied to clipboard
Recognition of "deunhealth.restart.on.unhealthy"
I've running the latest version of deunhelath in a docker container through docker-compose stack. The version of docker and compose are the latest as well. In the stacks of the containers that I want to restart when becoming unhealthy, I've added the label as follows:
labels:
deunhealth.restart.on.unhealthy: true
Despite the containers work fine and labels have been added correctly, deunhealth does not seem to recognise the labels, being the deunhealth's log as follows:
2022/06/25 14:00:23 INFO healthcheck: listening on 127.0.0.1:9999
2022/06/25 14:00:23 INFO Monitoring 0 containers to restart when becoming unhealthy
2022/06/25 14:00:23 INFO New labeled containers will be automatically detected
I don't know if I'm doing something wrong.
Thanks in advance.
Can you share your deunhealth full logs and docker-compose.yml please?
All my logs are these:
========================================
============== deunhealth ==============
=========== Made with ❤️ by ============ =========== github.com/qdm12 ===========
========================================
Running version latest built on 2021-11-28T12:51:56Z (commit 6f26ebf)
🔧 Need help? https://github.com/qdm12/deunhealth/discussions/new 🐛 Bug? https://github.com/qdm12/deunhealth/issues/new ✨ New feature? https://github.com/qdm12/deunhealth/issues/new ☕ Discussion? https://github.com/qdm12/deunhealth/discussions/new 💻 Email? [email protected] 💰 Help me? https://www.paypal.me/qmcgaw https://github.com/sponsors/qdm12 2022/06/27 18:34:18 INFO healthcheck: listening on 127.0.0.1:9999 2022/06/27 18:34:18 INFO Monitoring 0 containers to restart when becoming unhealthy 2022/06/27 18:34:18 INFO New labeled containers will be automatically detected
And my docker-compose is:
version: "3.7" services: deunhealth: container_name: deunhealth image: qmcgaw/deunhealth volumes: - '/var/run/docker.sock:/var/run/docker.sock' environment: - LOG_LEVEL=info - HEALTH_SERVER_ADDRESS=127.0.0.1:9999 - TZ=Europe/Madrid network_mode: "none" restart: always
Thanks again. Regards.
When the label "deunhealth.restart.on.unhealthy" is created manually, it works. The problem is doing one by one for each container.
I have exactly the same issue on Raspberry Pi 3b (ARM_V7). Does not work when labels are created using docker-compose, have to add them manually.
Make sure you are using one of these two modes to add the label in the docker-compose:
...
labels:
deunhealth.restart.on.unhealthy: "true"
...
or
...
labels:
- deunhealth.restart.on.unhealthy=true
...
Do not use this way:
...
labels:
deunhealth.restart.on.unhealthy: true
...
because docker-compose would replace the boolean true with "True"
and that would not work it seems.
Perhaps deunhealth could check for all variants?