Health check not respecting grace period

My config looks like this:

[checks]
  [checks.api_v1_health]
    grace_period = "10s"
    interval = "20s"
    method = "get"
    path = "/api/v1"
    port = 3000
    timeout = "10s"
    type = "http"

And here is the health check in practice:

Machine spinup start --> 2025-01-10T11:51:31.221 app[6830165a1370d8] ams [info] INFO Starting init (commit: 1df1d0a0)...

2025-01-10T11:51:31.354 app[6830165a1370d8] ams [info] INFO Preparing to run: `docker-entrypoint.sh bash ./entrypoint.sh` as root
2025-01-10T11:51:31.356 app[6830165a1370d8] ams [info] INFO [fly api proxy] listening at /.fly/api
2025-01-10T11:51:31.420 runner[6830165a1370d8] ams [info] Machine started in 977ms
2025-01-10T11:51:31.421 proxy[6830165a1370d8] ams [info] machine started in 982.347736ms
2025-01-10T11:51:31.561 app[6830165a1370d8] ams [info] 2025/01/10 11:51:31 INFO SSH listening listen_address=[fdaa:d:1030:a7b:3d:4c0:6b2f:2]:22 dns_server=[fdaa::3]:53

1 second after "Starting init" (fails)--> 2025-01-10T11:51:32.959 health[6830165a1370d8] ams [error] Health check on port 3000 has failed. Your app is not responding properly.

2025-01-10T11:51:33.427 app[6830165a1370d8] ams [info] Listening: http://0.0.0.0:3000
2025-01-10T11:51:34.138 proxy[6830165a1370d8] ams [info] machine became reachable in 2.716363398s

What’s happening here?

2 Likes