A Helm template fails on a nested value whose parent does not exist
Your error
Error: template: mychart/templates/secret.yaml:7:28: executing "mychart/templates/secret.yaml" at <.Values.certificate.overwrite>: nil pointer evaluating interface {}.overwrite1 more line it can showFix it fast
Most common cause, 1 of 3The parent map is not in the values at all
Add the parent map to the values file you pass, at the level the template expects.
# my-values.yaml
certificate:
overwrite: falseShort answer
nil pointer evaluating interface {}.overwrite means a Helm template read a nested value such as .Values.certificate.overwrite while certificate itself was missing or null, so Go's template engine had nothing to look inside. Add the parent map to your values, stop overriding it with null, or guard the template with a with block. Helm 4.3 and 3.22.
Which cause do you have?
The part inside <...> is the full path the template tried to read, and the word after interface {}. is the key that failed. Render the chart with the same values and print what Helm actually computed for the parent key.
helm template test ./mychart -f my-values.yaml --debug > /dev/null
helm show values ./mychart | grep -n -A3 "^certificate:"Then find the line you see in this list and open its fix:
- 1The parent map is not in the values at all
helm show values has no certificate: block, and your own file has none either, or it sits under another key because of indentation - 2An override set the parent to null
Your file has certificate: with nothing under it (or only comments), or a --set certificate=null flag - 3Argo CD never passed your values file
helm template works on your machine with -f, but the Argo CD application fails, and its spec sets ignoreMissingValueFiles: true
What does the error look like?
Error: template: mychart/templates/secret.yaml:7:28: executing "mychart/templates/secret.yaml" at <.Values.certificate.overwrite>: nil pointer evaluating interface {}.overwritenil pointer evaluating interface {}.overwrite
Cause 1 of 3
The parent map is not in the values at all
You seehelm show values has no certificate: block, and your own file has none either, or it sits under another key because of indentation
Check
Go's text/template raises nil pointer evaluating interface {}.overwrite when it has to read a field from a nil interface value. When .Values.certificate is absent, there is no map to read overwrite from, and rendering stops with this message.
helm show values ./mychart | grep -n "certificate"Fix
Add the parent map to the values file you pass, at the level the template expects. If you maintain the chart, also give it a default in the chart's own values.yaml.
# my-values.yaml
certificate:
overwrite: falseVerify
The chart renders and the manifest shows the value.
helm template test ./mychart -f my-values.yaml | grep -n overwriteConfirmed by raw.githubusercontent.com
Cause 2 of 3
An override set the parent to null
You seeYour file has certificate: with nothing under it (or only comments), or a --set certificate=null flag
Check
Helm documents that overriding a key with null removes it from the merged values. YAML resolves a key with empty content to null, so certificate: with nothing under it wipes the chart's default map and the nested read fails.
grep -n -A2 "^certificate:" my-values.yamlFix
Delete the empty key so the chart default survives, or fill it with the fields you want. Use null only for keys you really mean to remove.
# before: wipes the chart's default map
certificate:
# after: keep it and change one field
certificate:
overwrite: trueVerify
Rendering with the corrected file succeeds.
helm template test ./mychart -f my-values.yaml > /dev/null && echo renderedConfirmed by helm.sh
Cause 3 of 3
Argo CD never passed your values file
You seehelm template works on your machine with -f, but the Argo CD application fails, and its spec sets ignoreMissingValueFiles: true
Check
Argo CD resolves valueFiles relative to the chart's root directory. With ignoreMissingValueFiles turned on, a file at the wrong path is skipped without an error, so the chart renders with defaults only and the nested key is missing again.
kubectl -n argocd get application my-app -o jsonpath='{.spec.source.path}{"\n"}{.spec.source.helm.valueFiles}{"\n"}'Fix
Correct the path so it is relative to the chart folder (or use a multi-source Application for files in another repository), and leave ignoreMissingValueFiles off until the path is proven.
source:
path: charts/mychart
helm:
valueFiles:
- values-production.yamlVerify
After a refresh the application shows no ComparisonError and its manifests carry your values.
argocd app get my-app --refreshConfirmed by argo-cd.readthedocs.io
How do I stop it coming back?
- In charts you own, wrap optional nested blocks in with, which runs only when the parent value is not empty.
- Ship a default for every map a template reads, even if it is an empty map, in the chart's values.yaml.
- Run helm template with the production values file in CI before Argo CD ever syncs it.
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.