Helm Rollback Troubleshooting
A comprehensive guide to Helm rollback troubleshooting covering failed rollbacks, release history, recovery strategies, and best practices for restoring Helm releases.
Helm rollback is the process of reverting a release to a previous revision. It's a critical recovery mechanism when a deployment fails or introduces issues. However, rollbacks can also fail, and understanding how to troubleshoot them is essential.
This guide covers:
- Failed Rollbacks: Why rollbacks fail and how to fix them
- Release History: Understanding revisions and history
- Recovery Strategies: Options for restoring releases
- Prevention: Avoiding rollback failures
# Basic rollback to previous revision
helm rollback my-release
# Rollback to specific revision
helm rollback my-release 2
# Rollback with wait
helm rollback my-release 2 --wait
# Rollback with timeout
helm rollback my-release 2 --timeout 10m
# Rollback with dry-run
helm rollback my-release 2 --dry-run
# Rollback with force
helm rollback my-release 2 --force
# Rollback with cleanup on fail
helm rollback my-release 2 --cleanup-on-fail
# Rollback with no hooks
helm rollback my-release 2 --no-hooks
# Check rollback status
helm status my-release
# Verify rollback
helm history my-release
Rollback
Rollback to Revision
Rollback with Wait
Cleanup on Fail
Cause: Another Helm operation is in progress or failed and left a lock.
# Check release status
helm status my-release
helm history my-release
# Check for pending operations
helm list --pending
# Fix 1: Wait for operation to complete
# Check if operation is still running
# Fix 2: Force unlock by deleting release secret
kubectl delete secret sh.helm.release.v1.my-release.v1 -n default
# Fix 3: Rollback with --force
helm rollback my-release 1 --force
# Fix 4: Use --cleanup-on-fail
helm rollback my-release 1 --cleanup-on-fail
# Fix 5: Uninstall and reinstall (last resort)
helm uninstall my-release --keep-history
helm install my-release ./my-chart
Cause: The revision number doesn't exist or history was cleaned.
# Check release history
helm history my-release
# Fix 1: Use a valid revision number
helm history my-release
helm rollback my-release 2 # Use valid revision
# Fix 2: Check history limit
helm get metadata my-release | grep history-max
# Fix 3: Increase history limit during install/upgrade
helm upgrade my-release ./my-chart --history-max 20
# Fix 4: Reinstall if history is lost
helm uninstall my-release
helm install my-release ./my-chart
Cause: No successful deployments in history to rollback to.
# Check release history
helm history my-release
# Fix 1: Check for failed releases
helm list --all
helm list --failed
# Fix 2: Force delete and reinstall
helm uninstall my-release --keep-history
helm install my-release ./my-chart
# Fix 3: Use a different release name
helm install my-release-2 ./my-chart
# Fix 4: Restore from backup
# Restore release secret from backup
kubectl apply -f backup-release-secret.yaml
Cause: Immutable fields changed between revisions.
# Fix 1: Use --force to recreate resources
helm rollback my-release 1 --force
# Fix 2: Delete conflicting resources
kubectl delete deployment my-app --ignore-not-found
helm rollback my-release 1
# Fix 3: Use --cleanup-on-fail
helm rollback my-release 1 --cleanup-on-fail
# Fix 4: Manually rollback resources
kubectl apply -f revision-1-manifests.yaml
- Use
--forcefor immutable field issues - Check release history for valid revisions
- Clear pending operations
- Use
--cleanup-on-failfor cleanup - Reinstall as last resort
- Restore from backup if available
# View release history
helm history my-release
# View with more details
helm history my-release --max 10
# View history in YAML
helm history my-release --output yaml
# View history in JSON
helm history my-release --output json
# View specific revision
helm get all my-release --revision 2
# View release status
helm status my-release
# View release values
helm get values my-release --revision 2
# View release manifest
helm get manifest my-release --revision 2
# Check history limit
helm get metadata my-release | grep history-max
# Increase history limit
helm upgrade my-release ./my-chart --history-max 20
| Revision | Status | Chart | App Version | Description |
|---|---|---|---|---|
| 1 | superseded | my-app-1.0.0 | 1.0.0 | Initial install |
| 2 | superseded | my-app-1.1.0 | 1.1.0 | Added new feature |
| 3 | superseded | my-app-1.2.0 | 1.2.0 | Bug fix release |
| 4 | failed | my-app-2.0.0 | 2.0.0 | Failed upgrade |
| 5 | deployed | my-app-1.2.0 | 1.2.0 | Rollback to revision 3 |
- deployed: Currently deployed revision
- superseded: Replaced by a newer revision
- failed: Revision that failed to deploy
- pending-install: Installation in progress
- pending-upgrade: Upgrade in progress
- pending-rollback: Rollback in progress
Standard Rollback
helm rollback to revert to a previous revision.Force Rollback
--force when immutable fields block rollback.Cleanup Rollback
--cleanup-on-fail to clean up before rollback.Manual Recovery
Restore from Backup
Uninstall/Reinstall
- Always have a rollback plan
- Test rollback procedures in staging
- Use
--atomicfor automatic rollback - Keep backups of release secrets
- Document recovery procedures
- Use GitOps for easier rollbacks
- Always use
--atomicfor production upgrades - Test upgrades in staging first
- Use proper health checks
- Set appropriate resource limits
- Validate values before upgrade
- Keep release history manageable
- Back up release secrets
- Monitor deployments after upgrade
helm rollback <release> <revision> to revert to a previous revision. If the release is in a failed state, use --force to force the rollback.helm list --pending. Delete the release secret to clear the lock, or wait for the operation to complete. Use --force to force rollback.helm history <release> to view all revisions. Each revision shows status, chart version, and description.--history-max during installation or upgrade.helm rollback <release> <revision-number> to rollback to a specific revision. Check the revision number with helm history.--atomic for automatic rollback, test in staging first, use proper health checks, validate values, and back up release secrets.helm uninstall (keep history) and helm install. Or restore from backup of release secrets.Rollback troubleshooting is a critical skill for Helm operators. Understand the common failure modes, know the recovery strategies, and always test rollback procedures before production deployment.