Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63708

Pipeline: Matrix and Lockable don't play well together

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I have a declarative-pipeline and am using a matrix to perform system tests.  One of the axis of the matrix is name=PLATFORM (values=Windows, Linux).   I'd like to create a step with a lock on it based on the value of platform, hence, something like this:

      matrix {
          axes { 
              axis { 
                  name = 'PLATFORM'
                  values = Windows', 'Linux'
              }
          }
          options {
              lock( label: "LOCK_${PLATFORM}", quantity: 1 )
          }
          stages {
             ...
             // the above lock could also be applied to a stage within this stages block
          }
      }
      
      

      If I read the documentation, I think this is supposed to work as the axis values are supposed to be able to be referenced from 'options' setup.  However, when I run this, I get one of two errors:

      • Referenced as "LOCK_${env.PLATFORM}" yields lock does not exist "LOCK_null"
      • Referenced as "LOCK_${PLATFORM}" yields no such property "PLATFORM"

      I have tried it at various levels - 1) as above, on the stages block, and 2) on a stage within the stages.  They both fail in similar ways.

      The intent here is that we would grab (or wait for) the LOCK_Windows or the LOCK_Linux as appropriate.

      It seems like the axis value is not passed through to the options-block, or to the lock-command within the option.  

        Attachments

          Activity

          jbennett20912 Jeffrey Bennett created issue -
          Hide
          jbennett20912 Jeffrey Bennett added a comment -

          Stack Trace when using "LOCK_${PLATFORM}"

           
          groovy.lang.MissingPropertyException: No such property: PLATFORM for class: groovy.lang.Binding
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-45 at groovy.lang.Binding.getVariable(Binding.java:63)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-46 at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:270)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-47 at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:353)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-48 at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:357)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-49 at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:333)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-50 at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:29)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-51 at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-52 at WorkflowScript._modelDeclaration_83_995386287_(WorkflowScript:415)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-53 at generated._modelStage_3_1746597669_.getStage_25(WorkflowScript)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-54 at generated._modellistExpression_9_1387378903_.getlistExpression_14(WorkflowScript)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-55 at generated._modellistExpression_9_1387378903_.getlistExpression_15(WorkflowScript)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-56 at generated._modelMatrix_36_1940031641_.getMatrix_1(WorkflowScript)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-57 at generated._modelStage_3_1746597669_.getStage_31(WorkflowScript)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-58 at generated._modellistExpression_9_1387378903_.getlistExpression_16(WorkflowScript)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-59 at generated._modellistExpression_9_1387378903_.getlistExpression_17(WorkflowScript)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-60 at generated._modelStages_19_944640564_.getStages_3(WorkflowScript)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-61 at generated._modelRoot_82_138029530_.getRoot_0(WorkflowScript)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-62 at WorkflowScript.run(WorkflowScript)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-63 at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.call(ModelInterpreter.groovy:60)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-64 at WorkflowScript.run(WorkflowScript:2)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-65 at __cps.transform__(Native Method)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-66 at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:74)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-67 at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-68 at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:66)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-69 at jdk.internal.reflect.GeneratedMethodAccessor279.invoke(Unknown Source)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-70 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-71 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-72 at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-73 at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-74 at com.cloudbees.groovy.cps.Next.step(Next.java:83)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-75 at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-76 at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-77 at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-78 at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-79 at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-80 at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-81 at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-82 at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-83 at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-84 at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-85 at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-86 at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-87 at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-88 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-89 at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:136)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-90 at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-91 at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-92 at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-93 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-94 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-95 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-96 at java.base/java.lang.Thread.run(Thread.java:834)
          http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-97

          Show
          jbennett20912 Jeffrey Bennett added a comment - Stack Trace when using "LOCK_${PLATFORM}"   groovy.lang.MissingPropertyException: No such property: PLATFORM for class: groovy.lang.Binding http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-45 at groovy.lang.Binding.getVariable(Binding.java:63) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-46 at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:270) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-47 at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:353) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-48 at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:357) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-49 at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:333) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-50 at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:29) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-51 at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-52 at WorkflowScript._ model Declaration_83_995386287 _(WorkflowScript:415) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-53 at generated._ model Stage_3_1746597669 _.getStage_25(WorkflowScript) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-54 at generated._ model listExpression_9_1387378903 _.getlistExpression_14(WorkflowScript) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-55 at generated._ model listExpression_9_1387378903 _.getlistExpression_15(WorkflowScript) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-56 at generated._ model Matrix_36_1940031641 _.getMatrix_1(WorkflowScript) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-57 at generated._ model Stage_3_1746597669 _.getStage_31(WorkflowScript) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-58 at generated._ model listExpression_9_1387378903 _.getlistExpression_16(WorkflowScript) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-59 at generated._ model listExpression_9_1387378903 _.getlistExpression_17(WorkflowScript) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-60 at generated._ model Stages_19_944640564 _.getStages_3(WorkflowScript) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-61 at generated._ model Root_82_138029530 _.getRoot_0(WorkflowScript) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-62 at WorkflowScript.run(WorkflowScript) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-63 at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.call(ModelInterpreter.groovy:60) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-64 at WorkflowScript.run(WorkflowScript:2) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-65 at __ cps.transform __(Native Method) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-66 at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:74) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-67 at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-68 at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:66) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-69 at jdk.internal.reflect.GeneratedMethodAccessor279.invoke(Unknown Source) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-70 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-71 at java.base/java.lang.reflect.Method.invoke(Method.java:566) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-72 at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-73 at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-74 at com.cloudbees.groovy.cps.Next.step(Next.java:83) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-75 at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-76 at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-77 at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-78 at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-79 at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-80 at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-81 at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-82 at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-83 at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-84 at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-85 at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-86 at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-87 at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-88 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-89 at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:136) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-90 at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-91 at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-92 at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-93 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-94 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-95 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-96 at java.base/java.lang.Thread.run(Thread.java:834) http://omnibld0.ibi.com:8080/blue/organizations/jenkins/omni-pipeline/detail/feature%2FOG-7628-build-process-unify-code-quality-and-system-test/15/pipeline#log-97
          Hide
          jbennett20912 Jeffrey Bennett added a comment -

          Stack trace when using "LOCK_${env.PLATFORM}":

           java.lang.IllegalArgumentException: The label does not exist: LOCK_null
          at org.jenkins.plugins.lockableresources.LockStepResource.validate(LockStepResource.java:88)
          at org.jenkins.plugins.lockableresources.LockStep.validate(LockStep.java:138)
          at org.jenkins.plugins.lockableresources.LockStepExecution.start(LockStepExecution.java:38)
          at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:286)
          at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:179)
          at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
          at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
          at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:20)
          at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.recursiveWrappers(ModelInterpreter.groovy:636)
          at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.recursiveWrappers(ModelInterpreter.groovy:635)
          at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inWrappers(ModelInterpreter.groovy:609)
          at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inWrappers(ModelInterpreter.groovy:608)
          at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:259)
          at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:438)
          at __cps.transform__(Native Method)
          at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:86)
          at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113)
          at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
          at jdk.internal.reflect.GeneratedMethodAccessor283.invoke(Unknown Source)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:566)
          at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:46)
          at com.cloudbees.groovy.cps.Next.step(Next.java:83)
          at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
          at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
          at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129)
          at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
          at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
          at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
          at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
          at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276)
          at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
          at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
          at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:136)
          at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
          at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
          at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
          at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
          at java.base/java.lang.Thread.run(Thread.java:834)

          Show
          jbennett20912 Jeffrey Bennett added a comment - Stack trace when using "LOCK_${env.PLATFORM}":  java.lang.IllegalArgumentException: The label does not exist: LOCK_null at org.jenkins.plugins.lockableresources.LockStepResource.validate(LockStepResource.java:88) at org.jenkins.plugins.lockableresources.LockStep.validate(LockStep.java:138) at org.jenkins.plugins.lockableresources.LockStepExecution.start(LockStepExecution.java:38) at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:286) at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:179) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:20) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.recursiveWrappers(ModelInterpreter.groovy:636) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.recursiveWrappers(ModelInterpreter.groovy:635) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inWrappers(ModelInterpreter.groovy:609) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inWrappers(ModelInterpreter.groovy:608) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage(ModelInterpreter.groovy:259) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock(ModelInterpreter.groovy:438) at __ cps.transform __(Native Method) at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:86) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83) at jdk.internal.reflect.GeneratedMethodAccessor283.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:46) at com.cloudbees.groovy.cps.Next.step(Next.java:83) at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174) at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163) at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129) at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268) at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51) at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:136) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834)
          jbennett20912 Jeffrey Bennett made changes -
          Field Original Value New Value
          Description I have a declarative-pipeline and am using a matrix to perform system tests.  One of the axis of the matrix is name=PLATFORM (values=Windows, Linux).   I'd like to create a step with a lock on it based on the value of platform, hence, something like this:
          {code:java}
          matrix {
              axes {
                  axis {
                      name = 'PLATFORM'
                      values = Windows', 'Linux'
                  }
              }
              options {
                  lock( label: "LOCK_${PLATFORM}", quantity: 1 )
              }
              stages {
                 ...
                 // the above lock could also be applied to a stage within this stages block
              }
          }

          {code}
          If I read the documentation, I think this is supposed to work as the axis values are supposed to be able to be referenced from 'options' setup.  However, when I run this, I get one of two errors:
           * Referenced as "LOCK_${env.PLATFORM}" yields lock does not exist "LOCK_null"
           * Referenced as "LOCK_${PLATFORM}" yields no such property "PLATFORM"
          I have a declarative-pipeline and am using a matrix to perform system tests.  One of the axis of the matrix is name=PLATFORM (values=Windows, Linux).   I'd like to create a step with a lock on it based on the value of platform, hence, something like this:
          {code:java}
          matrix {
              axes {
                  axis {
                      name = 'PLATFORM'
                      values = Windows', 'Linux'
                  }
              }
              options {
                  lock( label: "LOCK_${PLATFORM}", quantity: 1 )
              }
              stages {
                 ...
                 // the above lock could also be applied to a stage within this stages block
              }
          }

          {code}
          If I read the documentation, I think this is supposed to work as the axis values are supposed to be able to be referenced from 'options' setup.  However, when I run this, I get one of two errors:
           * Referenced as "LOCK_${env.PLATFORM}" yields lock does not exist "LOCK_null"
           * Referenced as "LOCK_${PLATFORM}" yields no such property "PLATFORM"

          I have tried it at various levels - 1) as above, on the stages block, and 2) on a stage within the stages.  They both fail in similar ways.

          The intent here is that we would grab (or wait for) the LOCK_Windows or the LOCK_Linux as appropriate.

          It seems like the axis value is not passed through to the options-block, or to the lock-command within the option.  
          Hide
          jbennett20912 Jeffrey Bennett added a comment - - edited

          This may be a misinterpretation (on my part) of the documentation.   I am lead to believe that this ought to work when reading: https://www.jenkins.io/doc/book/pipeline/syntax/#matrix-cell-directives, the "Example #34" (which does something similar with 'agent' and 'when'), and the indication that 'Matrix cell-level directives' can be applied to 'options'.

           

          Show
          jbennett20912 Jeffrey Bennett added a comment - - edited This may be a misinterpretation (on my part) of the documentation.   I am lead to believe that this ought to work when reading: https://www.jenkins.io/doc/book/pipeline/syntax/#matrix-cell-directives , the "Example #34" (which does something similar with 'agent' and 'when'), and the indication that 'Matrix cell-level directives' can be applied to 'options'.  
          tgr Tobias Gruetzmacher made changes -
          Assignee Tobias Gruetzmacher [ tgr ]

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            jbennett20912 Jeffrey Bennett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: