Skip to Content

Troubleshooting

Find out why a deploy failed or a service doesn't answer, fix the common causes, and what to send support.

When a deploy fails, the previous version keeps running. Start on the service's Deployment tab: the failed row says what went wrong, and Diagnose explains it.

Start with Diagnose

Open the service and click Deployment. A failed deploy shows Deploy failed in red, a box with what happened, and Diagnose.

Here the build failed: the app's npm build script exited with code 1. The box reads "The deploy was aborted and the previous version keeps running. Check the build logs for the failing step."

Deployment tab: Deploy failed, the push step exited with code 1, the previous version keeps running, and Diagnose
Deployment tab: Deploy failed, the push step exited with code 1, the previous version keeps running, and Diagnose

Click Diagnose. A Root cause analysis reads the build or rollout logs and gives a summary, the Root cause, a Category and Suggested fixes. It's written by AI from the logs, so check it against the logs before acting on it. Hide diagnosis folds it away.

Root cause analysis: Build failed because npm run build exited with code 1, the root cause, Category compile and Suggested fixes
Root cause analysis: Build failed because npm run build exited with code 1, the root cause, Category compile and Suggested fixes

From the terminal, stackblaze deployments list shows each deploy's status (for example build_failed), and stackblaze builds logs prints a build's log.

Common failures

What you seeLikely causeWhat to do
Deploy failed, the build step exited with a codeA command in your build failed: a script, a missing dependency, a test run during the buildRead the build log for the first error. Run the same build locally.
The deploy stays rolling out and never goes liveThe new version never passes its health check: the app doesn't answer on the checked path, or it listens on the wrong address or portSee The app never becomes ready.
A build is refused: "Your plan runs 1 build at a time and one is running."The organization already runs as many builds as its plan allowsWait for a build to finish, or upgrade. See Build limits.
The app still has an old valueVariable and setting changes are staged until you commit and deploy themClick Commit and Deploy (see Environment variables). Check you changed the right environment.
No DATABASE_URL in the appThe database isn't connected to this service, or it's in another environmentIn the database's panel, turn the app on under Connections, then deploy (see PostgreSQL).
The service keeps restarting, and Memory usage on Metrics is at the service's sizeIt runs out of memoryGive the service a bigger size (see Scaling), or make the app use less.

The app never becomes ready

A new version takes traffic only once its health check passes. Until then the old version keeps serving, and the deploy stays rolling out. The usual causes:

  • The app listens on 127.0.0.1 or localhost. That address only answers from inside the app's own container, so the health check never reaches it. Listen on 0.0.0.0 (all addresses) instead. When we deployed a Node.js app with listen(port, '127.0.0.1'), the build succeeded and the log said listening on 127.0.0.1:3000, but the new instance was restarted again and again ("Instance crashed (restarted 2 times)") while the old version kept serving. stackblaze up --ci --wait ended with "ready":false,"timedOut":true and exit code 1.
  • The app listens on another port. StackBlaze sets PORT for the app; read it, as in process.env.PORT.
  • The checked path doesn't answer. The check requests / by default. Point it at a path that answers quickly, or give a slow app more Startup time (90 seconds by default). See When the check fails.

Deploying a fixed version replaces the stuck one.

Ask support

If you're still stuck, open a request from Support in the sidebar (see Support). As the form says, "Include timestamps and error text when relevant — it helps us respond faster." Also say which project, environment and service it's about, and paste the failed row's message or the first error in the build log.

On this page