/errors/helm/nil-pointer-evaluating-interface
Helm: nil pointer evaluating interface {}.value
verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash) · v4.3.1+gc0d08d0updated 2026-10-20
- tool
- Helm
- exit code
- 1
- versions
- Helm 3, Helm 4
- os
- any
Helm renders templates with Go's text/template. When a template reads .Values.missing.value and missing does not exist, Go evaluates .value on a nil value and Helm stops with nil pointer evaluating interface {}.value. The message shows the file, line and column of the failing expression.
Reproduce it
helm create mychart >/dev/null
cat > mychart/templates/cm.yaml <<'EOF'
apiVersion: v1
kind: ConfigMap
metadata:
name: app-config
data:
key: {{ .Values.missing.value }}
EOF
helm template demo ./mychartOutput · exit 1
Error: mychart/templates/cm.yaml:6:17
executing "mychart/templates/cm.yaml" at <.Values.missing.value>:
nil pointer evaluating interface {}.value
Use --debug flag to render out invalid YAMLFix: define the parent in values.yaml
missing:
value: "default"Fix: guard optional values
data:
{{- with .Values.missing }}
key: {{ .value | quote }}
{{- end }}Or, for a deep optional key with a fallback, dig walks the path and never fails on a missing map:
key: {{ dig "missing" "value" "default" .Values.AsMap | quote }}Sources
Related pages
flags · helmhelm --set, --set-string and -f: override chart valueshelm --set key=value overrides values.yaml from the command line; nested keys use dots, lists use {a,b}. --set-string forces strings, -f loads a file.errors · kuberneteskubectl: error converting YAML to JSON: mapping values are not allowed in this contextkubectl apply fails with error converting YAML to JSON: mapping values are not allowed in this context when indentation is wrong or a colon is unquoted.commands · kubernetesGenerate Kubernetes YAML with kubectl create --dry-run=client -o yamlkubectl create deployment, service, configmap or secret with --dry-run=client -o yaml prints a ready manifest without a cluster. Save it with > file.yaml.