argo-cd: ArgoCD is not using helm repository credentials for Chart dependencies
If you are trying to resolve an environment-specific issue or have a one-off question about the edge case that does not require a feature then please consider asking a question in argocd slack channel.
Checklist:
- I’ve searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
- I’ve included steps to reproduce the bug.
- I’ve pasted the output of
argocd version
.
Describe the bug
Password protected private helm repository throws an error when added as dependency to helm chart Chart.yaml file.
To Reproduce
- Create a private helm repo.( GitHub Repo hacked to work as helm chart registry in my case)
- Create a Secret in ArgoCD either with label
argocd.argoproj.io/secret-type: repo-creds
or
argocd.argoproj.io/secret-type: repository
and helm chart registry info
url: "https://raw.githubusercontent.com/org/helm-charts/main/docs"
name: "helm-charts"
type: "helm"
username: ""
password: ""
- Create an helm-type app with above helm chart dependency.
Expected behavior
ArgoCD Should be able to resolve helm chart dependencies using either repo-creds or repository secrets.
Screenshots
rpc error: code = Unknown desc = Manifest generation error (cached): `helm repo add raw.githubusercontent.com https://raw.githubusercontent.com/org/helm-charts/main/docs` failed exit status 1: Error: looks like "https://raw.githubusercontent.com/org/helm-charts/main/docs" is not a valid chart repository or cannot be reached: failed to fetch https://raw.githubusercontent.com/org/helm-charts/main/docs/index.yaml : 404 Not Found
Version
v2.1.1+aab9542
Logs
NA
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 27
- Comments: 36 (3 by maintainers)
This issue is a very big concern for me as well. I have the issue in the latest 2.3.x version (2.3.4) and also tried the Release Candidate of 2.4 version (2.4.0-rc5) and both version seems to have the issue. Here are my files: Repository secret file
My application file:
And this is my
Chart.yaml
located on my git repository referenced in myApplication
yaml:Without
passCredentials
:With
passCredentials
:I also tried setting my repository as an OCI one with the following settings for the repository :
and the passCredentials option for the app:
Using the URL with
oci://
instead ofhttps://
on myChart.yaml
but it always fail with401
error.Do you guys have any update on this issue ?
@chetan-rns i can add a chart directly, but if i have a chart.yaml in a git repo that points to another private chart repo it wont work
note we are using azure acr as our registry. the new passCredentials argument dont fix it, still 401
I have same issues, but not fixed mine.
Tested on latest
2.2.1
and still same issue. Our helm repo is unconventional, added as such:(works on our current version
2.0.5
)I have the same issue with v2.8.4 Any update?
I found a workaround that works for me, but may not be okay for everyone. By creating a new helm repository in the same project as my application, I am able to use the credentials I provided. It didn’t work without specifying a project in the repository definition and it didn’t work with the
default
project.I tested this in
v2.2.0+6da92a8
.Same here. Rollbacked argocd 2.1 because of private repo access issue. I could create the repository config through UI and it would register fine. I could see 200 in my private repo logs. But when chart generation time comes it looks like that these credentials are not used by argocd controller anymore. Just in my case it was Forbidden 403. Same config with 2.0.5 worked flawlessly.
You can get 404 Not Found back from GitHub when you are trying to access private GitHub Repos without credentials. from the looks of it,
helm repo add
command is not using credentials to add the private repo.Was facing the same issues when I’ve upgraded ArgoCD from v2.0.5 to v.2.1.8. But I was able to fix it (thanks to @moustafab comment above) if I had included the Helm repository (Artifactory) in the
sourceRepos
settings of the project which the application was bound to. Had also tested the following scenarios:argocd.argoproj.io/secret-type: repository
resp.argocd.argoproj.io/secret-type: repo-creds
argocd-cm
configMapBoth scenarios are working fine.
@alexmt we dont specify index.yaml in the chart url
snippet from error above
index.yaml was automatically added by helm commands.
It works without index.yaml in 2.0.5
I also have the same issue using OCI repo from github, and adding the
*
on source repos for the project didn’t solve. I’m using argo version 2.4.7When I exec inside the repo-server pod and run
helm registry login
then pull the chart it starts working.We also ran into this and tried to reproduce the bug. In our case it was a “trailing slash” at the end of the URL pointing to a private helm repository (this was already noticed by @steinarox in https://github.com/argoproj/argo-cd/issues/7104#issuecomment-1032269035).
We had
Chart.yaml
files, located in git repositories pointed to by ArgoCD applications, with content similar to the following:ArgoCD in version 2.2.5 can’t sync the application then.
A sync error like:
will be shown.
This still works in version 2.0.5.
After removing the trailing slash from “https://my.own.chartmuseum.example.com/” the ArgoCD application can be synced again.