argoproj / argo-cd

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

helm dependency build failed #3280

Closed estahn closed 4 years ago

estahn commented 4 years ago

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
alexmt commented 4 years ago

thank you! working on it

alexmt commented 4 years ago

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.

cretz commented 4 years ago

When using --local which uses helm2 binary on my PATH, I still get this error on 1.5.0-rc2:

ComparisonError: rpc error: code = Unknown desc = helm2 dependency build failed exit status 1: Error: no repository definition for https://kubernetes-charts-incubator.storage.googleapis.com. Please add the missing repos via 'helm repo add'

Is this a different, unrelated issue in helm? I see they said it was fixed with https://github.com/helm/helm/issues/6005 but I have a later version of helm and still experience this.

alexmt commented 4 years ago

hello @cretz , can share Charts.yaml file so I can try to reproduce it?

cretz commented 4 years ago

I'm afraid it's internal. It's via declarative app of apps model which point to our older internal Chart repo (that I don't want to update at this time) that has a requirements.yml with:

dependencies:
  - name: common
    version: 0.0.2
    repository: https://kubernetes-charts-incubator.storage.googleapis.com

And doesn't appear --local related, so I guess it's helm2 inside the argo server itself?

zeph commented 4 years ago

$ argocd app create -f argocd-dst.yaml

FATA[0007] rpc error: code = InvalidArgument desc = application spec is invalid: InvalidSpecError: Unable to generate manifests in hvault: rpc error: code = Unknown desc = helm2 dependency build failed exit status 1: Error: requirements.lock is out of sync with requirements.yaml

p.s. I just upgraded to 1.6.1

@alexmt here u go...

hvault/
├── argocd-dst.yaml
├── Chart.yaml
├── README.md
├── requirements.lock
├── requirements.yaml
└── values-dst.yaml

$ cat hvault/requirements.yaml

dependencies:
  - name: vault
    repository: https://helm.releases.hashicorp.com
    version: 0.6.0

$ cat hvault/requirements.lock

dependencies:
- name: vault
  repository: https://helm.releases.hashicorp.com
  version: 0.6.0
digest: sha256:75412623551cb3e9a47f130989668406cd17f6f0fd0a97b3394163d006469500
generated: "2020-07-02T13:46:14.377402231+02:00"

$ cat hvault/values-dst.yaml

vault:
  server:
    ingress:
      enabled: true
      hosts:
        - host: vault.dst.kube

$ cat hvault/argocd-dst.yaml

metadata:
  name: hvault
spec:
  destination:
    namespace: infrastructure
    server: https://kubernetes.default.svc
  project: site-reliability
  source:
    helm:
      valueFiles:
      - values-dst.yaml
    path: hvault
    repoURL: https://developer.xyz.zz/bitbucket/scm/devops/helm-charts.git
    targetRevision: HEAD

$ cat hvault/Chart.yaml

apiVersion: v1
appVersion: "1.0"
description: A super-Chart for Hashicorp Vault 
name: hvault
version: 0.1.0

$ cat hvault/README.md

# hvault (hashicorp)
it's my way of extending an existing stable helm chart with just what I need
it leverages the requirements.yaml file
$ argocd app create -f argocd.yaml
tommyknows commented 3 years ago

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:

AmitBenAmi commented 3 years ago

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

purnima995 commented 3 years ago

Hi team, I am also facing this same issue with ArgoCD version v1.8.1. Any ETA of the fix or any workarounds?

tuananh commented 3 years ago

hi, did anyone manage to fix this?

Shahard2 commented 2 years ago

Hello, any solution ??

ckazimie commented 2 years ago

I see the same error even in argocd 2.1.6

Colbize commented 2 years ago

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
lukpep commented 2 years ago

yep - same for 2.2.8 Any ideas?

Edit: still present in 2.3.4

survivant commented 2 years ago

I have the same error with Argo CD v2.3.4+ac8b7df

I have a chart like this :

apiVersion: v2
name: codec
description: Chart for CICD
type: application
version: 0.1.25-dev
appVersion: 1.0.0
dependencies:
  - name: codec
    version: 0.0.26
    repository: "@nexus.example.com"
    condition: codec.enabled

On my master node

root@lnx-kub04:~# helm repo list
NAME                    URL
chartmuseum.example.com  http://docker.example.com:8080
nexus.example.com        https://nexus.example.com/repository/helm-hosted/
root@lnx-kub04:~#

I FOUND MY ISSUE

I forgot to push the .tgz into git when I updated the dependencies. Works fine now.

abdennour commented 2 years ago

@survivant but no nee to push .tgz files. Instead, they must be in gitignore. You may need to push Chart.lock.yaml instead

abdennour commented 2 years ago

solution

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

.i.e.

image
Colbize commented 2 years ago

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.

z0mt3c commented 7 months ago

any updates?

ALBayrouni commented 7 months ago

solution

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

.i.e. image

Salem khuya Abdenour, i have already checked that it is added there, but the problem is still occurring

ALBayrouni commented 7 months ago

i am still seeig this argo v2.9

white-hat commented 3 months ago

This issue is still reproducible in v2.10.1, could you please reopen it? Adding EVERY single repo to admin repo page is not a solution, it's impossible to keep track of all the repos every user may pull

abnerrizzi commented 2 months ago

I just tried to add gitlab helm chart and the same occurred with me: Unable to create application: application spec for dev-gitlab is invalid: InvalidSpecError: Unable to generate manifests in .: rpc error: code = Unknown desc = `helm dependency build` failed timeout after 1m30s