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.
groovy.lang.MissingPropertyException: No such property: IMAGE_TAG for class: WorkflowScriptCommon 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
- Declare the value where it is used, or set it via the environment block so it is available pipeline-wide.
- Use env.NAME for environment values and params.NAME for parameters.
environment { IMAGE_TAG = "build-${BUILD_NUMBER}" }Guard optional values
- Provide a default when a value may be unset.
- 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.