docker
healthcheck
ai_generated
true
health: starting (unhealthy)
ID: docker/healthcheck-failing
92%Fix Rate
94%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 24 | active | — | — | — |
Root Cause
Container's HEALTHCHECK command is failing — the application isn't ready or the check is misconfigured.
genericWorkarounds
-
93% success Debug the health check: docker inspect --format='{{.State.Health}}' <container>
Shows the last N health check results and exit codes
Sources: https://docs.docker.com/reference/dockerfile/#healthcheck
-
90% success Test the health command inside the container: docker exec <container> curl -f http://localhost:8080/health
Run the same command the HEALTHCHECK uses to see what fails
Dead Ends
Common approaches that don't work:
-
Removing HEALTHCHECK from Dockerfile
70% fail
Container appears healthy but may not actually be serving traffic
-
Setting the health check to always return 0
90% fail
Defeats the purpose; orchestrators think the container is always healthy
Error Chain
Frequently confused with: