groovy.lang.MissingPropertyException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • When I try to access the Global Properties environment variables (Manage Jenkins > Configure System > Global Properties) I either get null or an error (details below) To replicate issue: - Browse to Manage Jenkins > Configure System - under the "Global Properties" make sure "Environment variables" is checked - under the "Global Properties" > "Environment variables" add a new variable - name = TEST_VAR - value = some value - In left navigation add "New Item" - my job was named "workflow-test" - select "Workflow" job type - under the "Workflow" heading -- Definition: "Groovy CPS DSL" -- Script: {code:java} echo "JOB_NAME from env: ${env.JOB_NAME}" echo "global property from env: ${env.TEST_VAR}" echo "global property: ${TEST_VAR}" {code} Build workflow job and go to Console output from the output can see that the above script evaluates to: {code:java} echo "JOB_NAME from env: ${env.JOB_NAME}" -> "JOB_NAME from env: workflow-test" (worked) echo "global property from env: ${env.TEST_VAR}" -> "global property from env: null" (didn't work, but didn't error) echo "global property: ${TEST_VAR}" -> ERROR groovy.lang.MissingPropertyException: No such property: TEST_VAR for class: WorkflowScript at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:454) at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.getProperty(DefaultInvoker.java:25) at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:17) at WorkflowScript.run(WorkflowScript:25) {code}
    via by Sandra Greenhalgh,
  • When I try to access the Global Properties environment variables (Manage Jenkins > Configure System > Global Properties) I either get null or an error (details below) To replicate issue: - Browse to Manage Jenkins > Configure System - under the "Global Properties" make sure "Environment variables" is checked - under the "Global Properties" > "Environment variables" add a new variable - name = TEST_VAR - value = some value - In left navigation add "New Item" - my job was named "workflow-test" - select "Workflow" job type - under the "Workflow" heading -- Definition: "Groovy CPS DSL" -- Script: {code:java} echo "JOB_NAME from env: ${env.JOB_NAME}" echo "global property from env: ${env.TEST_VAR}" echo "global property: ${TEST_VAR}" {code} Build workflow job and go to Console output from the output can see that the above script evaluates to: {code:java} echo "JOB_NAME from env: ${env.JOB_NAME}" -> "JOB_NAME from env: workflow-test" (worked) echo "global property from env: ${env.TEST_VAR}" -> "global property from env: null" (didn't work, but didn't error) echo "global property: ${TEST_VAR}" -> ERROR groovy.lang.MissingPropertyException: No such property: TEST_VAR for class: WorkflowScript at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:454) at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.getProperty(DefaultInvoker.java:25) at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:17) at WorkflowScript.run(WorkflowScript:25) {code}
    via by Sandra Greenhalgh,
  • Jenkins pipeline shell step
    via Stack Overflow by fragpit
    ,
  • [workflow plugin] set build display name
    via by Christoph Vogtländer,
  • Jenkins 2.3 breaks env variables
    via GitHub by mikz
    ,
    • groovy.lang.MissingPropertyException: No such property: TEST_VAR for class: WorkflowScript at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:454) at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.getProperty(DefaultInvoker.java:25) at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:17) at WorkflowScript.run(WorkflowScript:25)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Luka
    1 times, last one,
    musketyr
    1 times, last one,
    45 more bugmates