Skip to content

helm dependency update fails after helm upgrade #2998

Closed

Description

@nsitbon

Hi

I'm using Helm from Concourse pipeline I just upgraded Helm to 2.6.1 (from 2.4.2) and my pipeline doesn't work anymore.
The culprit line seems to be https://github.com/kubernetes/helm/blob/v2.6.1/pkg/downloader/manager.go#L220

$ helm dependency update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "ci" chart repository
...Successfully got an update from the "local" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈Happy Helming!⎈
Error: Unable to move current charts to tmp dir: rename /tmp/build/put/staging-helm/cvhub-api/charts /tmp/build/put/staging-helm/cvhub-api/tmpcharts: invalid cross-device link

I cannot change the path used by Concourse but if I do the same command manually on my mac from my home directory (i.e not from /tmp) it works:

% ~/Downloads/helm dependency update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "ci" chart repository
...Successfully got an update from the "local" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading elasticsearch-singlenode from repo http://127.0.0.1:8879
±|develop ✘| cvhub-api
% pwd
/Users/nsitbon/github/cvhub-api/scripts/helm/cvhub-api

As far as I understand the error and the related code it seems that you should not use Rename rather you should use Move.

Any help would be appreciated.

Best regards.

Activity

  1. redbaron commented on Oct 4, 2017

    @redbaron
    Contributor

    It seems that either source or destination is mount point, therefore rename doesn’t work. If you change your concourse pipeline so that both source and destination are on the same mount point it should work

  2. nsitbon commented on Oct 4, 2017

    @nsitbon
    Author

    I know and like I said I'm just a Concourse user I cannot change how it works and how it mounts directory. However I expect Helm working whatever the configuration like before.

  3. bacongobbler commented on Oct 4, 2017

    @bacongobbler
    Member

    This should be a relatively quick fix. I know what’s causing this. I’ll make a PR this morning.

  4. bacongobbler commented on Oct 4, 2017

    @bacongobbler
    Member

    For now you should downgrade to v2.5.x.

  5. nsitbon commented on Oct 4, 2017

    @nsitbon
    Author

    This is exactly what I did. Thx @bacongobbler

  6. thomastaylor312 commented on Oct 7, 2017

    @thomastaylor312
    Contributor

    @bacongobbler Did you end up opening a PR for this? Is it a bug that should be pulled into 2.7?

  7. bacongobbler commented on Oct 7, 2017

    @bacongobbler
    Member

    Sorry didn’t get around to making a PR last week, but I’ll have some free time on Monday. Thanks for the ping :)

  8. bacongobbler commented on Oct 7, 2017

    @bacongobbler
    Member

    This was a bug introduced in a new feature for 2.6 so yeah it should be slated for 2.7.

  9. redbaron commented on Oct 9, 2017

    @redbaron
    Contributor

    Marking it as a bug means, that any use of os.Rename is a bug "because of concourse". Atomic rename of a .tmp folder into final destination next to it is a well known, widely use pattern, there is nothing wrong with it.

    @nsitbon , concourse gives you full control over final mounts and file locations.

  10. nsitbon commented on Oct 9, 2017

    @nsitbon
    Author

    @redbaron I disagree with "widely use pattern" I mean you should not make any assumptions on the filesystem or impose anything. By the way I don't find anything in the concourse documentation giving me access to the final mounts and file location as concourse is using docker to run its tasks it makes sense to mount the result from one task to another via mount points. Anyway Concourse or not I do think you shouldn't impose filesystem requirements because in this case you would force all your users to change their code whereas in the other case you only have to change your code.

  11. bacongobbler commented on Oct 10, 2017

    @bacongobbler
    Member

    I also disagree, though for different reasons. I was calling out the fact that we are not utilizing os.TempDir() as an issue, not the fact that using os.Rename is a bug. If Concourse sets up and utilizes $TMPDIR correctly, this shouldn't be an issue moving forward, especially since we use ioutil.TempDir everywhere else in the codebase.

    As far as I understand the error and the related code it seems that you should not use Rename rather you should use Move.

    os.Rename is a move operation, so we're doing the right thing here. It's just the fact that we're not writing to a temporary scratch directory that may be the issue.

  12. bacongobbler commented on Oct 10, 2017

    @bacongobbler
    Member

    #3021 is the proposed fix. @nsitbon if you have some time and are able to build helm from scratch, would you mind testing that fix? Thanks!

  13. redbaron commented on Oct 10, 2017

    @redbaron
    Contributor

    I disagree with "widely use pattern"

    It is a fact. It is only way to create a directory with it's content in an atomic way. Every good behaving program creates directories with populated content in this way. What you are asking is essentially to ban rename(2) syscall when called with directories as an argument. This alone should set alarms off and begs the question is it a right thing to ask. Just search github for os.Rename, every single time it is called on directories, it can break your concourse setup. Do all of them wrong?

    As for concourse, feel free to ask them on a slack channel, they are very helpful. If you change what task is producing from content of charts to a charts directory itself, in other words move mount point

    /tmp/build/put/staging-helm/cvhub-api/charts
                                         ^- from here
                               ^----------- to here
    

    everything will just work.

    @bacongobbler patch makes things worse and wont help with this "problem" at all, as it is even more likely that $TMPDIR is on a separate mountpoint from m.ChartPath. Absolute correct way would be to do ioutil.TempDir(m.ChartPath, "tmpcharts"), then there can be no clashes with random leftovers in tmpdir.

  14. 43 remaining items

  15. bacongobbler commented on Mar 7, 2019

    @bacongobbler
    Member

    Thanks for the ping @chriscone.

    For reference, here is the PR (had to go looking to find it again): #5038

    The PR introduces code from dep, which is BSD-licensed code and is okay to re-license it as Apache 2 code. The problem at hand, though, is that we're unsure if copying code from internal/fs follows the DCO.

    I can't recall who was looking into this, but it probably fell through the cracks. I'll open a ticket with the CNCF service desk and see if we can get the legal team to weigh in on this topic.

  16. de-code commented on Jul 2, 2019

    @de-code

    A simple workaround for me (which I didn't see above), was to just remove the charts directory - or add it to something like .dockerignore to not copy it in the first place (if it's part of a Docker build). May not work for everyone.

  17. bacongobbler commented on Aug 14, 2019

    @bacongobbler
    Member

    due to inactivity, I had to close #5038. If anyone else feels like taking this across the finish line, please feel free!

  18. bacongobbler commented on Apr 24, 2020

    @bacongobbler
    Member

    fixed in #6750.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions