argo-cd: You may need to run `helm dependency build` to fetch missing dependencies:

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

Helm chart via kustomize failing to deploy with you may need to run helm dependency build error. kustomize build locally was giving the same error until I run helm dep build when chart.lock and .tgz files were added the kustomize build no longer resulted in an error locally. I’ve tried to add Chart.lock to the repo, but that did not change the outcome. Adding .tgz file to the repo did solve the issue, however I wonder if that is actually the intended behavior? Is it mandatory commit dependency .tgz files for it to work?

To Reproduce base/kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ./namespace.yaml

helmGlobals:
  chartHome: charts
helmCharts:
- name: external-secrets
  releaseName: external-secrets
  namespace: external-secrets
  valuesFile: charts/external-secrets/values.yaml

base/namespace.yaml

apiVersion: v1
kind: Namespace
metadata:
  name: external-secrets

overlays/dev/kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base

base/charts/external-secrets/Chart.yaml

apiVersion: v2
name: external-secrets
version: 0.6.1
dependencies:
- name: external-secrets
  version: 0.6.1
  repository: https://charts.external-secrets.io

base/charts/external-secrets/values.yaml

external-secrets:
  serviceMonitor:
    enabled: true

Added kustomize.buildOptions: --enable-helm to argocd-cm configmap Added external-secrets repo config to argocd helm values.yaml

configs:
  repositories:
    external-secrets:
      url: https://charts.external-secrets.io
      name: external-secrets
      type: helm

Expected behavior external-secrets getting deployed to k8s

Screenshots image

Version

argocd: v2.5.3+0c7de21
  BuildDate: 2022-11-28T17:11:59Z
  GitCommit: 0c7de210ae66bf631cc4f27ee1b5cdc0d04c1c96
  GitTreeState: clean
  GoVersion: go1.18.8
  Compiler: gc
  Platform: linux/amd64
argocd-server: v2.5.3+0c7de21
  BuildDate: 2022-11-28T16:51:33Z
  GitCommit: 0c7de210ae66bf631cc4f27ee1b5cdc0d04c1c96
  GitTreeState: clean
  GoVersion: go1.18.8
  Compiler: gc
  Platform: linux/amd64
  Kustomize Version: v4.5.7 2022-08-02T16:35:54Z
  Helm Version: v3.10.1+g9f88ccb
  Kubectl Version: v0.24.2
  Jsonnet Version: v0.18.0

Logs

ComparisonError: rpc error: code = Unknown desc = `kustomize build .overlays/dev --enable-helm` failed exit status 1: Error: accumulating resources: accumulation err='accumulating resources from '../../base': '.base' must resolve to a file': recursed accumulation of path '.base': Error: An error occurred while checking for chart dependencies. You may need to run `helm dependency build` to fetch missing dependencies: found in Chart.yaml, but missing in charts/ directory: external-secrets : unable to run: 'helm template external-secrets --namespace external-secrets .base/charts/external-secrets --values /tmp/kustomize-helm-2338096147/external-secrets-kustomize-values.yaml' with env=[HELM_CONFIG_HOME=/tmp/kustomize-helm-2338096147/helm HELM_CACHE_HOME=/tmp/kustomize-helm-2338096147/helm/.cache HELM_DATA_HOME=/tmp/kustomize-helm-2338096147/helm/.data] (is 'helm' installed?)

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 27
  • Comments: 18 (3 by maintainers)

Most upvoted comments

I’m facing the same issue, even if purely Helm applications

@AurimasNav Yes, I think ArgoCD simply executes kustomize build --enable-helm internally. Does the following manifest not enough for your use case? Or I’m afraid we should use ConfigMapPlugin as @audleman suggested.

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ./namespace.yaml

helmCharts:
- name: external-secrets
  repo: https://charts.external-secrets.io
  releaseName: external-secrets
  namespace: external-secrets
  valuesFile: external-secrets-values.yaml

It seems like that kustomize build --enable-helm runs helm pull --repo ${helmCharts.repo} internally, and pulls helm charts locally, then templates it. If we have a local chart directory, kustomize skips helm pull. So you got the error you mentioned.

please be aware of https://github.com/argoproj/argo-cd/issues/18122#issuecomment-2200231002 as the log message doesn’t necessarily mean a real error, as right now it seems to be “by design” reported once when you do a hard refresh. That doesn’t mean that there might be another bug but in case you actually have your applications in-sync and just see the error message in the logs, then this is probably just “bad noise”.

same here when I tried to run gitlab helm chart on v2.11.3+3f344d5