Skip to content
Latchkey

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.

jsonnet
RUNTIME ERROR: Field does not exist: replicas
	config.jsonnet:8:14-30	object <anonymous>
	During manifestation

Common 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

  1. Follow the stack trace to the file:line that reads the field.
  2. Fix the field name, or ensure the object that defines it is merged in.
  3. Re-run jsonnet to confirm evaluation completes.
Terminal
jsonnet config.jsonnet

Use 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.

config.jsonnet
replicas: std.get(params, "replicas", 3)

How to prevent it

  • Evaluate jsonnet in CI so field errors surface before deploy.
  • Use std.get with defaults for optional fields.
  • Keep field names in one shared libsonnet to avoid drift.

Frequently asked questions

What causes ""RUNTIME ERROR: Field does not exist""?
The code reads obj.replicas but the object defines replica (or the field was renamed upstream), so the lookup fails.
How do I fix "RUNTIME ERROR: Field does not exist"?
Reference the correct field or provide it

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card