How to fix Error: Error installing helm release: cannot re-use a name that is still in use in Terraform

TerraformINTERMEDIATEHIGHUpdated Dec 31, 2025ยท 214 views

Helm prevents reusing release names even after uninstalling them. This error occurs when a Helm release secret still exists in Kubernetes. Learn how to clean up stale release records and redeploy.

Quick fix

Fixes Error: Error installing helm release: cannot re-use a name that is still in use

# List all releases in the target namespace
kubectl config set-context --current --namespace=<your-namespace>
helm list --all-namespaces

# Or check a specific namespace
helm list -n <namespace>

# Show deleted/failed releases
helm list -n <namespace> --deleted
helm list -n <namespace> --failed
  1. List all Helm releases including failed and deleted ones
  2. Uninstall the lingering Helm release completely
  3. Delete Helm release secrets manually if needed
  4. Update Terraform state and redeploy
terraform โ€” error
# List all releases in the target namespace
kubectl config set-context --current --namespace=<your-namespace>
helm list --all-namespaces
# Or check a specific namespace
helm list -n <namespace>
# Show deleted/failed releases
helm list -n <namespace> --deleted
helm list -n <namespace> --failed
Error: Error installing helm release: cannot re-use a name that is still in use

What this error means

When deploying Helm charts through Terraform, Helm maintains release records in Kubernetes secrets (Helm 3) or ConfigMaps (Helm 2) to track deployment history and enable rollbacks. Even after uninstalling a release, these records persist in the cluster. If you try to reinstall with the same release name, Helm checks for existing records and prevents the operation to avoid conflicts. This safety mechanism can trap you if the uninstall didn't fully clean up, the release transitioned to a failed or uninstalling state, or you're redeploying after a previous failed installation.

Typical symptoms

  • Terraform apply fails with 'cannot re-use a name that is still in use' error
  • helm list shows no active release, but reinstall still fails
  • Release appears in helm list --deleted or helm list --failed output
  • Deployment worked before but now fails when redeploying the same release name

Common causes

  1. A Helm release secret (or ConfigMap in Helm 2) still exists in the Kubernetes cluster for that release name
  2. The previous Helm uninstall command failed or was interrupted, leaving the release in 'uninstalling' state
  3. The release was deleted manually from kubectl without using helm uninstall, orphaning the Helm metadata
  4. Multiple namespaces or deployments are trying to use the same release name in overlapping contexts

How to fix "Error: Error installing helm release: cannot re-use a name that is still in use"

1List all Helm releases including failed and deleted ones

First, check if the release exists in any state. Run these commands in your cluster:

bash
# List all releases in the target namespace
kubectl config set-context --current --namespace=<your-namespace>
helm list --all-namespaces

# Or check a specific namespace
helm list -n <namespace>

# Show deleted/failed releases
helm list -n <namespace> --deleted
helm list -n <namespace> --failed

If you see the release in any of these outputs, proceed to the next step.

2Uninstall the lingering Helm release completely

If the release exists (even in failed/deleted state), fully uninstall it:

bash
helm uninstall <release-name> -n <namespace>

If the release is stuck in 'uninstalling' state, force remove it:

bash
helm uninstall <release-name> -n <namespace> --no-hooks

Wait a few seconds and verify it's gone:

bash
helm list -n <namespace> --all
3Delete Helm release secrets manually if needed

If the helm uninstall command didn't fully clean up, manually delete the Helm secret:

bash
# Find the Helm release secret
kubectl get secrets -n <namespace> | grep 'sh.helm.release'

# Delete the specific secret
kubectl delete secret sh.helm.release.v1.<release-name>.v<version> -n <namespace>

For Helm 2 (older clusters), look for ConfigMaps instead:

bash
kubectl get configmaps -n <namespace> | grep helm
kubectl delete configmap helm.<release-name>.v<version> -n <namespace>
4Update Terraform state and redeploy

Once Helm metadata is cleaned up, refresh your Terraform state and redeploy:

bash
# Refresh Terraform state to sync with cluster
terraform refresh

# Or target the specific resource if needed
terraform apply -target 'helm_release.<resource_name>'

If using kubernetes provider alongside Helm, ensure both are in sync:

bash
terraform plan -out=tfplan
terraform apply tfplan
5Verify successful deployment

Confirm the release is now active:

bash
# Check Helm release status
helm status <release-name> -n <namespace>

# Verify pods are running
kubectl get pods -n <namespace>

# Check Terraform state shows deployed
terraform state show 'helm_release.<resource_name>'

The release should show as DEPLOYED and pods should be running.

Advanced notes

Helm release metadata is stored as Kubernetes secrets (Helm 3+) with names like "sh.helm.release.v1.RELEASENAME.vN". If you have multiple Helm versions or hybrid Helm 2/3 clusters, check for ConfigMaps as well. For Terraform specifically, ensure the helm provider's kubeconfig points to the correct cluster context. If using multiple namespaces, release names only need to be unique within a namespace, so consider using namespace-qualified release names (e.g., "dev-myapp" vs "prod-myapp") to avoid confusion. For CI/CD pipelines, add helm list checks before install/upgrade steps to catch these issues early.

Frequently asked questions

What does "Error: Error installing helm release: cannot re-use a name that is sti" mean?
When deploying Helm charts through Terraform, Helm maintains release records in Kubernetes secrets (Helm 3) or ConfigMaps (Helm 2) to track deployment history and enable rollbacks. Even after uninstalling a release, these records persist in the cluster. If you try to reinstall with the same release name, Helm checks for existing records and prevents the operation to avoid conflicts.
How do I fix "Error: Error installing helm release: cannot re-use a name that is sti"?
Helm prevents reusing release names even after uninstalling them. This error occurs when a Helm release secret still exists in Kubernetes. Learn how to clean up stale release records and redeploy.
What causes "Error: Error installing helm release: cannot re-use a name that is sti"?
A Helm release secret (or ConfigMap in Helm 2) still exists in the Kubernetes cluster for that release name The previous Helm uninstall command failed or was interrupted, leaving the release in 'uninstalling' state The release was deleted manually from kubectl without using helm uninstall, orphaning the Helm metadata
Is the "Error: Error installing helm release: cannot re-use a name that is sti" error serious?
Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.

Official resources & further reading