8000 chart go-getter git fetch fails if cache is empty · Issue #1660 · roboll/helmfile · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chart go-getter git fetch fails if cache is empty #1660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kirrmann opened this issue Jan 27, 2021 · 8 comments · Fixed by #1669
Closed

chart go-getter git fetch fails if cache is empty #1660

kirrmann opened this issue Jan 27, 2021 · 8 comments · Fixed by #1669

Comments

@kirrmann
Copy link
kirrmann commented Jan 27, 2021

Hi,

latest version 0.137.0 fails to fetch a chart git repo (go-getter style). Error states that it's because the folder/cache already exists or cannot unlink directory. Running helmfile a second or third time fixes this error. Error is reproducible if I delete helmfile.d directory

helmfile:

releases:
  - name: test1
    namespace: test
    chart: git::https://github.com/mintel/dex-k8s-authenticator.git@charts/dex-k8s-authenticator?ref=v1.1.0
    values:
      - values1.yaml

First run:

in ./helmfile.yaml: [release "dex-kibana": fetching "git::https://github.com/mintel/dex-k8s-authenticator.git@charts/dex?ref=v1.1.0": get: error downloading 'https://github.com/mintel/dex-k8s-authenticator.git?ref=v1.1.0': /usr/local/bin/git exited with 128: fatal: could not create work tree dir '.helmfile/cache/https_github_com_mintel_dex-k8s-authenticator_git.ref=v1.1.0': File exists

Second run (not always but often):

in ./helmfile.yaml: [release "dex-kibana": fetching "git::https://github.com/mintel/dex-k8s-authenticator.git@charts/dex?ref=v1.1.0": get: error downloading 'https://github.com/mintel/dex-k8s-authenticator.git?ref=v1.1.0': /usr/local/bin/git exited with 128: fatal: unlinkat .helmfile/cache/https_github_com_mintel_dex-k8s-authenticator_git.ref=v1.1.0/.git: directory not empty]

If I define in releases another chart go-getter for the same git repo I hit both errors at the same run.

Subsequent runs work without issue.

@mumoshu
Copy link
Collaborator
mumoshu commented Jan 30, 2021

@kirrmann Thanks for reporting! I haven't tried this with 0.137.0 but at least it didn't work for me as well with 0.138.x, as @kevin-lindsay-1 has also reported in #1664.

After a bit of investigation, it seems like this is a regression introduced via https://github.com/roboll/helmfile/pull/1629/files#diff-7e4e87a1e777423a3d9a915e00fb78a9c4fc2f4c476863f60b67e89b9c635697R990

@mumoshu
Copy link
Collaborator
mumoshu commented Feb 3, 2021

@kirrmann JFYI, I couldn't reproduce this with the below setup:

$ cat helmfile.yaml
releases:
  - name: test1
    namespace: test
    chart: git::https://github.com/mintel/dex-k8s-authenticator.git@charts/dex-k8s-authenticator?ref=v1.1.0

$ rm -rf .helmfile

$ helmfile-0.137.0 version
helmfile version v0.137.0

$ helmfile-0.137.0 template
<properly rendered manifests>

I'm still working on #1667 that should fix #1664 for v0.138.x.

@kirrmann
Copy link
Author
kirrmann commented Feb 3, 2021

Hi, thanks for your fast response.

I took another look at it. I can only cleanly reproduce it if I have two releases defined, both with the go-getter pointing to the same git repo, but not necessarily the exact same url. It works if I filter the releases with -n name=test1 but at soon as both are processed I'm hitting that error. I missed that the first time, because I'm using helmfiles: [] to include other helmfile.yaml

  - name: test1
    namespace: test
    chart: git::https://github.com/mintel/dex-k8s-authenticator.git@charts/dex?ref=v1.1.0
  - name: test2
    namespace: test
    chart: git::https://github.com/mintel/dex-k8s-authenticator.git@charts/dex-k8s-authenticator?ref=v1.1.0

Btw: 0.138.2 doesn't work at all for me

STDERR:
  Error: failed to download "git::https://github.com/mintel/dex-k8s-authenticator.git@charts/dex?ref=v1.1.0" (hint: running `helm repo update` may help)

@kirrmann
Copy link
Author
kirrmann commented Feb 3, 2021

I tested older releases and I think this isn't a regression. Even with 0.125.0 this issue shows up.

@mumoshu
Copy link
Collaborator
mumoshu commented Feb 3, 2021

@kirrmann Thank you so much for your support! That's super helpful. I'll try to fix it soon 👍

@mumoshu
Copy link
Collaborator
mumoshu commented Feb 4, 2021

@kirrmann #1669 should fix it for you. I was able to reproduce this problem with two releases with the same go-getter URL in chart and it never reproduced after applying #1669 locally.

@kirrmann
Copy link
Author
kirrmann commented Feb 4, 2021

I just tested #1669 and it fixes the issue 👍 thanks

@mumoshu
Copy link
Collaborator
mumoshu commented Feb 5, 2021

@kirrmann Thanks for confirming! I've released v0.138.4 for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0