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:

Bildschirmfoto 2024-04-26 um 11 01 05

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: open
  • Created 2 months ago
  • Comments: 17 (4 by maintainers)

Most upvoted comments

I have made some modifications in the upcoming version.

  1. The start period and check interval are fixed. There was a strange bug that caused them to be ignored.
  2. When you define a Docker image or Dockerfile buildpack, the health check will be turned off by default, as it cannot be determined automatically what to check.
  3. Parse HEALTHCHECK from dockerfile and use it.

Same problem on 270