Skip to content

Resolving Helm "Another Operation in Progress" Error

Problem: Stuck Helm Operations

When working with Helm, you may encounter the error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress. This typically occurs when:

  • A Helm operation is interrupted mid-execution (e.g., cancelling a deployment)
  • The previous operation didn't complete successfully
  • The release is in a pending state (like pending-upgrade or pending-install)
  • The release doesn't appear in helm list but is still tracked internally

Solution Approaches

1. Check All Releases (Including Hidden Ones)

First, verify if the release exists but isn't showing in default listings:

bash
# List all releases in a specific namespace (including failed/pending ones)
helm ls -a -n <namespace>

# List all releases across all namespaces
helm ls -aA

2. Check Release History

Examine the deployment history to identify stuck revisions:

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

Look for entries with pending-upgrade, pending-install, or failed status.

3. Rollback the Stuck Release

If you identify a stuck revision, attempt a rollback:

bash
helm rollback <release-name> <revision-number> -n <namespace>

The revision number can be found in the history command output.

4. Delete the Helm Secret (Most Effective Solution)

WARNING

This approach manipulates Helm's internal state. Proceed with caution and ensure you have backups if needed.

Helm 3+ uses Kubernetes secrets to track release state. When operations get stuck, deleting the associated secret often resolves the issue:

bash
# List all secrets in the namespace
kubectl get secrets -n <namespace>

# Identify Helm release secrets (they follow the pattern: sh.helm.release.v1.<release-name>.v<version>)
kubectl get secrets -n <namespace> | grep "sh.helm.release"

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

TIP

The version number in the secret name corresponds to the revision number. Typically, you'll want to delete the highest version (most recent) secret.

5. Complete Azure DevOps Example

If working with Azure DevOps pipelines:

bash
# Connect to your AKS cluster
az account set --subscription <subscription-id>
az aks get-credentials --name <aks-cluster-name> --resource-group <resource-group-name>

# Identify and delete the stuck release secret
kubectl get secrets -n <namespace>
kubectl delete secret sh.helm.release.v1.<release-name>.v<version> -n <namespace>

Prevention Best Practices

  1. Avoid interrupting Helm operations - Let install/upgrade/rollback operations complete fully
  2. Use timeouts appropriately - Set reasonable timeout values in your Helm commands
  3. Implement proper error handling - In CI/CD pipelines, ensure proper cleanup on failure
  4. Monitor resource limits - Ensure your cluster has sufficient resources to complete deployments
  5. Test rollback procedures - Regularly test that your rollback mechanisms work correctly

INFO

The secret deletion method is generally safe because Helm will recreate the secret with the correct state during the next successful operation. However, you may lose metadata about the failed operation.

When to Use Each Approach

  • For recent interruptions: Try rollback first
  • For long-standing stuck operations: Delete the Helm secret
  • For pipeline issues: Check your pipeline configuration for missing parameters or bugs
  • When unsure of release location: Use helm ls -aA to search all namespaces

By following these methods, you should be able to resolve the "another operation in progress" error and successfully continue with your Helm deployments.