DevOpsil
KubernetesMedium

Fix: Helm Release Already Exists

helm install fails with 'cannot re-use a name that is still in use'

!Symptoms

  • helm install fails with 'cannot re-use a name that is still in use'
  • Helm shows release in 'failed' or 'pending-install' state
  • Upgrade fails because the release is in an inconsistent state

?Root Causes

  • Previous helm install failed partway through, leaving a broken release
  • Trying to `helm install` when the release already exists (should use `helm upgrade`)
  • Release stuck in pending-install, pending-upgrade, or pending-rollback state
  • Helm release secret exists in the namespace but resources were manually deleted

#Diagnosis Steps

  1. 1List releases: `helm list -a` (includes failed/pending releases)
  2. 2Check release status: `helm status <release-name>`
  3. 3Check release history: `helm history <release-name>`
  4. 4Look for helm release secrets: `kubectl get secrets -l owner=helm`

>Fix

  1. 1Use upgrade with install flag: `helm upgrade --install <release> <chart>`
  2. 2If release is stuck in pending, uninstall and reinstall: `helm uninstall <release>` then `helm install`
  3. 3For failed releases, try rollback first: `helm rollback <release> <revision>`
  4. 4Force replace: `helm upgrade --install --force <release> <chart>`
  5. 5Manually delete helm secrets if the release is truly orphaned: `kubectl delete secret sh.helm.release.v1.<name>.v1`

*Prevention

  • Always use `helm upgrade --install` instead of `helm install` in CI/CD
  • Set --atomic flag to auto-rollback on failure: `helm upgrade --install --atomic`
  • Use --wait to ensure resources are ready before marking release as successful
  • Implement proper Helm release lifecycle management in GitOps tools (ArgoCD, Flux)
  • Set --timeout appropriately for your application startup time

Related Error Messages

cannot re-use a name that is still in userelease: already existsUPGRADE FAILEDanother operation (install/upgrade/rollback) is in progresshas no deployed releases