Skip to content
Latchkey

App Runner deployment "Health check failed" in CI

App Runner starts the new container revision and probes its health check before shifting traffic. The probe never returned healthy within the configured threshold, so the deployment fails and the prior revision stays live.

What this error means

A create-service or start-deployment in CI ends with the operation status FAILED and "Health check failed" in the App Runner event log for the new revision.

apprunner
[AppRunner] Deployment failed.
Health check failed on protocol HTTP path / port 8080.
Rolling back to the previous running configuration.

Common causes

The container does not listen on the configured port

App Runner probes the port set in the service config. If the app binds a different port (or only 127.0.0.1), the TCP/HTTP check never succeeds.

The health check path returns a non-2xx

An HTTP health check expects a 2xx from the configured path; a 404 or 500 from / fails the probe even though the process is running.

How to fix it

Align the listen port with the service port

  1. Confirm the port in the App Runner config matches the port the app binds.
  2. Bind to 0.0.0.0, not localhost, so the probe can reach it.
  3. Redeploy and watch the event log for a healthy revision.
Terminal
# app must listen on the configured port, on all interfaces
PORT=8080  # and app binds 0.0.0.0:8080

Point the health check at a 2xx route

Set the HTTP health check path to an endpoint that returns 200, or relax the protocol to TCP if no HTTP route is ready early.

Terminal
aws apprunner update-service --service-arn <arn> \
  --health-check-configuration Protocol=HTTP,Path=/healthz

How to prevent it

  • Expose a lightweight 200-returning health route and probe it.
  • Bind the server to 0.0.0.0 on the configured port.
  • Set a startup-friendly health check interval and threshold.

Frequently asked questions

What causes ""Health check failed""?
App Runner probes the port set in the service config. If the app binds a different port (or only 127.0.0.1), the TCP/HTTP check never succeeds.
How do I fix "Health check failed"?
Align the listen port with the service port

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card