argo-cd: helm dependency build failed

Describe the bug

ArgoCD is not building for helm 3 charts.

To Reproduce

rpc error: code = Unknown desc = `helm dependency build` failed exit status 1: Error: no repository definition for https://eventstore.github.io/EventStore.Charts. Please add the missing repos via 'helm repo add'
apiVersion: v2
name: foobar
description: A Helm chart for Kubernetes
home: https://localhost
dependencies:
  - name: mongodb
    version: 7.8.10
    repository: https://charts.bitnami.com/bitnami
    condition: mongodb.enabled
  - name: eventstore
    version: 0.2.5
    repository: https://eventstore.github.io/EventStore.Charts
    condition: eventstore.enabled
maintainers:
  - name: estahn
type: application
version: 0.1.0
appVersion: 1.16.0

Expected behavior

ArgoCD should return manifests successfully.

Screenshots

image

Version

argocd-server: v1.5.0-rc1+3684a10
  BuildDate: 2020-03-20T21:24:20Z
  GitCommit: 3684a103327c67d84d0c68fce86d31091331b727
  GitTreeState: clean
  GoVersion: go1.14
  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: version.BuildInfo{Version:"v3.1.1", GitCommit:"afe70585407b420d0097d07b21c47dc511525ac8", GitTreeState:"clean", GoVersion:"go1.13.8"}
  Kubectl Version: v1.14.0

Logs

argocd-repo-server-66946656b5-cqths argocd-repo-server time="2020-03-25T04:55:06Z" level=error msg="`helm template . --name-template foobar-qa --namespace foobar-qa --values /tmp/values-192722455.yaml --api-versions v1 --api-versions apiregistration.k8s.io/v1 --api-versions apiregistration.k8s.io/v1beta1 --api-versions extensions/v1beta1 --api-versions apps/v1 --api-versions apps/v1beta2 --api-versions apps/v1beta1 --api-versions events.k8s.io/v1beta1 --api-versions authentication.k8s.io/v1 --api-versions authentication.k8s.io/v1beta1 --api-versions authorization.k8s.io/v1 --api-versions authorization.k8s.io/v1beta1 --api-versions autoscaling/v1 --api-versions autoscaling/v2beta1 --api-versions autoscaling/v2beta2 --api-versions batch/v1 --api-versions batch/v1beta1 --api-versions batch/v2alpha1 --api-versions certificates.k8s.io/v1beta1 --api-versions networking.k8s.io/v1 --api-versions policy/v1beta1 --api-versions rbac.authorization.k8s.io/v1 --api-versions rbac.authorization.k8s.io/v1beta1 --api-versions storage.k8s.io/v1 --api-versions storage.k8s.io/v1beta1 --api-versions admissionregistration.k8s.io/v1beta1 --api-versions apiextensions.k8s.io/v1beta1 --api-versions scheduling.k8s.io/v1beta1 --api-versions coordination.k8s.io/v1beta1 --api-versions crd.projectcalico.org/v1 --api-versions dex.coreos.com/v1 --api-versions monitoring.coreos.com/v1 --api-versions argoproj.io/v1alpha1 --api-versions certmanager.k8s.io/v1alpha1 --api-versions dynatrace.com/v1alpha1 --api-versions logging.banzaicloud.com/v1alpha1 --api-versions vault.banzaicloud.com/v1alpha1 --api-versions admission.certmanager.k8s.io/v1beta1 --api-versions autoscaling.k8s.io/v1beta2 --api-versions autoscaling.k8s.io/v1beta1 --api-versions logging.banzaicloud.io/v1beta1 --api-versions etcd.database.coreos.com/v1beta2 --api-versions custom.metrics.k8s.io/v1beta1 --api-versions metrics.k8s.io/v1beta1` failed exit status 1: Error: found in Chart.yaml, but missing in charts/ directory: mongodb, eventstore" execID=pwTd3
argocd-repo-server-66946656b5-cqths argocd-repo-server time="2020-03-25T04:55:16Z" level=error msg="`helm dependency build` failed exit status 1: Error: no repository definition for https://eventstore.github.io/EventStore.Charts. Please add the missing repos via 'helm repo add'" execID=aRB2D
argocd-repo-server-66946656b5-cqths argocd-repo-server time="2020-03-25T04:55:16Z" level=error msg="finished unary call with code Unknown" error="`helm dependency build` failed exit status 1: Error: no repository definition for https://eventstore.github.io/EventStore.Charts. Please add the missing repos via 'helm repo add'" grpc.code=Unknown grpc.method=GenerateManifest grpc.request.deadline="2020-03-25T04:56:04Z" grpc.service=repository.RepoServerService grpc.start_time="2020-03-25T04:55:04Z" grpc.time_ms=11940.579 span.kind=server system=grpc

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (2 by maintainers)

Commits related to this issue

Most upvoted comments

I see the same error even in argocd 2.1.6

solution

make sure that the helm repo is listed in the admin page.

.i.e. image

So every OTS helm chart repo has to be listed in the Settings > Repository? I’d rather not have to worry about managing let alone automating that. We are already using umbrella/proxy charts and the repo is specified in the Chart.yaml. To also specify and manage that in the Settings > Repository feels redundant and clunky.

solution

make sure that the helm repo is listed in the admin page.

.i.e. image

This is still an issue - the upstream issue (https://github.com/helm/helm/issues/8036) is still open.

We found out that this issue can be mitigated in two different ways:

  • not adding the Charts.lock file. If it is added, ArgoCD will not try to delete it and it will fail with the error message as described in the original message. However, that defeats the purpose of a lock file, I’d say.
  • vendoring the charts. When running helm dependency update, Helm will add any subcharts to /charts. These can be added to the git repository, and Argo does not seem to attempt to download the charts in this case. Only downside is that you’re having .tar.gz files in your git repo.

I’m pretty sure this is Helm3 bug: https://github.com/helm/helm/issues/6870 . After running helm template first-time helm creates Chart.lock file. As soon as Chart.lock is created helm dependency build does not work anymore. Trying to find workaround.

Seeing this in argocd 2.2.5 as well.

ComparisonError
rpc error: code = Unknown desc = helm dependency build failed exit status 1: Error: error loading /helm-working-dir/repository/https:/sumologic.github.io/sumologic-kubernetes-collection-index.yaml: empty index.yaml file

I’m having the same problem, using ArgoCD version v1.8.1, which uses Helm v3 version v3.4.1 and helm v2 version v2.17.0. When I rollback to argocd v1.7.6, the problem stops, which uses Helm v3 version v3.2.0 and helm v2 version v2.15.2