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

impossible to add external HELM repos #3055

Closed
zeph opened this issue Jan 30, 2020 · 13 comments
Closed

impossible to add external HELM repos #3055

zeph opened this issue Jan 30, 2020 · 13 comments
Labels
bug Something isn't working
Milestone

Comments

@zeph
Copy link
Contributor

zeph commented Jan 30, 2020

DeepinScreenshot_seleziona-area_20200130142254

via web or via cli

$ argocd repo add https://kubernetes-charts.storage.googleapis.com --type helm --name stable
FATA[0060] rpc error: code = Unknown desc = unexpected EOF

same issue... these are the versions involved

argocd: v1.4.2+48cced9
  BuildDate: 2020-01-24T01:04:04Z
  GitCommit: 48cced9d925b5bc94f6aa9fa4a8a19b2a59e128a
  GitTreeState: clean
  GoVersion: go1.12.6
  Compiler: gc
  Platform: linux/amd64
argocd-server: v1.4.2+48cced9
  BuildDate: 2020-01-24T01:07:03Z
  GitCommit: 48cced9d925b5bc94f6aa9fa4a8a19b2a59e128a
  GitTreeState: clean
  GoVersion: go1.12.6
  Compiler: gc
  Platform: linux/amd64
  Ksonnet Version: v0.13.1
  Kustomize Version: Version: {Version:kustomize/v3.2.1 GitCommit:d89b448c745937f0cf1936162f26a5aac688f840 BuildDate:2019-09-27T00:10:52Z GoOs:linux GoArch:amd64}
  Helm Version: v2.15.2
  Kubectl Version: v1.14.0
@zeph zeph added the bug Something isn't working label Jan 30, 2020
@jannfis
Copy link
Member

jannfis commented Jan 30, 2020

Hm, both error messages seem weird. Have you C&P'ed the repo URL from somewhere, and does it contain some non-printable characters in it maybe? Can you add Git repositories? Is anything in the logs of the argocd-server pod(s)?

@zeph
Copy link
Contributor Author

zeph commented Jan 30, 2020

argocd-server-855d5f9fb-ggtvp argocd-server time="2020-01-30T13:22:26Z" level=error msg="finished unary call with code Unknown" error="parse https://kubernetes-charts.storage.googleapis.com : invalid character \" \" in host name" grpc.code=Unknown grpc.method=Create grpc.service=repository.RepositoryService grpc.start_time="2020-01-30T13:22:26Z" grpc.time_ms=1.355 span.kind=server system=grpc
argocd-server-855d5f9fb-ggtvp argocd-server time="2020-01-30T13:23:02Z" level=error msg="finished unary call with code Unknown" error="Get https://kubernetes-charts.storage.googleapis.com/index.yaml: dial tcp 74.125.140.128:443: connect: connection timed out" grpc.code=Unknown grpc.method=ValidateAccess grpc.service=repository.RepositoryService grpc.start_time="2020-01-30T13:20:55Z" grpc.time_ms=127256.95 span.kind=server system=grpc
argocd-server-855d5f9fb-ggtvp argocd-server time="2020-01-30T14:13:39Z" level=error msg="finished unary call with code Unknown" error="Get https://kubernetes-charts.storage.googleapis.com/index.yaml: dial tcp 142.250.13.128:443: connect: connection timed out" grpc.code=Unknown grpc.method=ValidateAccess grpc.service=repository.RepositoryService grpc.start_time="2020-01-30T14:11:32Z" grpc.time_ms=127317.086 span.kind=server system=grpc

p.s. I'm going to check:

  1. if I get errors in the proxy logs
  2. if NOT, if the argocd-server set of pods has the proxy_settings
  3. the character "" empty thing, seems not reproducible

@jannfis
Copy link
Member

jannfis commented Jan 30, 2020

Ah, thanks for the additional info. I think Helm repositories can't be connected when using a HTTP proxy server. That's an unfortunate current limitation, IIRC (see also #2826)

@zeph
Copy link
Contributor Author

zeph commented Jan 30, 2020

@jannfis but why? seen my note on #2826 ? until all go http libraries respected the standard looking at env variables HTTP_PROXY, HTTPS_PROXY and NO_PROXY

@jannfis
Copy link
Member

jannfis commented Jan 30, 2020

We use a custom HTTP transport configuration for TLS parametrization, and it seems that it doesn't pick up the HTTP proxy environment variables in this function:

func (c *nativeHelmChart) GetIndex() (*Index, error) {

The fix should be easy, as we're picking up the variables and parametrize the HTTP transport configuration for Git repositories already.

@zeph
Copy link
Contributor Author

zeph commented Jan 30, 2020

@jannfis hold my 🍺 ...i'm attempting to build on my laptop the whole thing

@jannfis
Copy link
Member

jannfis commented Jan 30, 2020

Basically, this should do it:

$ git diff
diff --git a/util/helm/client.go b/util/helm/client.go
index 34447a8d..245e88ca 100644
--- a/util/helm/client.go
+++ b/util/helm/client.go
@@ -188,7 +188,10 @@ func (c *nativeHelmChart) GetIndex() (*Index, error) {
        if err != nil {
                return nil, err
        }
-       tr := &http.Transport{TLSClientConfig: tlsConf}
+       tr := &http.Transport{
+               Proxy: http.ProxyFromEnvironment,
+               TLSClientConfig: tlsConf,
+       }
        client := http.Client{Transport: tr}
        resp, err := client.Do(req)
        if err != nil {

If you have success with this patch, it would be awesome if you can check https://argoproj.github.io/argo-cd/CONTRIBUTING/ and submit a PR! :)

@zeph
Copy link
Contributor Author

zeph commented Jan 30, 2020

nevermind... I'm still compiling the dependencies... 🤦‍♂️

ok, I will

@zeph
Copy link
Contributor Author

zeph commented Jan 31, 2020

@jannfis pull request provided... the CI is failing,
but also my local build, on a step (ksonnet) completely unrelated

alexmt added a commit that referenced this issue Feb 2, 2020
* attempting to fix HTTP|HTTPS|NO_PROXY env variable reading #3055 -> @jannfis tnx for the snippet ;)

* adding a couple of sponsors references

* fix! semanthic and form of the statement

* doc: add ref. to companies that sponsored my work on ArgoCD #3055

* avoiding problems

* Trigger notification

Co-authored-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
@jkleinlercher
Copy link
Contributor

Great! Can this fix be backported to 1.4?

@zeph
Copy link
Contributor Author

zeph commented Feb 4, 2020

@alexmt ? is it a matter of a cherry-pick what @jkleinlercher wants or it involves more effort?

@alexmt
Copy link
Collaborator

alexmt commented Feb 4, 2020

@zep, @jkleinlercher . We plan to release 1.4.3 by end of week. Master got a lot of fixes since v1.4.2. Going to cherry-pick most of them into v1.4.3

@alexmt alexmt added this to the v1.5 milestone Feb 18, 2020
@alexmt
Copy link
Collaborator

alexmt commented Mar 23, 2020

Released in 1.5.0-rc1

@alexmt alexmt closed this as completed Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants