EthioDeploy
DocsPricingDomainsBlogToolsChangelog

Blog/Fix deploy errors

Health check failed: app not listening on its port

BS
Brook SolomonPublished November 29, 2026
Share on XShare on LinkedIn
Health check failed

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:

  1. Nothing on the port: the app listens on 127.0.0.1, or on a fixed port that isn't the one in PORT. The app's own log looks healthy.
  2. 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.
  3. Too slow: the app does work before it listens: migrations, seeding, loading a model, a JVM on a small CPU share.
  4. 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?

PlatformWhat it checksHow long it waitsWhat you see
RenderAn open port on 0.0.0.0; a health check path if you set one15 minutes for the health check pathNo open ports detected, continuing to scan..., then ==> Timed out and ==> Deploy failed
RailwayThe healthcheck path, if configured, on PORT; any 2xx passes300 secondsfailed with service unavailable or failed with status 400, and the deploy is marked failed
Fly.ioThat the app listens on internal_port from fly.tomlDepends on your checksWARNING The app is not listening on the expected address and will not be reachable by fly-proxy.
HerokuThat the web process binds to $PORT60 seconds (90 for Java)Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch, then H10 on requests
EthioDeployGET on the Health Check Path (default /) on port 3000; 2xx or 3xx passes30 seconds by defaultHealth 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 PORT is 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 host healthcheck.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 on 0.0.0.0:8080. An app on 3000 with internal_port at 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 module or ModuleNotFoundError (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 migrate on 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 /login fails 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:

  • Render: Web services, port binding
  • Render: Health checks
  • Render tutorial: Boot and port binding
  • Railway: Healthchecks
  • Fly.io: Troubleshoot your deployment
  • Fly.io: Health checks
  • Heroku: Error codes (R10, H10, H20)

Push a repo. Get a URL.

  • Troubleshooting deploys
  • Deploy an Express app
  • Deploy a FastAPI app
  • Deploy a Spring Boot app
Start free

Join the EthioDeploy Telegram

Release notes as they ship, plus deploy help from the team and other developers.

Join on Telegram
BS
WRITTEN BYBrook SolomonFounder, EthioDeploy

Brook Solomon founded EthioDeploy and builds its deploy pipeline, build servers and AI coding agent. The posts here come from errors seen in real deploys on the platform.

All posts by Brook →
On this page
  • What does a failed health check mean?
  • What does each platform show?
  • Nothing is listening on the port
  • The process exits before it answers
  • The app takes too long to start
  • The app answers, but with the wrong status
  • What happens on EthioDeploy?
  • Questions
  • Sources
0% read

Keep reading

  • Mixed Content: blocked

    Fix deploy errorsNov 29, 2026

    Mixed content blocked after moving to HTTPS: causes and fixes

    A mixed content error means the page loaded over HTTPS but asked for something over plain http://. Browsers block scripts, stylesheets, fetch() and XMLHttpRequest calls (Chrome: "This request has been blocked; the content must be served over HTTPS") and upgrade images, audio and video to https on their own. After a deploy the cause is usually one of three things: an http:// URL in your code or in an env var such as the API base URL, a backend behind a TLS-terminating proxy that thinks it runs on http and builds http:// links, or old http:// URLs saved in the database. Change the URLs to https:// or relative paths, make the framework trust X-Forwarded-Proto, and treat the upgrade-insecure-requests CSP directive as a stopgap.

  • .python-version

    Fix deploy errorsNov 29, 2026

    Python version mismatch on deploy: SyntaxError, "requires a different Python" and failed wheels

    If your app works locally and the deploy fails with a SyntaxError on valid code, "Ignored the following versions that require a different python version", or a wheel that won't build, the server is running a different Python than you are. Check with python --version locally and in the build log, then pin the same minor version in a .python-version file containing just 3.12 (or whatever you use). Heroku, Render, uv and pyenv all read that file; runtime.txt is deprecated on Heroku. Nixpacks, which EthioDeploy uses, reads NIXPACKS_PYTHON_VERSION, .python-version and runtime.txt, knows only 3.7 to 3.13, and silently falls back to 3.12 for anything else. requires-python in pyproject.toml doesn't choose the interpreter on any of them except uv. With a Dockerfile, the FROM line decides.

  • wss://

    Fix deploy errorsNov 29, 2026

    "WebSocket connection failed" after deploy: proxies, wss and idle timeouts

    "WebSocket connection to 'wss://...' failed" after deploy means the handshake never reached your app or the app's answer never came back. Check four things in order. Use wss:// with the same host as the page, or a relative URL: browsers refuse ws:// from an https page. Make sure the proxy forwards the Upgrade and Connection headers; Nginx drops them unless you set them, while Traefik and Cloudflare pass them on their own. Serve the socket on the same port as your HTTP app, because hosts route one port. If connections open and then die after a minute or so, an idle timeout closed them: send pings every 25 to 30 seconds and reconnect on close. Platforms that sleep idle apps also close open sockets when they stop the app.

EthioDeploy

Agentic first development and deployment, started in Ethiopia, built for developers everywhere.

Telegram community
Product
PricingAI coding agentAgent mode docsDomainsCLIFree backend hostingHosting in EthiopiaChangelog
Deploy guides
Next.jsNode.jsPythonSvelteKitTanStack StartAstroNuxtReact RouterHonoStrapiPayload CMSDjangoDjango + CeleryFastAPIFlaskStreamlitExpressNestJSSocket.IOLaravelRailsGoSpring BootASP.NET CoreTelegram botDiscord botWhatsApp botn8nLovableBoltReplitv0Google AI StudioBase44Firebase StudioClaude Code & Cursor
Compare
vs Herokuvs Vercelvs Rendervs Railwayvs Fly.iovs Netlifyvs KoyebHeroku alternativesVercel alternativesNetlify alternativesRender alternativesRailway alternativesFly.io alternativesReplit alternativesPythonAnywhere alternativesDigitalOcean App Platform alternativesGlitch alternatives
Resources
DocsBlogFree toolsAboutSupportContactllms.txt
© 2026 EthioDeployPay by card in USD or bank transfer in ETBTermsPrivacy