Skip to content

Helm v3.4 Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress #8987

Closed

Description

@jlcrow

Upgraded from Helm 3.3 to Helm 3.4, existing charts started failing the upgrade with the message:
Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress

At the same time a helm list -n myns the chart disappeared and didn't show up in the list at all

This is a chart that's been upgraded over 800 times successfully, only change was the helm version bump, chart failed twice in an attempt to deploy with the command:

helm upgrade --install --namespace myns --timeout 1800s --atomic mychart charts/app/standalone --values values-override.yaml

Once I rolled back to 3.3 I was able to upgrade the chart successfully.

Output of helm version:

version.BuildInfo{Version:"v3.4.0", GitCommit:"7090a89efc8a18f3d8178bf47d2462450349a004", GitTreeState:"dirty", GoVersion:"go1.15.3"}

Output of kubectl version:

Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.13", GitCommit:"39a145ca3413079bcb9c80846488786fed5fe1cb", GitTreeState:"clean", BuildDate:"2020-07-15T16:18:19Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.13-gke.401", GitCommit:"eb94c181eea5290e9da1238db02cfef263542f5f", GitTreeState:"clean", BuildDate:"2020-09-09T00:57:35Z", GoVersion:"go1.13.9b4", Compiler:"gc", Platform:"linux/amd64"}

Cloud Provider/Platform (AKS, GKE, Minikube etc.): GKE

Activity

  1. bacongobbler commented on Nov 5, 2020

    @bacongobbler
    Member

    Hi @jlcrow.

    We ask to please provide a test case or some way for the maintainers to test and reproduce the error you are experiencing. This way we can better help understand the issue and determine if there's a fix we can apply to the next release. In most cases a simple set of steps to reproduce the issue on our end can help expedite the process.

    Thanks.

  2. mattfarina commented on Nov 5, 2020

    @mattfarina
    Collaborator

    @jlcrow Yikes. While I wouldn't ask you to do this in production could you do an upgrade while using the --debug and -v 6 flags set. This will provide more diverse output that can help us find the problem.

  3. jlcrow commented on Nov 6, 2020

    @jlcrow
    Author

    @jlcrow Yikes. While I wouldn't ask you to do this in production could you do an upgrade while using the --debug and -v 6 flags set. This will provide more diverse output that can help us find the problem.

    Thanks @mattfarina, I'm pushing up a branch for deployment and will test with both versions of helm to see if I can reproduce

  4. Skaronator commented on Nov 6, 2020

    @Skaronator

    I have the same issues. I'll try to get a debug output if possible.

    I noticed this issue usually happens when you upgrade a helm chart with --wait and the upgrade clearly fails (like a crashloopbackoff or something like that) and helm is waiting until it reaches the timeout but the user does CTRL+C before reaching the timeout. After that I'll get the same error as posted above:

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

    I'm using helmfile, not helm directly, maybe its another problem with helmfile not sending the SIGTERM correctly.

  5. bacongobbler commented on Nov 6, 2020

    @bacongobbler
    Member

    @Skaronator and @jlcrow can you check and see if the same symptoms and workarounds described in #4558 help with your cases?

  6. Skaronator commented on Nov 9, 2020

    @Skaronator

    Hi @bacongobbler, the described workaround did indeed works!

    $ helm history kyc-api
    REVISION	UPDATED                 	STATUS         	CHART             	APP VERSION	DESCRIPTION             
    1       	Mon Nov  9 14:57:36 2020	pending-install	generic-base-0.2.1	0.1.0      	Initial install underway
    
    $ helm rollback kyc-api 1
    Rollback was a success! Happy Helming!
    
     $ helm history kyc-api
    REVISION	UPDATED                 	STATUS         	CHART             	APP VERSION	DESCRIPTION             
    1       	Mon Nov  9 14:57:36 2020	pending-install	generic-base-0.2.1	0.1.0      	Initial install underway
    2       	Mon Nov  9 15:06:15 2020	deployed       	generic-base-0.2.1	0.1.0      	Rollback to 1  
    

    Looking at the werf/helm PR pretty much confirms that CTRL+C breaks the helm installation on 3.4.0.

  7. bacongobbler commented on Nov 9, 2020

    @bacongobbler
    Member

    Thanks for following up. Closing as a duplicate of #4558.

  8. jlcrow commented on Nov 9, 2020

    @jlcrow
    Author

    @bacongobbler I don't understand how this was determined to be the same issue? There's no ctrl+c running in my pipeline.

  9. Skaronator commented on Nov 9, 2020

    @Skaronator

    I still think there is a regression in 3.4.0 since I never had this issue before.

  10. jlcrow commented on Nov 9, 2020

    @jlcrow
    Author

    I've tried to reproduce this in a branch of my project and have been unable to at this point.

  11. bacongobbler commented on Nov 12, 2020

    @bacongobbler
    Member

    Okay. Have either of you been able to reproduce this issue?

    I know that this particular error can occur when the previous release is in a PENDING_UPGRADE or some other transitional state - usually occurs due to a timeout or someone interrupting the upgrade midway through (hence why I linked to #4558). I have not heard of a regression in Helm 3.4.0 causing an upgrade to enter a transitional state other than through the ticket I linked earlier... Which isn't isolated to just Helm 3.4.

  12. 55 remaining items

  13. djha-skin commented on Mar 10, 2022

    @djha-skin

    Workaround:

    1. Write the secret representing the release out to memory
    kubectl get secret -n <whatever> sh.helm.release.v1.<name>.v<version>    -o yaml > release.yaml
    
    1. Unpack the secret so you can manually edit it
    cat release.yaml | yq .data.release | base64 -d | base64 -d | gunzip > release-contents.json
    
    1. Edit the JSON document that is unpacked, changing the "description" key to "Deployed" and the "status" key to the value "deployed"
    2. Repack the json document
    cat release.json | gzip | base64 -w 0 > newreleasevalue
    
    1. Edit the file release.yaml, changing the label status to deployed and the data.release key to have as its value the contents of the file newreleasevalue created in step 6
    2. Update the secret using the file release.yaml which you just updated:
    kubectl apply -n <whatever> -f release.yaml
    
    1. Run helm list to verify that your release shows up in the list of deployed stuff
    2. Now you can re-run your helm command and it won't die.
  14. Nolij commented on Mar 19, 2022

    @Nolij

    Workaround:

    1. Write the secret representing the release out to memory
    kubectl get secret -n <whatever> sh.helm.release.v1.<name>.v<version>    -o yaml > release.yaml
    
    1. Unpack the secret so you can manually edit it
    cat release.yaml | yq .data.release | base64 -d | base64 -d | gunzip > release-contents.json
    
    1. Edit the JSON document that is unpacked, changing the "description" key to "Deployed" and the "status" key to the value "deployed"
    2. Repack the json document
    cat release.json | gzip | base64 -w 0 > newreleasevalue
    
    1. Edit the file release.yaml, changing the label status to deployed and the data.release key to have as its value the contents of the file newreleasevalue created in step 6
    2. Update the secret using the file release.yaml which you just updated:
    kubectl apply -n <whatever> -f release.yaml
    
    1. Run helm list to verify that your release shows up in the list of deployed stuff
    2. Now you can re-run your helm command and it won't die.

    Getting this error when running kubectl apply after following those steps:

    Warning: resource secrets/sh.helm.release.v1.nextcloud.v11 is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically.
    The Secret "sh.helm.release.v1.nextcloud.v11" is invalid: metadata.annotations: Too long: must have at most 262144 bytes
    

    Also, the command you provided for repacking the release contents only encodes it once, I believe it should be doing that twice, and the yq command is giving output with quotes around. Used these commands instead:
    cat release.yaml | yq .data.release | sed 's/"//g' | base64 -d | base64 -d | gunzip > release-contents.json
    cat release-contents.json | gzip | base64 -w 0 | base64 -w 0 > newreleasevalue

    UPDATE: found a workaround. Use kubectl edit to apply the changes instead of kubectl apply. Make sure you know how to paste in your terminal editor. I'd recommend just commenting out the old line to remove it instead of deleting it by hand, does same thing.

  15. chance2021 commented on Mar 23, 2022

    @chance2021

    same on v3.5.4, fixed by

    kubectl delete secret sh.helm.release.v1.asdf.v1 -n asdf
    

    This works for me. Thanks! @okunc

  16. matti commented on Mar 30, 2022

    @matti

    same in 3.8.1, still when killing helm install --upgrade hard enough

  17. matti commented on Mar 30, 2022

    @matti

    delete all release versions: kubectl delete secret --field-selector type=helm.sh/release.v1 -l owner=helm

  18. added a commit that references this issue on Feb 5, 2024
  19. azr commented on Feb 14, 2024

    @azr

    tf apply failed, but I manually changed things in k8s, because prod and we can't wait for tf, and to get the state back right:

    1/

    kubectl delete secret sh.helm.release.v1.<????>.v<LAST_ONE> -n <?????>
    

    2/

    tf apply
    

    All went fine, because the end k8s config ended up being just the same.
    Could be nice if helm had an option for this case: 'hey look it's a pending update, but the deployed stuff is exactly what it should be so I'll just replace that release'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions