Helm "template: parse error" in CI
Helm renders chart templates with Go templating. A malformed action - an unclosed {{ }}, a bad function call, or a missing end - is a parse error that stops rendering immediately.
What this error means
A helm template/upgrade step fails with "parse error" in a named template file and line, before any Kubernetes object is created.
Error: parse error at (api/templates/deployment.yaml:21): unexpected "}" in
operand
# or:
Error: template: api/templates/_helpers.tpl:8: unclosed actionCommon causes
Unbalanced or malformed actions
A missing end, an unclosed {{, or a stray }} breaks the template grammar.
Bad function or pipeline syntax
A misspelled function or an invalid pipeline expression fails to parse.
How to fix it
Render locally to find the exact spot
Use helm template (with lint) to surface the file and line.
helm lint ./chart
helm template api ./chart --debug 2>&1 | head -40Balance actions and fix syntax
- Match every
if/range/with/definewith anend. - Close every
{{with}}. - Correct function names and pipeline expressions.
How to prevent it
- Run
helm lintandhelm templatein CI before deploy. - Keep helper templates small and reviewed.
- Use an editor with Go-template/Helm awareness.