Helm "nil pointer evaluating interface {}" template error in CI
A template accessed a sub-field of a value that is nil. Helm's Go template engine cannot dereference a missing map or key, so it fails with "nil pointer evaluating interface {}.<field>" and the template path.
What this error means
helm template/install fails with "Error: template: my-app/templates/deployment.yaml:NN:MM: executing ... at <.Values.image.tag>: nil pointer evaluating interface {}.tag".
Error: template: my-app/templates/deployment.yaml:21:18: executing "my-app/templates/
deployment.yaml" at <.Values.image.tag>: nil pointer evaluating interface {}.tagCommon causes
A values key is missing
The template reads .Values.image.tag but image (or image.tag) is not set in values.yaml or the supplied overrides, so the lookup hits nil.
A parent object is nil for some inputs
An optional block is omitted in one environment's values, so its children are nil when the template assumes they exist.
How to fix it
Provide a default in the template
Guard against missing values with default or dig so a missing key yields a fallback instead of nil.
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"Set the missing value
- Read the template path in the error to see which key is nil.
- Add the key to values.yaml or pass it with
--set. - Re-render with
helm templateto confirm it resolves.
helm template my-app ./chart --set image.tag=1.4.2How to prevent it
- Define every key the templates read in values.yaml with sensible defaults.
- Use
default/dig/requiredto make missing values explicit. - Run
helm templateper environment in CI to catch nil paths early.