Skip to content
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

WSL2: "helm repo update" stuck #9819

Closed
ghost opened this issue Jun 17, 2021 · 4 comments
Closed

WSL2: "helm repo update" stuck #9819

ghost opened this issue Jun 17, 2021 · 4 comments

Comments

@ghost
Copy link

ghost commented Jun 17, 2021

I'm using WSL to perform my daily tasks.
And I have faced an issue when I trying to call helm repo update command. It stuck with the next output

❯ helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "nginxing" chart repository
...Successfully got an update from the "prometheus-community" chart repository
...Successfully got an update from the "external-dns" chart repository
...Successfully got an update from the "stable" chart repository

My list of added repositories

❯ helm repo list
NAME                    URL
stable                  https://charts.helm.sh/stable
external-dns            https://charts.bitnami.com/bitnami
nginxing                https://kubernetes.github.io/ingress-nginx
prometheus-community    https://prometheus-community.github.io/helm-charts
jetstack                https://charts.jetstack.io

I have found that when I remove jetstack repo helm repo update works as expected. Also, if helm updates jetstack repo not as last one it also works.

❯ helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "nginxing" chart repository
...Successfully got an update from the "jetstack" chart repository
...Successfully got an update from the "prometheus-community" chart repository
...Successfully got an update from the "stable" chart repository
...Successfully got an update from the "external-dns" chart repository
Update Complete. ⎈Happy Helming!⎈

I have found that issue on helm 3.5 but it's occurred even with the latest one.
Also, similar behavior has command helm repo add jetstack https://charts.jetstack.io but it's harder to reproduce.
I'm not sure that issue in helm code but in my opinion, it's a start point.

This issue is really annoying and I want to resolve it or at least find a root cause. Any ideas on how to do that?

Output of helm version:

version.BuildInfo{Version:"v3.6.1", GitCommit:"61d8e8c4a6f95540c15c6a65f36a6dd0a45e7a2f", GitTreeState:"dirty", GoVersion:"go1.16.5"}

Output of go version:

go version go1.16.5 linux/amd64

Output of uname -a:

Linux MyPC 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Version of Windows:
Windows 10 Pro 21H1 19043.1052

@ghost
Copy link
Author

ghost commented Jun 17, 2021

Ok, it's probably some local problem

❯ time helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "nginxing" chart repository
...Successfully got an update from the "prometheus-community" chart repository
...Successfully got an update from the "external-dns" chart repository
...Successfully got an update from the "stable" chart repository
...Successfully got an update from the "jetstack" chart repository
Update Complete. ⎈Happy Helming!⎈
helm repo update  5.05s user 2.73s system 0% cpu 13:18.73 total

but 13 minutes if jetstack repo is added.

@bacongobbler
Copy link
Member

bacongobbler commented Jun 17, 2021

Hmm... Could be a network issue. helm repo update fetches the index from the chart repository. If there are any hangups, it's likely due to a slow/poor network connection with the chart repository.

if _, err := re.DownloadIndexFile(); err != nil {
fmt.Fprintf(out, "...Unable to get an update from the %q chart repository (%s):\n\t%s\n", re.Config.Name, re.Config.URL, err)
} else {
fmt.Fprintf(out, "...Successfully got an update from the %q chart repository\n", re.Config.Name)
}

@cikupin
Copy link

cikupin commented Jun 18, 2021

yup, I got the same issue when using wsl2

@ghost
Copy link
Author

ghost commented Jul 27, 2021

After digging a lot of pages over the internet I have decided to do some Wiresharing of WSL traffic. As result, I have found that seems like my ISP has a problem with the DNS nameserver. When I call helm repo add jetstack https://charts.jetstack.io I see two DNS queries requests - A and AAAA. You could google what's a difference, but in a short AAAA query is used to get IPv6 addresses. In my case AAAA response contains a lot of A records. This produces some confusion on OS or Application level (I'm not sure where exactly) and the helm repo index request is stuck in case if the system gets AAAA response before A response. So I came up with a solution to set nameserver to Google or Cloudflare directly in /etc/resolv.conf. Those nameservers return only IPv6 addresses for AAAA queries and IPv4 for A.
Here is the gist of how to change nameservers in WSL2 (or you could google how to do it) https://gist.github.com/coltenkrauter/608cfe02319ce60facd76373249b8ca6. Or if you don't want to make any changes in WSL you could change the DNS server in your network setup (router or host machine). It also should work.

❯ cat /etc/resolv.conf
# Cloudflare
nameserver 1.1.1.1
# Google
nameserver 8.8.8.8
nameserver 8.8.4.4

Also, WSL has some problems when works with IPv6 microsoft/WSL#4518

Closing this issue.

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

No branches or pull requests

2 participants