Health check failed: app not listening on its port
THE SHORT ANSWER
A deploy fails its health check when the platform starts the new version and gets no healthy answer in time. There are four reasons: nothing listens on the port the platform probes, the process exits, the app takes longer to start than the platform waits, or it answers the check path with an error status such as 404. Render logs "No open ports detected" and fails the deploy, Railway marks the deploy failed when the healthcheck path returns no 2xx within 300 seconds, Fly warns "The app is not listening on the expected address", and Heroku kills a web process that hasn't bound to $PORT within 60 seconds (R10). Read the log to see which of the four it is: then listen on 0.0.0.0 and $PORT, move slow work out of startup, or point the health check at a route that returns 200.
What does a failed health check mean?
Most platforms don't send traffic to a new version the moment it starts. They start the container, then connect to the port they expect your app on, or request a health check path, until it answers or a timer runs out. If the timer wins, the deploy fails. On Render, Railway and EthioDeploy the previous version keeps serving while this happens, so a failed check usually means “your change didn't go live”, not “your site is down”.
The check fails for one of four reasons, and the log tells you which:
- Nothing on the port: the app listens on
127.0.0.1, or on a fixed port that isn't the one inPORT. The app's own log looks healthy. - The process exits: a crash at startup (missing env var, missing module, no database), or a start command that finishes, like a migration with no server after it.
- Too slow: the app does work before it listens: migrations, seeding, loading a model, a JVM on a small CPU share.
- Wrong answer: the server is up, but the check path returns 404 (an API with no
/route), 401 (login required) or 400 (a framework rejecting the Host header).
What does each platform show?
| Platform | What it checks | How long it waits | What you see |
|---|---|---|---|
| Render | An open port on 0.0.0.0; a health check path if you set one | 15 minutes for the health check path | No open ports detected, continuing to scan..., then ==> Timed out and ==> Deploy failed |
| Railway | The healthcheck path, if configured, on PORT; any 2xx passes | 300 seconds | failed with service unavailable or failed with status 400, and the deploy is marked failed |
| Fly.io | That the app listens on internal_port from fly.toml | Depends on your checks | WARNING The app is not listening on the expected address and will not be reachable by fly-proxy. |
| Heroku | That the web process binds to $PORT | 60 seconds (90 for Java) | Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch, then H10 on requests |
| EthioDeploy | GET on the Health Check Path (default /) on port 3000; 2xx or 3xx passes | 30 seconds by default | Health check timed out after 30000ms. plus the reason, then the app's own logs |
A few details from each platform's docs:
- Render: “If Render fails to detect a bound port, your web service's deploy fails.” For a health check path it accepts a 2xx or 3xx within five seconds per request, and if that hasn't happened within 15 minutes it “cancels the deploy and continues routing traffic to your service's existing instances”. The default
PORTis 10000. - Railway only runs the check when you set a healthcheck path, and only during the deploy: it “does not monitor the healthcheck endpoint after the deployment has gone live”. Raise the wait with
RAILWAY_HEALTHCHECK_TIMEOUT_SEC. The requests come from the hosthealthcheck.railway.app, so an app that validates the Host header returns 400 until you allow it. - Fly: with
internal_port = 8080, the app has to listen on0.0.0.0:8080. An app on 3000 withinternal_portat 8080 gets the warning above. Machine checks, which run only during deploys, stop the deployment when they fail. - Heroku kills the process after R10 and marks the dyno crashed, so visitors then see H10. R10 isn't emitted for Fir-generation apps. A separate H20 means no web dyno came up within 75 seconds, platform work included.
Nothing is listening on the port
This is the most common case. Find the line where your app says what it listens on and compare it with what the platform expects:
# Wrong for a container: only reachable from inside it Uvicorn running on http://127.0.0.1:8000 Server listening on http://localhost:5000 # Right: all interfaces, on the platform's port Uvicorn running on http://0.0.0.0:3000 Listening at: http://0.0.0.0:10000
The fix is to listen on 0.0.0.0 and on the port in the PORT environment variable. Each framework's default and the exact start command are in 502 Bad Gateway after deploy: bind to 0.0.0.0 and $PORT. With a Dockerfile, also check that the port you EXPOSE and the port the platform probes are the same one; on Fly, that internal_port matches.
The process exits before it answers
If the container keeps restarting, the health check can't pass, and the real error is in the app's output just before it stops. Look for:
- A stack trace: a missing env var,
Cannot find moduleorModuleNotFoundError(see ModuleNotFoundError after deploy), or a database it can't reach (see Can't reach database server). - Exit code 0: the start command finished. A web service's start command has to keep running.
python manage.py migrateon its own exits;python manage.py migrate && gunicorn ...doesn't. - Exit code 137: the process was killed, usually for going over its memory limit. See exit code 137.
The app takes too long to start
The timer starts when the container does, so everything your start command runs before the server listens counts: migrations, seeding, building assets, downloading or loading a model. A small CPU share stretches all of it. In our test, a small Spring Boot app took 13 seconds to start with 256 MB and half a CPU, and 23 seconds once JDBC and Postgres were added.
- Build assets in the build step, not at startup.
- Keep startup migrations fast, and run data backfills as a separate job.
- Load large models or caches after the server starts listening, in the background.
- If startup really is slow, raise the wait where the platform allows it: Railway's
RAILWAY_HEALTHCHECK_TIMEOUT_SEC, or Heroku's boot timeout tool on Cedar apps, which Heroku calls a temporary solution.
The app answers, but with the wrong status
Health checks only accept success codes: 2xx or 3xx on Render and EthioDeploy, 2xx only on Railway. A healthy app fails anyway when its root path returns:
- 404, because it's an API with no route at
/. - 401 or 403, because everything sits behind a login. On Railway a redirect to
/loginfails too. - 400, because the framework checks the Host header. Django answers 400 for a host missing from
ALLOWED_HOSTS; see Django DisallowedHost behind a proxy. - 500, because the page needs something that is broken, often the database.
Add a cheap route that always returns 200, and set it as the health check path:
// Express
app.get("/healthz", (req, res) => res.send("ok"));
# FastAPI
@app.get("/healthz")
def healthz():
return {"ok": True}Keep it light. A health check that queries the database fails every deploy while the database is down, which may be what you want, but it also makes a slow query look like a dead app.
What happens on EthioDeploy?
Every web service gets PORT=3000 and HOSTNAME=0.0.0.0, set after your own variables so they always win. After the new container starts, the deploy sends a GET to its Health Check Path (default /) on port 3000 once a second, with your project's public hostname as the Host header. Each request gets 3 seconds. A 2xx or 3xx passes, or exactly the codes you list under Accepted Status Codes in Settings. The deploy waits 30 seconds for a pass, longer on servers with slower CPUs; the log line shows the exact wait.
When it fails, the deploy log says which of the four cases it was. Nothing answered:
Waiting for new container to pass its health check... Health check timed out after 30000ms. The app never answered on port $PORT. Make sure it listens on 0.0.0.0 and reads the PORT env var.
The app answered with the wrong status:
Health check timed out after 30000ms. The app is running, but GET / returned 404 (expected a 2xx or 3xx status). If / isn't meant to return that, set a Health Check Path in Settings to a route that does, such as /healthz.
The process exited, which fails the check at once instead of waiting out the timer:
Health check failed. The app's process exited (code 1) and was restarted 1 time. Check the container logs above for the error.
Then the deploy stops the new container and prints its output, so you don't have to catch it before it's gone:
Health check failed — leaving previous deployment live, rolling back this one. --- new container logs (42 lines) --- ... --- end new container logs --- Likely cause: ... ERROR: New container failed its health check.
The Likely cause line appears when the logs match a known problem: a server listening on localhost, a missing module, a database it can't reach, a missing or invalid Laravel APP_KEY, or running out of memory. With a Dockerfile that exposes another port, the build log warns before the deploy even starts: “Your Dockerfile exposes port 8080, but EthioDeploy routes traffic to port 3000.”
Your previous deployment keeps serving throughout. On a project's first deploy there is nothing to fall back to, so the project stays offline until a deploy passes. The same check runs when a Free app wakes from sleep, so a Health Check Path that works for deploys works for wake-ups too. Worker services have no port and skip the HTTP check: the deploy only waits a few seconds to see that the process stays up. Start commands per framework are in the Express, Django, FastAPI, Laravel and Spring Boot guides.
Questions
The platform started the new version but never got a healthy answer from it in time: nothing was listening on the expected port, the process crashed, it was still starting when the timer ran out, or the check path returned an error status. The deploy fails and, on most platforms, the previous version keeps serving.
Render's scan found nothing listening on 0.0.0.0. Usually the app binds to localhost or to a port Render doesn't see. Listen on 0.0.0.0 and on the PORT environment variable (10000 by default on Render). If the service doesn't serve HTTP at all, create it as a background worker.
Railway sends the check to the port in PORT, from the hostname healthcheck.railway.app, and accepts only 2xx. An app listening on another port gets "service unavailable", an app that validates the Host header returns 400, and a check path that redirects to a login page fails because 3xx doesn't count.
Heroku's web process didn't bind to $PORT within 60 seconds of launch (90 for some Java apps), so Heroku killed it and marked the dyno crashed. Requests then show H10 App crashed. Bind to $PORT on 0.0.0.0 and move slow work out of startup.
Keep it cheap. A route that returns 200 without touching the database tells the platform the server is up. Checking the database too means deploys fail while the database is down, and a slow query can make a healthy app look dead.
Sources
Checked on November 29, 2026:
Push a repo. Get a URL.
Start freeJoin the EthioDeploy Telegram
Release notes as they ship, plus deploy help from the team and other developers.