Skip to content

fix(docker): use HEAD probe so SSE heartbeat doesn't time out healthcheck#1182

Merged
magyargergo merged 1 commit into
abhigyanpatwari:mainfrom
R09722akaBennett:fix/docker-healthcheck-sse-timeout
Apr 29, 2026
Merged

fix(docker): use HEAD probe so SSE heartbeat doesn't time out healthcheck#1182
magyargergo merged 1 commit into
abhigyanpatwari:mainfrom
R09722akaBennett:fix/docker-healthcheck-sse-timeout

Conversation

@R09722akaBennett

Copy link
Copy Markdown
Contributor

Bug: docker compose up -d fails with dependency failed to start: container gitnexus-server is unhealthy even though the server is running and serving requests.

Root cause: the compose healthcheck uses curl -fsS http://localhost:4747/api/heartbeat, but that endpoint returns Content-Type: text/event-stream and keeps the connection open indefinitely. The 200 status arrives instantly, but curl reads until the body ends — which it never does — so every probe trips the 5s timeout and Docker marks the container unhealthy. gitnexus-web then refuses to start because of its condition: service_healthy dependency.

Fix: switch the probe to curl -fsSI (HEAD). Same 200, no body, curl exits cleanly. Verified locally: gitnexus-server reports healthy and gitnexus-web starts.

…heck

`/api/heartbeat` is a `text/event-stream` endpoint that keeps the
connection open and streams events. `curl -fsS` reads until the body
ends, which never happens, so every probe hits the 5s timeout and
Docker marks the server unhealthy — which in turn blocks `gitnexus-web`
from starting via `condition: service_healthy`.

Switch to `curl -fsSI` (HEAD): the server still returns 200 instantly,
but there's no body to read so curl exits cleanly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 29, 2026

Copy link
Copy Markdown

@R09722akaBennett is attempting to deploy a commit to the NexusCore Team on Vercel.

A member of the Team first needs to authorize it.

@magyargergo magyargergo merged commit 07629a3 into abhigyanpatwari:main Apr 29, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants