Skip to content
Latchkey

Render Deploy "Build failed" / "Exited with status 1" in CI

Render ran your build/start commands and the deploy failed - the build exited non-zero, the service crashed before passing its health check, or a missing env var/wrong root directory broke the run.

What this error means

The Render deploy log ends with a build failure or the service repeatedly restarting and failing the health check. A real build/start error reproduces every run; a missing env var fails until it is added in the dashboard or render.yaml.

Render deploy log
==> Build failed 😞
error Command failed with exit code 1.
# or
==> Service unhealthy: the service failed its health check on port 10000

Common causes

Build or start command failed

The build command exited non-zero, or the start command crashes (wrong entrypoint, bad port). Render binds to PORT; not listening on it fails the health check.

Missing env var or wrong root directory

A required environment variable is not set in the Render service, or the root directory points at the wrong folder in a monorepo, so the build/run uses the wrong context.

How to fix it

Pin build/start, port, and env in render.yaml

Declare the commands, the port the app binds, and required env vars as infrastructure.

render.yaml
# render.yaml
services:
  - type: web
    name: api
    rootDir: apps/api
    buildCommand: npm ci && npm run build
    startCommand: npm start
    envVars:
      - key: DATABASE_URL
        sync: false

Listen on $PORT and read the build log

  1. Bind the server to process.env.PORT so Render’s health check reaches it.
  2. Reproduce the build command locally to read the real error.
  3. Add missing env vars in the service settings (or render.yaml) and redeploy.

How to prevent it

  • Always bind to $PORT and expose a health endpoint.
  • Declare build/start commands, root dir, and env vars in render.yaml.
  • Run the build locally before pushing so failures surface early.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →