argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.78k stars 5.43k forks source link

Adding ACR repo gives 'unsupported protocol scheme' #12634

Open sanderdam opened 1 year ago

sanderdam commented 1 year ago

Checklist:

Describe the bug

I cannot add a Azure Container Registry (ACR) repository as a helm repository, so that I can use the charts pushed there.

To Reproduce

I used the steps listed in this article to push the helm chart. https://learn.microsoft.com/en-us/azure/container-registry/container-registry-helm-repos

I then used the following command to try add the ACR as a helm repository:

argocd repo add acrxxxxxx.azurecr.io/helm --type helm --name acrxxxx --enable-oci --username argocd-creds --password "oJwFNBGsC1qnL2y+calxp/TmuhkhDmFD0Jhnxxxxxxxxxx" --upsert

(some of the characters in the above command has been replaced with 'x'.)

The Repositories screen in ArgoCD UI shows the connection is "Successfull" image

However, when I try to list charts from the repository from the New Application screen, no charts is showing up: image

In the ArgoCD server logs, I can find the following error:

time="2023-02-27T12:01:30Z" level=error msg="finished unary call with code Unknown" error="rpc error: code = Unknown desc = Get \"acrxxxxx.azurecr.io/helm/index.yaml\": unsupported protocol scheme \"\"" grpc.code=Unknown grpc.method=GetHelmCharts grpc.service=repository.RepositoryService grpc.start_time="2023-02-27T12:01:30Z" grpc.time_ms=15.45 span.kind=server system=g

It looks to me, that I added this repository correctly. By creating the repo with the flag --enable-oci. However, it still does not work.

Expected behavior

The expected behavior is that after successfully adding a AKS repo to argo-cd. The charts in that repo will be visible in the new Application dialog.

Screenshots

Screenshot showing the added HELM charts in the Azure Container Registry image

Version

argocd: v2.6.2+6e02f8b
  BuildDate: 2023-02-16T15:37:35Z
  GitCommit: 6e02f8b23201b0620a4ff1bce5d38229ba1eb02e
  GitTreeState: clean
  GoVersion: go1.18.10
  Compiler: gc
  Platform: windows/amd64
argocd-server: v2.6.2+6e02f8b
  BuildDate: 2023-02-16T15:05:14Z
  GitCommit: 6e02f8b23201b0620a4ff1bce5d38229ba1eb02e
  GitTreeState: clean
  GoVersion: go1.18.10
  Compiler: gc
  Platform: linux/amd64
  Kustomize Version: v4.5.7 2022-08-02T16:35:54Z
  Helm Version: v3.10.3+g835b733
  Kubectl Version: v0.24.2
  Jsonnet Version: v0.19.1

Logs

time="2023-02-27T12:01:30Z" level=info msg="received unary call /repository.RepositoryService/ListRefs" grpc.method=ListRefs grpc.request.content="repo:\"acrxxxxx.azurecr.io/helm\" " grpc.service=repository.RepositoryService grpc.start_time="2023-02-27T12:01:30Z" span.kind=server system=grpc
time="2023-02-27T12:01:30Z" level=info msg="received unary call /repository.RepositoryService/ListApps" grpc.method=ListApps grpc.request.content="repo:\"acrxxxx.azurecr.io/helm\" " grpc.service=repository.RepositoryService grpc.start_time="2023-02-27T12:01:30Z" span.kind=server system=grpc
time="2023-02-27T12:01:30Z" level=info msg="finished unary call with code NotFound" error="rpc error: code = NotFound desc = appproject.argoproj.io \"\" not found" grpc.code=NotFound grpc.method=ListApps grpc.service=repository.RepositoryService grpc.start_time="2023-02-27T12:01:30Z" grpc.time_ms=11.896 span.kind=server system=grpc
time="2023-02-27T12:01:30Z" level=info msg="finished unary call with code NotFound" error="rpc error: code = NotFound desc = repository not found" grpc.code=NotFound grpc.method=ListRefs grpc.service=repository.RepositoryService grpc.start_time="2023-02-27T12:01:30Z" grpc.time_ms=19.561 span.kind=server system=grpc
time="2023-02-27T12:01:30Z" level=info msg="received unary call /repository.RepositoryService/GetHelmCharts" grpc.method=GetHelmCharts grpc.request.content="repo:\"acrxxxx.azurecr.io/helm\" " grpc.service=repository.RepositoryService grpc.start_time="2023-02-27T12:01:30Z" span.kind=server system=grpc
time="2023-02-27T12:01:30Z" level=error msg="finished unary call with code Unknown" error="rpc error: code = Unknown desc = Get \"acrxxxx.azurecr.io/helm/index.yaml\": unsupported protocol scheme \"\"" grpc.code=Unknown grpc.method=GetHelmCharts grpc.service=repository.RepositoryService grpc.start_time="2023-02-27T12:01:30Z" grpc.time_ms=15.45 span.kind=server system=grpc
time="2023-02-27T12:01:34Z" level=info msg="finished streaming call with code OK" grpc.code=OK grpc.method=Watch grpc.service=application.ApplicationService grpc.start_time="2023-02-27T12:01:26Z" grpc.time_ms=7662.842 span.kind=server system=grpc
time="2023-02-27T12:01:37Z" level=info msg="received unary call /application.ApplicationService/List" grpc.method=List grpc.request.content="projects:\"default\" selector:\"\" appNamespace:\"\" " grpc.service=application.ApplicationService grpc.start_time="2023-02-27T12:01:37Z" span.kind=server system=grpc
time="2023-02-27T12:01:37Z" level=info msg="finished unary call with code OK" grpc.code=OK grpc.method=List grpc.service=application.ApplicationService grpc.start_time="2023-02-27T12:01:37Z" grpc.time_ms=14.998 span.kind=server system=grpc
Pionerd commented 1 year ago

Hi @sanderdam, any progress on this one? For us, it seems to work (we can pull charts), only the list functionality you describe is not working. Did you see similar behavior? Also: what permissions did you give the service principal? Maybe 'AcrPull' is not allowed to see everything?

sanderdam commented 1 year ago

Hi @Pionerd,

The ACR indeed works without using the UI. So when I add a application resources it will pull the charts from the Azure Container Registry. It was the list function that is not working.