Repository navigation
Closed
Labels
Description
If you have the same resources (ie secrets) in a chart, (or more likely, multiple subcharts create the same secret) helm upgrade --install fails with
Error: release releaseName failed: secrets "secret-name" already exists
To reproduce:
helm create test- add secrets file to
test/templates - make a copy of the secrets file in the same path
helm upgrade --install releaseName test/
Work-around:
- run the same cmd again:
helm upgrade --install releaseName test/
It seems that after the namespace exists, upgrade allows for the duplicate resources. It switches from creating 3 resource(s) to checking 3 resources for changes.
This workaround defeats the whole purpose of having an --install option to upgrade. But it's worth noting that this error also appears when running helm install test/ --name releaseName
Logs in the tiller:
[tiller] 2017/09/18 15:28:13 getting history for release t2
[storage] 2017/09/18 15:28:13 getting release history for "t2"
[tiller] 2017/09/18 15:28:13 preparing install for t2
[storage] 2017/09/18 15:28:13 getting release history for "t2"
[tiller] 2017/09/18 15:28:13 rendering test2 chart using values
2017/09/18 15:28:13 info: manifest "test2/templates/ingress.yaml" is empty. Skipping.
[tiller] 2017/09/18 15:28:13 performing install for t2
[tiller] 2017/09/18 15:28:13 executing 0 pre-install hooks for t2
[tiller] 2017/09/18 15:28:13 hooks complete for pre-install t2
[storage] 2017/09/18 15:28:13 getting release history for "t2"
[storage] 2017/09/18 15:28:13 creating release "t2.v1"
[kube] 2017/09/18 15:28:13 building resources from manifest
[kube] 2017/09/18 15:28:13 creating 3 resource(s)
[tiller] 2017/09/18 15:28:13 warning: Release "t2" failed: secrets "secret-name" already exists
[storage] 2017/09/18 15:28:13 updating release "t2.v1"
[tiller] 2017/09/18 15:28:13 failed install perform step: release t2 failed: secrets "secret-name" already exists
and if you run the same command again (ie: workaround):
[tiller] 2017/09/18 15:23:27 getting history for release t2
[storage] 2017/09/18 15:23:27 getting release history for "t2"
[tiller] 2017/09/18 15:23:28 preparing update for t2
[storage] 2017/09/18 15:23:28 getting last revision of "t2"
[storage] 2017/09/18 15:23:28 getting release history for "t2"
[tiller] 2017/09/18 15:23:28 rendering test2 chart using values
2017/09/18 15:23:28 info: manifest "test2/templates/ingress.yaml" is empty. Skipping.
[tiller] 2017/09/18 15:23:28 creating updated release for t2
[storage] 2017/09/18 15:23:28 creating release "t2.v2"
[tiller] 2017/09/18 15:23:28 performing update for t2
[tiller] 2017/09/18 15:23:28 executing 0 pre-upgrade hooks for t2
[tiller] 2017/09/18 15:23:28 hooks complete for pre-upgrade t2
[kube] 2017/09/18 15:23:28 building resources from updated manifest
[kube] 2017/09/18 15:23:28 checking 3 resources for changes
[kube] 2017/09/18 15:23:28 Looks like there are no changes for Secret "secret-name"
[kube] 2017/09/18 15:23:28 Looks like there are no changes for Secret "secret-name"
[kube] 2017/09/18 15:23:28 Looks like there are no changes for Secret "secret-name"
[tiller] 2017/09/18 15:23:28 executing 0 post-upgrade hooks for t2
[tiller] 2017/09/18 15:23:28 hooks complete for post-upgrade t2
[storage] 2017/09/18 15:23:28 updating release "t2.v1"
[tiller] 2017/09/18 15:23:28 updating status for updated release for t2
[storage] 2017/09/18 15:23:28 updating release "t2.v2"
[storage] 2017/09/18 15:23:29 getting last revision of "t2"
[storage] 2017/09/18 15:23:29 getting release history for "t2"
[kube] 2017/09/18 15:23:29 Doing get for Secret: "secret-name"
[kube] 2017/09/18 15:23:29 Doing get for Secret: "secret-name"
[kube] 2017/09/18 15:23:29 Doing get for Secret: "secret-name"
Reacted by José Alberto, Abdirahman Mohamed Abdi Daud, René Filip, Sedat Gokcen, Chris McGrath, PG0506, Desmond Kirrane, Ramo Mislimi, Maciej Olko, Kévin Dunglas and 13 more
Reacted by Aldo Giambelluca
Activity
arehmandev commentedon Sep 26, 2017
To add to this, if the configmap generated by helm is too big, it will not store the 'release', but it will deploy things. So you have to manually delete resources via kubectl delete
a-chernykh commentedon Oct 11, 2017
I think we are having a similar problem, but with
ServiceAccount. We do have a single copy of a ServiceAccount resource in our chart. When we dohelm upgrade --installfor the first time, we are getting the following error:Subsequent runs of the same command succeed.
varunpalekar commentedon Nov 17, 2017
I am also facing same problem:
fejta-bot commentedon Feb 15, 2018
Issues go stale after 90d of inactivity.
Mark the issue as fresh with
/remove-lifecycle stale.Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with
/close.Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale
gsemet commentedon Feb 21, 2018
same issue here
jeff-knurek commentedon Feb 21, 2018
/remove-lifecycle stale
mv78 commentedon Mar 11, 2018
/remove-lifecycle stale
bacongobbler commentedon Mar 11, 2018
Can you try with v2.8.2 with
helm upgrade --install --force?alexclifford commentedon Mar 13, 2018
@bacongobbler I still get this on v2.8.2. I worked around it by not using dependencies (that are shared between my other applications) and installed the dependencies manually.
burreo commentedon May 23, 2018
same issue exsits with version 2.9.1
pkrishnath commentedon Jul 2, 2018
same issue here with version 2.9.1
vakaobr commentedon Aug 6, 2018
same issue here with version 2.9.1
10 remaining items
choldrim commentedon Mar 8, 2019
helm upgrace -i --force xxworks well with me, client versionv2.12.2, server versionv2.12.0update:
By the way, it needs executing
helm upgrade -i --force xxtwice to work well, it gets failed for the first time, and I don't know why. :(cs94njw commentedon May 21, 2019
But when applying in Kubernetes, it will skip over resources which already exist. Why doesn't Helm do the same? Why not just ignore it? Or make ignoring it a command line parameter?
I can't tell what version of helm I have installed - there's seemingly no command for that. But I'm pretty sure it is a recent version.
We are using Helm for our CI/CD, and so running it twice isn't great.
I think that actually our service has already been created by an Umbrella chart, and when I'm trying to upgrade an individual module it then complains. So actually, Helm is already managing it.
I don't want to modify the Umbrella chart for SNAPSHOT deployments as other people may be modifying and deploying other module at the same time.
xoen commentedon May 21, 2019
@cs94njw run
helm versionwill tell you what version of helm (Client) and tiller (Server) you're using.cs94njw commentedon May 21, 2019
Thanks @xoen ! Sorry. I did try that and didn't recognize it. Tired today :(
Helm client: 2.12.0, server: 2.12.0
manlme commentedon May 28, 2019
I met it in 2.14.
IronCore864 commentedon Aug 7, 2019
Still exists, client/server v2.14.2, even with upgrade --install --force, can't make it work. In my case it's a configmap.
antoineozenne commentedon Sep 13, 2019
I found a solution for my case. I have an umbrella chart and subcharts that all create a regcred to pull docker images. The thing : use a .helmignore file. I just set
charts/*/regcred.yamlin a.helmignorefile in umbrella chart root, then helm ignores these duplicate files when installing or upgrading. Hope it helps !bakayolo commentedon Nov 15, 2019
Still exists and v3, bunch of secrets in my case.
--forcedoes not helpsantmcodes commentedon May 25, 2020
still exists in 2.16. Is re-run the only workaround ?
felipecrs commentedon Oct 20, 2020
I think
--forcemakes sense in this case, but if not, we could also introduce a new parameter such as--ignore-existing-secrets.The problem of re-running is that it makes very less scriptable, and time wasting.
jeff-knurek commentedon Oct 21, 2020
--forcecould have unexpected side effects, cause it destroys everything first then re-installsthe problem with "adding a new parameter" is that version 2.x is deprecated and the code is frozen, so nothing more can be done about it. It seems that the related issues in v3 are resolved.
adapasuresh commentedon Dec 14, 2022
-bash-4.2$ helm version
version.BuildInfo{Version:"v3.5.4", GitCommit:"1b5edb69df3d3a08df77c9902dc17af864ff05d1", GitTreeState:"clean", GoVersion:"go1.15.11"}
-bash-4.2$ helm upgrade --install --debug cbysconnector-test service-helms/CbysConnector-Test --set image.tag=cbysconnector-test-91dbb7f-26 --set image.repository=XXXX.amazonaws.com/pluraldev --namespace=default
history.go:56: [debug] getting history for release cbysconnector-test
Release "cbysconnector-test" does not exist. Installing it now.
install.go:173: [debug] Original chart version: ""
install.go:190: [debug] CHART PATH: /var/lib/jenkins/workspace/CbysConnector-Test-Java/EKS_Dev/CbysConnector-Test-job/HelmDir/service-helms/CbysConnector-Test
client.go:122: [debug] creating 6 resource(s)
Error: configmaps "filebeat-configmap-cybsconnector" already exists
helm.go:81: [debug] configmaps "filebeat-configmap-cybsconnector" already exists
ShamimShahraeini commentedon Jun 16, 2024
encountering the same issue:
v3.14.4