Skip to content

helm upgrade --install doesn't actually perform install if there are duplicates #2947

Closed

Description

@jeff-knurek

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"

Activity

  1. arehmandev commented on Sep 26, 2017

    @arehmandev

    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

  2. a-chernykh commented on Oct 11, 2017

    @a-chernykh
    Contributor

    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 do helm upgrade --install for the first time, we are getting the following error:

    [debug] Created tunnel using local port: '36831'
    
    [debug] SERVER: "localhost:36831"
    
    [debug] Fetched jiff/environment to /root/.helm/cache/archive/environment-0.0.1.tgz
    
    Release "environment" does not exist. Installing it now.
    [debug] CHART PATH: /root/.helm/cache/archive/environment-0.0.1.tgz
    
    2017/10/11 16:17:22 warning: skipped value for secrets: Not a table.
    2017/10/11 16:17:22 warning: skipped value for secrets: Not a table.
    Error: release environment failed: serviceaccounts "bastion" already exists
    
    [main] 2017/10/11 16:16:00 Starting Tiller v2.6.1 (tls=false)
    [main] 2017/10/11 16:16:00 GRPC listening on :44134
    [main] 2017/10/11 16:16:00 Probes listening on :44135
    [main] 2017/10/11 16:16:00 Storage driver is ConfigMap
    [storage] 2017/10/11 16:16:09 listing all releases with filter
    [storage] 2017/10/11 16:16:13 listing all releases with filter
    [tiller] 2017/10/11 16:17:22 getting history for release environment
    [storage] 2017/10/11 16:17:22 getting release history for "environment"
    [tiller] 2017/10/11 16:17:24 preparing install for environment
    [storage] 2017/10/11 16:17:24 getting release history for "environment"
    2017/10/11 16:17:24 warning: destination for secrets is a table. Ignoring non-table value []
    2017/10/11 16:17:24 warning: skipped value for secrets: Not a table.
    2017/10/11 16:17:24 warning: skipped value for secrets: Not a table.
    [tiller] 2017/10/11 16:17:24 rendering environment chart using values
    [tiller] 2017/10/11 16:17:26 performing install for environment
    [tiller] 2017/10/11 16:17:26 executing 0 pre-install hooks for environment
    [tiller] 2017/10/11 16:17:26 hooks complete for pre-install environment
    [storage] 2017/10/11 16:17:26 getting release history for "environment"
    [storage] 2017/10/11 16:17:26 creating release "environment.v1"
    [kube] 2017/10/11 16:17:26 building resources from manifest
    [kube] 2017/10/11 16:17:28 creating 57 resource(s)
    [tiller] 2017/10/11 16:17:28 warning: Release "environment" failed: serviceaccounts "bastion" already exists
    [storage] 2017/10/11 16:17:28 updating release "environment.v1"
    [tiller] 2017/10/11 16:17:28 failed install perform step: release environment failed: serviceaccounts "bastion" already exists
    [storage] 2017/10/11 16:48:43 listing all releases with filter
    [storage] 2017/10/11 16:53:53 listing all releases with filter
    

    Subsequent runs of the same command succeed.

  3. varunpalekar commented on Nov 17, 2017

    @varunpalekar

    I am also facing same problem:

    $ install_tiller
    Checking Tiller...
    $HELM_HOME has been configured at /root/.helm.
    
    Tiller (the Helm server-side component) has been upgraded to the current version.
    Happy Helming!
    deployment "tiller-deploy" successfully rolled out
    [debug] Created tunnel using local port: '45981'
    
    [debug] SERVER: "localhost:45981"
    
    Client: &version.Version{SemVer:"v2.6.1", GitCommit:"bbc1f71dc03afc5f00c6ac84b9308f8ecb4f39ac", GitTreeState:"clean"}
    Server: &version.Version{SemVer:"v2.6.1", GitCommit:"bbc1f71dc03afc5f00c6ac84b9308f8ecb4f39ac", GitTreeState:"clean"}
    tiller run successfully
    $ helm_docker_secret
    secret "gitlab-registry" deleted
    secret "gitlab-registry" replaced
    $ helm_deploy
    Error: UPGRADE FAILED: no release provided
    
  4. fejta-bot commented on Feb 15, 2018

    @fejta-bot

    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

  5. gsemet commented on Feb 21, 2018

    @gsemet

    same issue here

  6. jeff-knurek commented on Feb 21, 2018

    @jeff-knurek
    Author

    /remove-lifecycle stale

  7. mv78 commented on Mar 11, 2018

    @mv78

    /remove-lifecycle stale

  8. bacongobbler commented on Mar 11, 2018

    @bacongobbler
    Member

    Can you try with v2.8.2 with helm upgrade --install --force?

  9. alexclifford commented on Mar 13, 2018

    @alexclifford

    @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.

  10. burreo commented on May 23, 2018

    @burreo

    same issue exsits with version 2.9.1

  11. pkrishnath commented on Jul 2, 2018

    @pkrishnath

    same issue here with version 2.9.1

  12. vakaobr commented on Aug 6, 2018

    @vakaobr

    same issue here with version 2.9.1

  13. 10 remaining items

  14. choldrim commented on Mar 8, 2019

    @choldrim

    helm upgrace -i --force xx works well with me, client version v2.12.2, server version v2.12.0

    update:
    By the way, it needs executing helm upgrade -i --force xx twice to work well, it gets failed for the first time, and I don't know why. :(

  15. cs94njw commented on May 21, 2019

    @cs94njw

    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.

  16. xoen commented on May 21, 2019

    @xoen

    @cs94njw run helm version will tell you what version of helm (Client) and tiller (Server) you're using.

  17. cs94njw commented on May 21, 2019

    @cs94njw

    Thanks @xoen ! Sorry. I did try that and didn't recognize it. Tired today :(
    Helm client: 2.12.0, server: 2.12.0

  18. manlme commented on May 28, 2019

    @manlme

    I met it in 2.14.

  19. IronCore864 commented on Aug 7, 2019

    @IronCore864

    Still exists, client/server v2.14.2, even with upgrade --install --force, can't make it work. In my case it's a configmap.

  20. antoineozenne commented on Sep 13, 2019

    @antoineozenne

    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.yaml in a .helmignore file in umbrella chart root, then helm ignores these duplicate files when installing or upgrading. Hope it helps !

  21. bakayolo commented on Nov 15, 2019

    @bakayolo

    Still exists and v3, bunch of secrets in my case. --force does not help

  22. santmcodes commented on May 25, 2020

    @santmcodes

    still exists in 2.16. Is re-run the only workaround ?

  23. felipecrs commented on Oct 20, 2020

    @felipecrs
    Contributor

    I think --force makes 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.

  24. jeff-knurek commented on Oct 21, 2020

    @jeff-knurek
    Author

    --force could have unexpected side effects, cause it destroys everything first then re-installs

    the 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.

  25. adapasuresh commented on Dec 14, 2022

    @adapasuresh

    -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

  26. ShamimShahraeini commented on Jun 16, 2024

    @ShamimShahraeini

    encountering the same issue:

    v3.14.4

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