How to Fix helm "has no deployed releases" Error

March 4, 2021

Introduction

In Helm, the helm upgrade --install command lets you upgrade your release to a new version. However, attempting to upgrade your release can sometimes produce the  “helm has no deployed releases” error.

In this tutorial, we will cover the causes of the “helm has no deployed releases” error as well as several potential solutions.

How to fix "helm has no deployed releases" error

Prerequisites

What Causes the “helm has no deployed releases” Error?

As of Helm 2.7.1, running the helm upgrade --install command on a previously failed release produces the following error:

Error: UPGRADE FAILED: [release name] has no deployed releases
Helm "no deployed releases" error in the terminal.

Helm 2 compares the current deployment manifest with the new one to apply the necessary patches. It does not, however, compare the state of the resources between the manifests.

If a previous deployment failed, it is likely that the cluster has some missing resources. Prior to Helm 2.7.1, Helm will try to upgrade the deployment without installing the missing resources. To prevent this, as of version 2.7.1, Helm uses the latest successful deployment as the baseline for the upgrade. If there is no successful deployment to be found, the system returns the “helm has no deployed releases” error message.

Fixing the “helm has no deployed releases” Error

There are several ways to fix the “helm has no deployed releases” error, most of them focusing on changing the status of the failed deployment causing the issue:

Solution 1: Cleaning Up Failed Deployments

Deleting the current release and starting a new one from scratch fixes the issue. To do this with Helm 2, use:

helm delete --purge [release name]

Where:

  • [release name]is the name of the release you want to delete.
Deleting a Helm release

As of Helm 3, deleting a release requires the uninstall command:

helm uninstall [release name] -n [namespace]

Where:

  • [namespace] is the namespace of your release.

1. Another way to remove a failed release is to first check the status of your deployment:

helm list -n [namespace] -a

2. If the status of your release is not deployed, check the deployment secrets:

kubectl get secrets -n [namespace]

3. Describe the last item on the secrets list to check its status:

kubectl describe secret [secret name]

Where:

  • [secret name] is the name of the secret you want to check.

4. If the secret has the same status as the failed deployment, delete it by using:

kubectl delete secret [secret name]

5. Upgrade your release with:

helm upgrade [release name]

Solution 2: Forcing an Upgrade

Another way to solve the issue is to force an upgrade by using:

helm upgrade [release name] --force

Where:

  • [release name] is the name of the release you want to upgrade.

Behind the scenes, this does a similar job to helm delete --purge, deleting the previous release before installing a new one. This can lead to loss of service, making it unsuitable for certain releases.

Solution 3: Changing the Deployment Status

In Helm 2, changing the release status to deployed lets you bypass the issue:

kubectl -n kube-system patch configmap [release name].[release version] --type=merge -p '{"metadata":{"labels":{"STATUS":"DEPLOYED"}}}'

Where:

  • [release name] is the name of the release you want to update.
  • [release version] is the current version of your release.

Note: Keep in mind that the solution above only serves to bypass the issue. You still need to make manual adjustments to add the missing resources.

Since Helm 3 stores the deployment history as Kubernetes secrets, use the following command to change the deployment status:

kubectl -n app-namespace patch secret [release name].[release version] --type=merge -p '{"metadata":{"labels":{"status":"deployed"}}}'

Conclusion

After following this tutorial, you should be able to upgrade your release to a new version without receiving the “helm has no deployed releases” error.

Was this article helpful?
YesNo
Aleksandar Kovačević
Aleksandar Kovacevic is an aspiring Technical Writer at phoenixNAP. With a background in both design and writing, he aims to bring a fresh perspective to writing for IT, making complicated concepts easy to understand and approach.
Next you should read
How To Create A Helm Chart
February 3, 2021

Helm charts are application packages that use Kubernetes resources. They provide a template structure for...
Read more
How to Roll Back Changes with Helm
February 3, 2021

Helm is a package manager for Kubernetes that offers a host of useful options, including rolling back...
Read more
How to Add, Update or Remove Helm Repositories
December 21, 2020

Helm is Kubernetes' equivalent to apt and yum. It is a package manager used for deploying applications...
Read more
How to Install Helm on Ubuntu, Mac and Windows
December 10, 2020

Helm is a package manager for Kubernetes that simplifies deployment process. Follow this step-by-step...
Read more
  • © 2021 Copyright phoenixNAP | Global IT Services. All Rights Reserved.