You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Permanent fix for helm release stuck with status "pending-upgrade" or "pending-rollback" #11863
It is a well known problem that (at least in helm3) helm releases may get stuck in states "pending-upgrade" or "pending-rollback".
In such cases, no new upgrades or rollbacks can be initiated anymore without manual interventions like deleting secrets or performing a helm delete or similar hacks.
Example Thread (Closed) without any real deeper thought root cause solution: #7476.
Actually at the end of said thread there are people creating PRs in third party repos automating described hacks into their applications.
Such stuck scenarios seem to happen when the helm client process gets terminated during an upgrade or rollback operation.
I have an idea for an implementation that would make the handling easier for the user and more overall more robust and in accordance with the already existing --timeout parameter.
User executes helm upgrade/install --timeout restOfUpgradeOrInstallParameters.
The TIMEOUT (along with the CURRENT_DATETIME) parameter gets transferred to k8s and will be stored along with other release information (most likely in the existing k8s secret that stores the helm history information)
Now the command from step 1 gets terminated, the release gets stuck in the some pending state.
User again executes helm upgrade --timeout
Now helm checks from information stored in k8s, whether the pending-upgrade/pending rollback operation has already exceeded it's timeout, so there are two cases:
if original timeout exceeded: I will apply my new manifests without further ado
else: I will print the existing error that another operation is already in progress.
Before spending efforts on the code, I would like to ask for feedback from the helm developers/community.
Would such a PR be accepted?
Reacted by Robert Keyser, Zahav Capper, Chris Poptic, Andreas Lindhé, alexfokuk, aridelsante, David and David Heinrich
@joejulian
I would need to test this explicitly to be 100% sure, but my helm experience tells me that hooks are always re-executed on a retry.
So this would remain like in the current code: If a user needs (for whatever reason) to retry a helm release installation, the hooks will always be executed.
I have btw. an alternative fix idea that would allow for even faster retries than the original proposal:
Alternative B
Open each helm client operation that performs changes on the server (k8s), the client uploads a
unique_session_id (uuid)
locked_till value (datetime - will be something like the current datetimestamp + some safety period like 30s)
Furthermore, it is the client's task to continuously update the locked_till value (every 10s or so).
Now on each helm client operation, the client first checks if the locked_till value is in the past:
If yes: mark old revision number as failed and proceed with "new" installation - without throwing any error (maybe a warning) that refers to the old installation.
Else: Throw already existing error that there is already a concurrent installation being performed.
This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.
We are still struggling with that too. We do not like the fact that we have to run helm commands manually on production to work around this problem, so a fix would be really appreciated.
Activity
joejulian commentedon Mar 2, 2023
What if a chart developer has a pre-upgrade hook that isn't idempotent?
helmlover commentedon Mar 6, 2023
@joejulian
I would need to test this explicitly to be 100% sure, but my helm experience tells me that hooks are always re-executed on a retry.
So this would remain like in the current code: If a user needs (for whatever reason) to retry a helm release installation, the hooks will always be executed.
I have btw. an alternative fix idea that would allow for even faster retries than the original proposal:
Alternative B
Open each helm client operation that performs changes on the server (k8s), the client uploads a
Furthermore, it is the client's task to continuously update the locked_till value (every 10s or so).
Now on each helm client operation, the client first checks if the locked_till value is in the past:
If yes: mark old revision number as failed and proceed with "new" installation - without throwing any error (maybe a warning) that refers to the old installation.
Else: Throw already existing error that there is already a concurrent installation being performed.
joejulian commentedon Mar 23, 2023
Well, if you'd like to contribute this, write up a Helm Improvement Proposal and if it gets merged, we can transition this issue to a
feature.github-actions commentedon Jun 22, 2023
This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.
nosalan commentedon Feb 27, 2024
Perhaps there should be a Helm command to convert Pending.. releases to Failed state.
gerrnot commentedon Jul 23, 2024
HIP: helm/community#354
gjenkins8 commentedon Jul 27, 2024
HIP has been created, so will mark this as "keep open" while the HIP is under development
yasanthae commentedon Jun 3, 2025
Still same.
david0 commentedon Jul 8, 2025
We are still struggling with that too. We do not like the fact that we have to run helm commands manually on production to work around this problem, so a fix would be really appreciated.