Recovering from a failed deploy
This article is for anyone whose deploy has failed and wants to know what went wrong and how to fix it.
What a failed deploy looks like
When a deploy fails, the deploy card on your dashboard shows a red 'Failed' status. Your live site is not affected — SrvBot only switches traffic to a new build if it succeeds. A failed deploy leaves the previous working version in place.
Reading the build log
Click 'View log' on the failed deploy card. The log shows every step of the build process. Scroll to the first line marked ERROR or to the point where the process exited — that's usually where the cause is. The lines before it give context.
Don't try to read the whole log top-to-bottom; logs from large builds can be long. Search for 'error', 'failed', or 'exit code' to find the relevant section quickly.
Common causes and fixes
Missing environment variable: your build references a variable (like an API key or database URL) that isn't set in SrvBot. Go to site settings → Environment variables and check that the variable exists and is spelled correctly. Variable names are case-sensitive.
Build command mismatch: the build command SrvBot is running doesn't match what works locally. Check site settings → Build settings. Common examples: running 'npm run build' when the script is named 'build:prod', or using the wrong Node.js version. You can pin a Node version in site settings.
Dependency install failure: a package in your package.json or composer.json can't be installed — usually because of a version conflict or a private package that requires authentication. The log will show the specific package name and error.
Test failure: if your project has a test step in the build pipeline and a test fails, the deploy stops. Fix the failing test, push again, and the deploy will retry.
Rolling back to a previous deploy
If a deploy succeeds but causes a problem on your live site, you can roll back:
1. Go to site detail → Deploy history.
2. Find the last working deploy.
3. Click 'Redeploy this version'.
SrvBot rebuilds from that exact commit and switches traffic back to it once the build succeeds. The rollback deploy appears in your history like any other deploy.
Still stuck? Reply to any email you've received from us, or send a note to [email protected]. A human will be with you within an hour during business hours.