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
helm upgrade > timeout on pre-upgrade hook > revision stuck in PENDING_UPGRADE and multiple DEPLOYED revisions arise soon #4558
StalebugCategorizes issue or PR as related to a bug.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
This may directly also have led to multiple revisions considered to be DEPLOYED but I fail to reproduce that exact steps, but it has happened to me very recently while working with hooks, some of which timed out, some of which failed. Will try to make the multiple DEPLOYED revisions reproducible as well, but this is perhaps another issue, it is at least another symptom.
changed the title [-]helm upgrade > timeout on pre-upgrade hook > revision stuck in `PENDING_UPGRADE`[/-][+]helm upgrade > timeout on pre-upgrade hook > revision stuck in `PENDING_UPGRADE` and multiple `DEPLOYED` revisions arise soon[/+]on Aug 29, 2018
By running the same helm upgrade over, I ended up with multiple revisions being DEPLOYED.
My helm hooks are mostly a DaemonSet pulling images with init-containers with a pause image used by the main container. I also have a Job that awaits the DaemonSet to have the desired ready pods. All hooks have the following annotations.
I think that tiller is fooled by the delete-policy of before-hook-creation. Something like this...
An upgrade is done, getting stuck in the pre-upgrade hook for some reason. This upgrade will remain in PENDING_UPGRADE no matter what if the helm client times out or not.
A new upgrade is done, the resources are removed and tiller believes the new hooks actually finished when they were deleted and progresses towards the actual upgrade.
An indication of this to be somewhat correct, is that the upgrade were considered to be succeeded in the end when it really should or could not be! I had asked it to pull images never to be found in the pre-upgrade hooks, but the actual upgrade happened even though those images did not exist. Somehow, tiller was fooled to believe the hooks completed successfully!
I tried to create a minimalistic reproduction and ended up with something slightly different but I bet that this is related.
The following Charts deployment should never be deployed, right? Because it has a hook that should keep running in eternity. But it will be deployed if you run two upgrades in succession and have a hook resource already available with the same name and about to terminate.
Chart.yaml:
apiVersion: v1appVersion: "1.0"description: A Helm chart for Kubernetesname: issue-4558version: 0.1.0
I have notice the same issue but we are not using the before-hook-creation. Our releases still get stuck but it doesn't seem to create duplicate deployed releases.
We are running into this same issue with helm 3. The pipeline gets canceled and the helm operation is stuck in pending-upgrade. The current workaround for running a rollback does work but it isn't that great for an automated pipeline unless we add a check before to make sure to "rollback" before deploy.
Is there anyway to just bypass the "pending-upgrade" status on a new deploy without running a rollback?
Reacted by Logan Mzz, Daniel Darabos, Erik, klose4711, Constantin Bugneac, Adam Raszkiewicz, Xavier Fox, epicbugs, fabb, Kris and 2 more
We are running on Helm 3.4.1 and are running into the same issue as here from time to time. Worth mentioning that the previous version 3.3.x had no such trouble with the deployments...
Can someone from the Helm team take a look at this and give an update or something?
Same problem, coming here searching for a reason/fix 👍
Reacted by Vasily Yanov, Velcea Bogdan-Nicolae, Mark Mandel, Pierre Oblin, Constantin Bugneac, Israel Fonseca, Tomek Święcicki, Adam Raszkiewicz, Philipp Gniewosz, abrar and 1 more
Brilliant, this is exactly what I was looking for.
The problem is if there is ever a race condition in the code that causes multiple helm deployments to go through at the same time, this technique can cause corruption.
If you deploy the same module in production multiple times at the exact same time, you have bigger problems than this one, my friend. For other environments, just deploy again.
Before avoiding problems occuring once in a million, there are other everyday's problems to solve, generally speaking 😉
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.
Reacted by Rohit Gohri, klose4711, Aleksei Krugliak, Mykola Rybak, Marcos Abreu, HerbalPancake, Lê Hiếu and Ben
Reacted by klose4711, Mykola Rybak, Bryan, jackalope, andrewe123, Erik Sundell, Matthieu Barthelemy, Alexander, harshtblbuildings, HerbalPancake and 4 more
I agree that there's probably not much helm can do to handle this in all occurrences, but there should at least be some acknowledgement of the issue and some clear guidance on how to resolve when it occurs.
The only workarounds I've seen from reading through the issues pages are:
Rollback
This isn't suitable in production environments since the deployment may have been successful (which seem to be the case most of the time this occurs), if so this will cause a disruptive rollback of the application.
Delete the pending status by deleting the k8s secret.
This appears to be a hack workaround that could cause issues since helm is now out of sync with the actual deployment state and could lead to some side-effect on the next three-way merge deployment.
Update the status to failed or successful manually
This appears to be the only suitable workaround. It keeps helm in sync with the real deployment status. However, it requires knowing what to look for to confirm which status to set.
2 or 3 is where I think some official guidance could be provided.
Also, while helm might not be able to prevent the issue, since it is common and very disruptive, could helm provide some tool to resync correctly a stuck pending status?
Hi! As I see there's known bug. I don't think it should be being closed automatically on inactivity. Please reopen it. It's even being fixed in werf/3p-helm fork.
Reacted by Constantin Bugneac, Aleksei Krugliak, Benoit CATILLON, Chris, Brad Booms, Mor Sanderovich, SirSpaceAnchor and Ben
StalebugCategorizes issue or PR as related to a bug.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
Activity
consideRatio commentedon Aug 29, 2018
This may directly also have led to multiple revisions considered to be
DEPLOYEDbut I fail to reproduce that exact steps, but it has happened to me very recently while working with hooks, some of which timed out, some of which failed. Will try to make the multipleDEPLOYEDrevisions reproducible as well, but this is perhaps another issue, it is at least another symptom.[-]helm upgrade > timeout on pre-upgrade hook > revision stuck in `PENDING_UPGRADE`[/-][+]helm upgrade > timeout on pre-upgrade hook > revision stuck in `PENDING_UPGRADE` and multiple `DEPLOYED` revisions arise soon[/+]consideRatio commentedon Aug 29, 2018
By running the same
helm upgradeover, I ended up with multiple revisions beingDEPLOYED.My helm hooks are mostly a DaemonSet pulling images with init-containers with a pause image used by the main container. I also have a Job that awaits the DaemonSet to have the desired ready pods. All hooks have the following annotations.
I think that
tilleris fooled by the delete-policy ofbefore-hook-creation. Something like this...PENDING_UPGRADEno matter what if the helm client times out or not.An indication of this to be somewhat correct, is that the upgrade were considered to be succeeded in the end when it really should or could not be! I had asked it to pull images never to be found in the pre-upgrade hooks, but the actual upgrade happened even though those images did not exist. Somehow, tiller was fooled to believe the hooks completed successfully!
consideRatio commentedon Aug 29, 2018
How to get an indeployable Deployment deployed
I tried to create a minimalistic reproduction and ended up with something slightly different but I bet that this is related.
The following Charts deployment should never be deployed, right? Because it has a hook that should keep running in eternity. But it will be deployed if you run two upgrades in succession and have a hook resource already available with the same name and about to terminate.
Chart.yaml:
templates/deployment.yaml:
templates/job.yaml:
Reproduction commands:
andytom commentedon Nov 27, 2018
I have notice the same issue but we are not using the
before-hook-creation. Our releases still get stuck but it doesn't seem to create duplicate deployed releases.rodriguez-facundo commentedon Aug 13, 2019
Same:
Adhira-Deogade commentedon May 13, 2020
Is there a workaround for this? Is upgrading to helm3 a solution?
naseemkullah commentedon Jun 23, 2020
I've just run into this issue and worked around it by performing a
helm rollbackto a previous release as follows:problem:
fix:
mitchellmaler commentedon Nov 19, 2020
We are running into this same issue with helm 3. The pipeline gets canceled and the helm operation is stuck in pending-upgrade. The current workaround for running a rollback does work but it isn't that great for an automated pipeline unless we add a check before to make sure to "rollback" before deploy.
Is there anyway to just bypass the "pending-upgrade" status on a new deploy without running a rollback?
tamasbege commentedon Dec 10, 2020
We are running on Helm 3.4.1 and are running into the same issue as here from time to time. Worth mentioning that the previous version 3.3.x had no such trouble with the deployments...
Can someone from the Helm team take a look at this and give an update or something?
tamasbege commentedon Dec 10, 2020
See also #8987 and #7476
bcouetil commentedon Dec 11, 2020
Same problem, coming here searching for a reason/fix 👍
46 remaining items
troyanskiy commentedon Apr 20, 2023
I'm stuck here. Can't do any helm install
UPD:
cluster restart solved my issue
bcouetil commentedon Apr 20, 2023
Use this before any upgrade/install (maybe already posted in this issue) :
I initially found it here : #5595 (comment)
TonyMcTony commentedon May 30, 2023
Brilliant, this is exactly what I was looking for.
peteroneilljr commentedon Jun 29, 2023
I'm hitting this bug on helm version 3.12
amannijhawan commentedon Aug 22, 2023
The problem is if there is ever a race condition in the code that causes multiple helm deployments to go through at the same time, this technique can cause corruption.
bcouetil commentedon Aug 22, 2023
If you deploy the same module in production multiple times at the exact same time, you have bigger problems than this one, my friend. For other environments, just deploy again.
Before avoiding problems occuring once in a million, there are other everyday's problems to solve, generally speaking 😉
vijaySamanuri commentedon Sep 15, 2023
If you know the previous timeout
it is better to delete secrets which are pending and hit timeout to avoid unnecessary race condition.
something like
provided clock to be in sync
github-actions commentedon Dec 15, 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.
ksemele commentedon Jan 14, 2024
Please open that issue. It's not resolved.
andrewe123 commentedon Jan 29, 2024
I agree that there's probably not much helm can do to handle this in all occurrences, but there should at least be some acknowledgement of the issue and some clear guidance on how to resolve when it occurs.
The only workarounds I've seen from reading through the issues pages are:
Rollback
This isn't suitable in production environments since the deployment may have been successful (which seem to be the case most of the time this occurs), if so this will cause a disruptive rollback of the application.
Delete the pending status by deleting the k8s secret.
This appears to be a hack workaround that could cause issues since helm is now out of sync with the actual deployment state and could lead to some side-effect on the next three-way merge deployment.
Update the status to failed or successful manually
This appears to be the only suitable workaround. It keeps helm in sync with the real deployment status. However, it requires knowing what to look for to confirm which status to set.
2 or 3 is where I think some official guidance could be provided.
Also, while helm might not be able to prevent the issue, since it is common and very disruptive, could helm provide some tool to resync correctly a stuck pending status?
HerbalPancake commentedon Aug 6, 2024
Hi! As I see there's known bug. I don't think it should be being closed automatically on inactivity. Please reopen it. It's even being fixed in werf/3p-helm fork.
SirSpaceAnchor commentedon May 7, 2025
Still unresolved, and quite annoying.
backstromjoel commentedon Jun 19, 2025
Running into this quite often, how come it's closed?