coolify: [Bug]: Healthcheck not working as expected
Description
After a longer email conversation with andras about health checks i want to track the last bugs around health-checks i have here. Thanks for all the help so far 👍🏼
Before i had this configuration in my dockerfile:
HEALTHCHECK --interval=10s --timeout=3s --start-period=30s \
CMD curl -f http://localhost/healthz || exit 1
Now i have this configuration:
The two problems i have are:
- It looks like the provided route is not called. When i look into the logs, i don’t see any logs about that route. When i had the healthcheck in my dockerfile i could the the logs of the healthz route being called every 10 seconds
- I’m unsure about the
start period, because in my deployment logs the health check is performed immediately and the attempts are counted up. Is this value used?
In my health check i check the database connection. As a test i shut down the database. 5 minutes later the backend resource was still marked as “healthy” so i think the health check is not really executing
Minimal Reproduction (if possible, example repository)
Please let me know if you need a reproduction and what this should contain
Exception or Error
No response
Version
v4.0.0-beta.266
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 32 (7 by maintainers)
Same problem on 270
I will make a few changes. Coolify will check if curl or wget is available. If neither, it will try to use the proc filesystem for hc, or just pass healthy state. Not sure yet.
I had the exact same problem as @lewisdewsbury. Started having the healthcheck not working on version
beta.271on a resource that is build with a dockerfile. Dockerfile is based on a Bun base image. Addedapt-get install -y curlin the dockerfile and now the healthcheck runs fine again! thanks @lewisdewsbury for the solutionI have made some modifications in the upcoming version.
HEALTHCHECKfrom dockerfile and use it.