Helm upgrade cancelling leaves helm in progress

We use the “Helm upgrade” process to deploy our application. We also use the --atomic flag under the “additional arguments”

The problem is what when you manually cancel the deployment via UI it throws an error and doesn’t actually roll back the helm upgrade:

Requesting cancellation... 
July 12th 2023 11:27:49Info
Releasing package lock for octoworker-eu-dev-0. 
July 12th 2023 11:27:49Error
Failed to release package lock for octoworker-eu-dev-0 The operation was canceled.
System.OperationCanceledException: The operation was canceled.
   at Octopus.Server.Orchestration.Targets.Tentacles.Observability.HalibutTentacleRpcTimerProxy.Invoke(MethodInfo targetMethod, Object[] args) in ./source/Octopus.Server/Orchestration/Targets/Tentacles/Observability/HalibutTentacleRPCTimerProxy.cs:line 59
   at generatedProxy_3.CancelScript(CancelScriptCommand )
   at Octopus.Server.Orchestration.Targets.Tentacles.ScriptObserver.ObserveUntilComplete(ScriptTicket ticket, Int64 next, ScriptOutputFilter output, CancellationToken cancellationToken) in ./source/Octopus.Server/Orchestration/Targets/Tentacles/ScriptObserver.cs:line 64
.... and so on.

On the next deployment I am then left with an error:

Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress 
Error Helm Upgrade returned non-zero exit code: 1. Deployment terminated.

The solution is to manually rollback or uninstall the helm release.

I expected that cancelling the deployment would still perform a rollback with the --atomic parameter.

Good afternoon @reedik.tuuling,

Thank you for contacting Octopus Support and welcome to the forums, I am sorry you are seeing issues when cancelling your helm deployments.

Octopus itself wont manually rollback the deployment with the --atomic parameter, when you cancel a task in Octopus it terminates that task entirely at that point in time. It is in essence a task kill option. So, no rollback or restoration processes are run afterwards.

We do have some rollback strategies you could possibly implement in this article if you have not come across it yet.

Was there a specific reason you had to cancel the deployment, did you see any errors before-hand that required the deployment to be cancelled manually, if so would you be able to send over the raw task log for that failed deployment and we could take a look to see if there is something we could help you with. I have created you a secure link here you can use to upload the logs if you need to.

Kind Regards,

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.