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.
helm
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.
Terminal
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.
Related guides
Helm "values don't meet the specifications of the schema" in CIFix Helm values schema validation failures in CI - supplied values violate the chart's values.schema.json, so…
kubectl "error parsing ... yaml" on apply in CIFix kubectl "error parsing ... yaml" in CI - a manifest is not valid YAML (bad indentation, tabs, or a templa…
Helm "failed to download chart" from a repository in CIFix Helm "failed to download" chart errors in CI - the repo was not added/updated, the version is missing, or…