jsonnet "RUNTIME ERROR: Field does not exist" in CI
jsonnet evaluated an expression that read a field the object does not define, so it aborts with "RUNTIME ERROR: Field does not exist: X" and a stack trace of file:line locations.
What this error means
jsonnet (or jsonnet-bundler tooling) exits non-zero with "RUNTIME ERROR: Field does not exist: replicas" and a trace ending in a .jsonnet or .libsonnet line.
RUNTIME ERROR: Field does not exist: replicas
config.jsonnet:8:14-30 object <anonymous>
During manifestationCommon causes
A misspelled or renamed field
The code reads obj.replicas but the object defines replica (or the field was renamed upstream), so the lookup fails.
A field expected from a merge that did not happen
A + merge or import that was supposed to supply the field is missing or ordered wrong, so the field is absent at read time.
How to fix it
Reference the correct field or provide it
- Follow the stack trace to the
file:linethat reads the field. - Fix the field name, or ensure the object that defines it is merged in.
- Re-run
jsonnetto confirm evaluation completes.
jsonnet config.jsonnetUse a safe default when the field is optional
Use std.get (or a if "x" in obj) to supply a default rather than failing when the field may be absent.
replicas: std.get(params, "replicas", 3)How to prevent it
- Evaluate jsonnet in CI so field errors surface before deploy.
- Use
std.getwith defaults for optional fields. - Keep field names in one shared libsonnet to avoid drift.