argoproj / argo-cd

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

repo server seems to refresh helm dependency not related to Application #11953

Open jdomag opened 1 year ago

jdomag commented 1 year ago

Checklist:

Describe the bug Argocd 2.4.18

Few times a day, we see various errors (examples below) during our CICD that does the following:

Our applications are helm charts that have dependency in Chart.yaml to our own helm chart repository and are not related anyhow to bitnami helm repository. However our pipeline crashes during set or sync commands - argo-repo servers returns an error related to bitnami helm repository. Examples:

helm dependency build` failed exit status 1: Error: error loading /helm-working-dir/repository/https:--charts.bitnami.com-bitnami-index.yaml: 
error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go struct field 
ChartVersion.entries.annotations of type map[string]string\nError: plugin \"secrets\" exited with error
finished unary call with code Unknown" error="`helm dependency build` failed exit status 1: Error:
 error loading /helm-working-dir/repository/https:--charts.bitnami.com-bitnami-index.yaml: 
error unmarshaling JSON: while decoding JSON: json: cannot unmarshal number into Go 
struct field ChartVersion.entries.version of type string\nError: plugin \"secrets\" exited with 
error" grpc.code=Unknown grpc.method=GenerateManifest grpc.service=repository.RepoServerService grpc.start_time="2023-01-11T08:35:49Z" grpc.time_ms=1640.574 span.kind=server 
system=grpc

In repo-server when I issue "helm repo list" I can't see any repositories, which is expected since we only use dependency in Chart.yaml. We have indeed few apps e.g. redis that are deployed from bitnami helm chart, but the problem is not about CICD for those charts as we don't update those very frequently. So my question would be, why argo during 'argocd app set' or 'argocd app sync' refresh bitnami helm repository for Application that is not related to this repository. There are some issues on bitnami where people complains about stability of their repository, but this is a different story.

To Reproduce

this happens occasionally, I haven't managed to reproduce it yet.

Expected behavior

repo-server doesn't check unrelated dependencies

amitblumshtien commented 1 year ago

We're also having this issue. We have environments we run from our CI/CD and using argo cli app sync command. In the app chart.yaml we are using a local chart dependency - local path in the git, but the error indicates the helm dependency update failed on another repository defined as an argo repository. this is the error from the log: log:time="2023-02-14T13:29:58Z" level=error msg="finished unary call with code Unknown" error="helm dependency buildfailed exit status 1: Error: error loading /helm-working-dir/repository/ops-helm-repo-index.yaml: empty index.yaml file" grpc.code=Unknown grpc.method=GenerateManifest grpc.service=repository.RepoServerService grpc.start_time="2023-02-14T13:29:55Z" grpc.time_ms=3445.988 span.kind=server system=grpc