Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes Helm stuck with an update in progress

I tried to run a Helm upgrade before running helm repo update and now it seems to be permanently stuck in "STATUS: pending-upgrade" and won't let me try to run the upgrade again.

Trying to run: helm upgrade --namespace coder --install --force --atomic --wait --version 1.13.2 --values ./coder.yaml coder coder/coder

outputs: Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress

like image 212
Octoxan Avatar asked Nov 25 '20 14:11

Octoxan


People also ask

How do you abort a Helm upgrade?

There is no way of stopping it without restarting helm-controller with kubectl -n flux-system delete po helm-controller-xxxx . Please create an issue for this feature request in the https://github.com/fluxcd/helm-controller repository.

How do you fix error upgrade failed another operation install upgrade rollback is in progress?

This error can happen for few reasons, but it most commonly occurs when there is an interruption during the upgrade/install process as you already mentioned. To fix this one may need to, first rollback to another version, then reinstall or helm upgrade again.

How do I force delete Helm release?

If you need to uninstall the deployed release, run the delete command on the Helm command line. The command removes all the Kubernetes components that are associated with the chart and deletes the release.

What are the helm Tiller Kubernetes integration errors?

GitLab Kubernetes integration error; configuration of Helm Tiller already exists 7 Helm install or upgrade release failed on Kubernetes cluster: the server could not find the requested resource or UPGRADE FAILED: no deployed releases 3 Error: validation failed: unable to recognize "": no matches for kind "Deployment" in version "" 95

How to deploy resources in Kubernetes cluster using Helm charts?

You are deploying resources (pods, service and deployments etc) in Kubernetes cluster using Helm charts. This is deployed by release pipeline in Azure DevOps. In the Release pipeline you start getting errors like below and the task fails to deploy the resources. This started happening for Helm chart versions 3.3.0 and later.

What are the common Kubernetes errors in GitLab?

6 GitLab Kubernetes integration error; configuration of Helm Tiller already exists 7 Helm install or upgrade release failed on Kubernetes cluster: the server could not find the requested resource or UPGRADE FAILED: no deployed releases 3 Error: validation failed: unable to recognize "": no matches for kind "Deployment" in version "" 95

Why are updates in Helm not consistent?

This is the reason why updates seem to occur in a non consistent fashion. Refer to #5473 (comment) for an example of a pod issue. Helm does not support 3-way merge and therefore if changes are made directly to the cluster, they will not be picked up on an upgrade.


Video Answer


4 Answers

TLDR: You need to rollback to another version first and then helm upgrade again:

helm rollback <release> <revision> --namespace <namespace>


This can happen for a few reasons, but it ultimately occurs when there's an interruption during the upgrade/install process. Commonly, you SIGKILL (Ctrl C) while the deployment is ongoing.

You'll notice that if you helm ls --namespace <namespace> while it's stuck in STATUS: pending-upgrade state, you'll see the following without any other information:

NAME    NAMESPACE   REVISION    UPDATED STATUS  CHART   APP VERSION

The best workaround currently is to rollback to another version, and then helm upgrade again:

helm rollback <release> <revision> --namespace <namespace>

revision is optional, but you should try to provide it.

more resources:

  • https://github.com/helm/helm/issues/8987
  • https://github.com/helm/helm/issues/4558
like image 133
bwl1289 Avatar answered Oct 16 '22 10:10

bwl1289


This solution worked for me:

kubectl get secrets
kubectl delete secret sh.helm.release.v1.<RELEASE_NAME>.v<LATEST_REVISION>

Following the resolution described in this issue

like image 24
duyetpt Avatar answered Oct 16 '22 12:10

duyetpt


In case is useful to someone, and in response to explicitsoul's comment, what fixed it to me was just:

helm delete <release> -n <namespace>

That removed the pending install (in my case, the first one so I hadn't a previous release to rollback to) and then I was able to run the install again.

What caused the stuck process in my case was a CTRL-C canceling the install command, so don't do that.

like image 25
Lucas Veljacic Avatar answered Oct 16 '22 11:10

Lucas Veljacic


Here is what worked for me

  1. helm list --all This will list all the releases with their status
NAME  NAMESPACE       REVISION        UPDATED                                 STATUS               CHART                   APP VERSION
rel1  default         1               2021-06-04 14:15:37.652066 +0530 IST    deployed             rel1-3.32.0             0.46.0     
rel2  default         29              2021-06-18 11:02:38.779801 +0530 IST    pending-upgrade      rel2-0.0.1                     
rel3  default         3               2021-06-17 11:27:14.608042 +0530 IST    deployed             rel3-0.0.1      
  1. Notice that rel2 has status as pending-update . This happened because I did a Ctrl+C while upgrade was in progress
  2. All i had to do was rollback to previous revision in this case 28 helm rollback rel2 28 --namespace default
NAME   NAMESPACE       REVISION        UPDATED                                 STATUS          CHART          APP VERSION
rel1   default         1               2021-06-04 14:15:37.652066 +0530 IST    deployed        rel1-3.32.0    0.46.0     
rel2   default         30              2021-06-18 11:26:07.555547 +0530 IST    deployed        rel2-0.0.1                     
rel3   default         3               2021-06-17 11:27:14.608042 +0530 IST    deployed        rel3-0.0.1     
like image 24
Manoj I Avatar answered Oct 16 '22 11:10

Manoj I