Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Servers, nginx and Docker

Helm stops because a declared subchart is not in charts/

Your error

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: redis2 more lines it can show

Fix it fast

Most common cause, 1 of 3

The subcharts were never downloaded into charts/

Add each https repository named in Chart.yaml with helm repo add, as the chart docs require (oci:// entries are pulled from the registry; run helm registry login first if it is private), then rebuild charts/ from Chart.lock.

Fix
helm repo add example https://charts.example.com/
helm dependency build ./mychart
# only when Chart.lock is out of sync with Chart.yaml:
helm dependency update ./mychart
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

found in Chart.yaml, but missing in charts/ directory means a dependency listed in Chart.yaml has no matching chart in the charts/ folder, so helm install, upgrade or template refuses to render. Run helm dependency list to see which one, add its repository, then run helm dependency build. Under Argo CD, register that repository too. Helm 4.3 and 3.22.

  • Applies to Helm 4.3.2, Helm 3.22.1, Argo CD 3.6 repo-server
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

List the dependencies and their state. The STATUS column says missing when nothing was downloaded and misnamed when an archive holds a chart with another name; a WARNING line flags files in charts/ that Chart.yaml does not list.

Run this first
helm dependency list ./mychart

Then find the line you see in this list and open its fix:

  1. 1The subcharts were never downloaded into charts/helm dependency list shows STATUS missing, and ls mychart/charts/ is empty or absent
  2. 2The chart in charts/ carries a different nameSTATUS misnamed, or WARNING: "mychart/charts/..." is not in Chart.yaml
  3. 3Argo CD cannot fetch the dependency's repositoryThe chart renders on your laptop, but the Argo CD app shows not permitted in project, could not download or a repository definition error

What does the error look like?

  • 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: redis
  • Error: no repository definition for https://charts.example.com/. Please add them via 'helm repo add'
  • helm repos https://charts.example.com/ are not permitted in project 'default'

Cause 1 of 3

The subcharts were never downloaded into charts/

You seehelm dependency list shows STATUS missing, and ls mychart/charts/ is empty or absent

Check

Helm reports found in Chart.yaml, but missing in charts/ directory when it renders a chart whose charts/ folder lacks a declared dependency. It happens on a fresh checkout when the archives in charts/ were never committed, or in a CI job that has no download step.

Check
ls -la ./mychart/charts/ && cat ./mychart/Chart.lock

Fix

Add each https repository named in Chart.yaml with helm repo add, as the chart docs require (oci:// entries are pulled from the registry; run helm registry login first if it is private), then rebuild charts/ from Chart.lock. If build answers that Chart.lock is out of sync with Chart.yaml, run helm dependency update instead to resolve versions again and rewrite the lock.

Fix
helm repo add example https://charts.example.com/
helm dependency build ./mychart
# only when Chart.lock is out of sync with Chart.yaml:
helm dependency update ./mychart

Verify

Every row in helm dependency list shows ok, and a dry render works.

Verify
helm dependency list ./mychart && helm template test ./mychart > /dev/null

Confirmed by helm.sh

Did this fix it?

Cause 2 of 3

The chart in charts/ carries a different name

You seeSTATUS misnamed, or WARNING: "mychart/charts/..." is not in Chart.yaml

Check

Helm matches each dependency by the name inside the subchart's own Chart.yaml, not by the file or folder name. A chart copied in by hand, or a dependency renamed in Chart.yaml while an old archive stays behind, leaves the declared name with no match.

Check
for f in ./mychart/charts/*.tgz; do helm show chart "$f" | grep '^name:'; done

Fix

Set the dependency name in Chart.yaml to the subchart's real name; add alias when you want the dependency under another name, for example to include the same chart twice. Then delete the stray archives and build again.

Fix
# Chart.yaml
dependencies:
  - name: redis          # must equal name: in the subchart's Chart.yaml
    alias: cache         # optional second name for this dependency
    version: "x.y.z"
    repository: "https://charts.example.com/"
# then
rm ./mychart/charts/*.tgz
helm dependency build ./mychart

Verify

helm dependency list prints ok for the row and no WARNING lines remain.

Verify
helm dependency list ./mychart

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 3 of 3

Argo CD cannot fetch the dependency's repository

You seeThe chart renders on your laptop, but the Argo CD app shows not permitted in project, could not download or a repository definition error

Check

Argo CD's repo-server catches the missing-dependency message and runs helm dependency build itself, adding only the Helm repositories registered in Argo CD. A private repository with no credentials, or one left out of the AppProject's sourceRepos, makes that build fail.

Check
argocd repo list

Fix

Register the dependency's repository with a repository Secret (set enableOCI for an OCI registry) and allow its URL in the project's sourceRepos. Then refresh the application.

Fix
apiVersion: v1
kind: Secret
metadata:
  name: example-charts
  namespace: argocd
  labels:
    argocd.argoproj.io/secret-type: repository
stringData:
  name: example
  url: https://charts.example.com/
  type: helm
  username: my-username
  password: my-password

Verify

The application's manifests render and it reaches Synced after a refresh.

Verify
argocd app get my-app --refresh

Confirmed by raw.githubusercontent.com

Did this fix it?

How do I stop it coming back?

  • Commit Chart.lock and run helm dependency build in every CI job before lint, template or install.
  • Keep dependency names equal to the subcharts' own names, and reach for alias only when one chart must appear under a second name.
  • Add each private chart repository to Argo CD and to the AppProject's sourceRepos in the same change that adds the dependency.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine on the same stack: TaxiDex.

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.