Before you start
- A Levelrail control plane with the CLI signed in.
- An app with at least one earlier successful deploy. The examples call it
web.
When you need a rollback
Many bad releases never take traffic. A failed build leaves the previous release running, and a release has to pass its readiness gate and hold it before cutover. A rollback is for the release that passed those checks and still misbehaves: errors after cutover, a broken page, a slow endpoint.
Roll back
Step 1Find the bad deploy
Deploy history is one row per attempt, newest first, with the commit, branch and author for git push deploys.
bash levelrail-cli apps deploys list web --limit 10Step 2Read what went wrong
showprints one attempt, the newest by default, with its structured failure: the code, the cause, the failing step, a redacted log excerpt and a suggested fix.bash levelrail-cli apps deploys show web levelrail-cli apps deploys show web <deploy-id>Step 3Cancel it if it has not cut over
A queued or running deploy can be canceled before it touches the serving release. Once it has written its desired state, cancel answers
409and a rollback is the way back.bash levelrail-cli apps deploys cancel web <deploy-id>Step 4Roll back to the previous good deploy
Without
--image,rollbackpicks the newest successful deploy whose image differs from the one running now. In the dashboard, the same is the Rollback button on a deploy history row, or Roll back to last good on a failed attempt.bash levelrail-cli rollback webStep 5Or go back to an exact deploy
rollback-toredeploys the exact image a past successful deploy recorded, pinned by digest, with that deploy's config, through the same readiness gate as any deploy.--watchfollows it until it takes traffic or fails.bash levelrail-cli apps deploys rollback-to web <deploy-id> --watchStep 6Confirm it landed
A rollback request returns as soon as the server accepts it. Check the app's status, and read the timeline for the rollback next to the deploys and config changes around it.
bash levelrail-cli apps status web levelrail-cli apps timeline webStep 7Find the cause before you redeploy
diagnoseexplains a failed deploy or a crashloop and lists fixes;--apply-fixapplies one by its number. With a git source, push the fix and it deploys through the same gates.bash levelrail-cli apps diagnose webStep 8Let the next one roll itself back
Automatic rollback on a crashloop is opt in per app, and it works out the last known good release itself.
bash levelrail-cli apps auto-rollback enable web levelrail-cli apps auto-rollback status web
The post deploy watch
For a few minutes after cutover, each release is watched for an out of memory kill, repeated restarts and a high share of 5xx answers through the ingress. The watch mode decides what a trip does: off does not watch, notify sends an alert, and auto also rolls back to the last good release with its config. The server wide default is notify, set by APP_DEPLOY_WATCH_MODE, and each app can override it.