Rollbacks & Auto-Recovery
Doku automatically rolls back deployments when it detects problems. You can also trigger manual rollbacks at any time.
Automatic Rollback
During a canary rollout, Doku continuously monitors your application. A rollback is triggered automatically when any of the following thresholds are exceeded:
- Error rate exceeds
canary.error_threshold(default: 1%) - P99 latency exceeds
canary.latency_threshold(default: 1000ms) - Health checks fail on the new version
- OOM kills or crash loops detected
bash
# [canary] Step 2/4: routing 25% traffic → v42
# [canary] ✗ Error rate 3.2% exceeds threshold 1%
# [rollback] Rolling back to v41...
# [rollback] ✓ Rollback complete. v41 serving 100% traffic.Manual Rollback
Roll back to the previous stable version at any time:
bash
doku rollback --env productionOr roll back to a specific deployment by ID:
bash
doku rollback --env production --to deploy_abc123What Happens During a Rollback
- Traffic is immediately shifted back to the previous version (100%)
- New version containers are stopped and drained
- Infrastructure changes (if any) are reverted
- A notification is sent to your configured channels (Slack, webhooks, etc.)
- The failed deployment is logged with metrics and root cause analysis
Zero-downtime
Rollbacks are zero-downtime. The previous version is kept warm and ready to serve traffic at all times during a deployment.
Deployment History
View past deployments and their status:
bash
doku status --env production
# Deployment History:
# deploy_def456 v42 rolled-back 2 hours ago error rate 3.2%
# deploy_abc123 v41 active 3 hours ago healthy
# deploy_xyz789 v40 superseded 1 day ago healthy