Skip to content
Latchkey

Jenkins "MissingPropertyException: No such property" Error

Groovy tried to read a property or variable that was never defined in the current scope, so the pipeline threw MissingPropertyException.

What this error means

A stage fails with "groovy.lang.MissingPropertyException: No such property: NAME for class: ...". The build runs up to the line that references the undefined name.

jenkins
groovy.lang.MissingPropertyException: No such property: IMAGE_TAG for class: WorkflowScript

Common causes

Variable referenced before assignment or out of scope

A def declared inside one block is not visible in another, and bare names resolve as properties.

Typo in a variable or env name

Referencing env.IMAGE_TAG when the value was never set returns no such property.

Reading a param that does not exist

params.FOO fails if no FOO parameter is declared.

How to fix it

Define the variable in the right scope

  1. Declare the value where it is used, or set it via the environment block so it is available pipeline-wide.
  2. Use env.NAME for environment values and params.NAME for parameters.
Jenkinsfile
environment { IMAGE_TAG = "build-${BUILD_NUMBER}" }

Guard optional values

  1. Provide a default when a value may be unset.
  2. Confirm parameter and credential names match exactly, including case.

How to prevent it

  • Declare shared values in the environment block and reference them through env, keeping variable names consistent across stages.

Frequently asked questions

What causes ""No such property""?
A def declared inside one block is not visible in another, and bare names resolve as properties.
How do I fix "No such property"?
Define the variable in the right scope

Related guides

References

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