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

NodeLabel parameter not working inside workflow

    Details

    • Similar Issues:

      Description

      1. Install the nodelabel parameter plugin, and workflow plugin
      2. create a workflow, with one string parameter (STRING_PARAM1), and one node parameter (NODE_PARAM1)
      3. create a workflow like this:
        node {
           echo STRING_PARAM1
           echo NODE_PARAM1
        }
        

      If you run this workflow, you will get an error:

      groovy.lang.MissingPropertyException: No such property: NODE_PARAM1 for class: WorkflowScript
      

      The problem is that the NodeLabel parameter plugin overrides buildEnvVars which was deprecated in Jenkins 1.344: see http://javadoc.jenkins-ci.org/hudson/model/ParameterValue.html#buildEnvVars%28hudson.model.AbstractBuild,%20java.util.Map%29

      It needs to override buildEnvironment(). This is similar to the problem in JENKINS-27718

        Attachments

          Issue Links

            Activity

            rodrigc Craig Rodrigues created issue -
            rodrigc Craig Rodrigues made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-26694 [ JENKINS-26694 ]
            rodrigc Craig Rodrigues made changes -
            Description # Install the nodelabel parameter plugin, and workflow plugin
            # create a workflow, with one string parameter (STRING_PARAM1), and one node parameter (NODE_PARAM1)
            # create a workflow like this:
            {code}
            node {
               echo STRING_PARAM1
               echo NODE_PARAM1
            }
            {code}

            If you run this workflow, you will get an error:
            {code}
            groovy.lang.MissingPropertyException: No such property: NODE_PARAM1 for class: WorkflowScript
            {code}

            The problem is that the NodeLabel parameter plugin overrides buildEnvVars which was deprecated in Jenkins 1.344: see http://javadoc.jenkins-ci.org/hudson/model/ParameterValue.html#buildEnvVars%28hudson.model.AbstractBuild,%20java.util.Map%29
            # Install the nodelabel parameter plugin, and workflow plugin
            # create a workflow, with one string parameter (STRING_PARAM1), and one node parameter (NODE_PARAM1)
            # create a workflow like this:
            {code}
            node {
               echo STRING_PARAM1
               echo NODE_PARAM1
            }
            {code}

            If you run this workflow, you will get an error:
            {code}
            groovy.lang.MissingPropertyException: No such property: NODE_PARAM1 for class: WorkflowScript
            {code}

            The problem is that the NodeLabel parameter plugin overrides buildEnvVars which was deprecated in Jenkins 1.344: see http://javadoc.jenkins-ci.org/hudson/model/ParameterValue.html#buildEnvVars%28hudson.model.AbstractBuild,%20java.util.Map%29

            It needs to override buildEnvironment(). This is similar to the problem in JENKINS-26694
            rodrigc Craig Rodrigues made changes -
            Link This issue is related to JENKINS-22718 [ JENKINS-22718 ]
            rodrigc Craig Rodrigues made changes -
            Link This issue is related to JENKINS-27718 [ JENKINS-27718 ]
            rodrigc Craig Rodrigues made changes -
            Link This issue is related to JENKINS-22718 [ JENKINS-22718 ]
            rodrigc Craig Rodrigues made changes -
            Description # Install the nodelabel parameter plugin, and workflow plugin
            # create a workflow, with one string parameter (STRING_PARAM1), and one node parameter (NODE_PARAM1)
            # create a workflow like this:
            {code}
            node {
               echo STRING_PARAM1
               echo NODE_PARAM1
            }
            {code}

            If you run this workflow, you will get an error:
            {code}
            groovy.lang.MissingPropertyException: No such property: NODE_PARAM1 for class: WorkflowScript
            {code}

            The problem is that the NodeLabel parameter plugin overrides buildEnvVars which was deprecated in Jenkins 1.344: see http://javadoc.jenkins-ci.org/hudson/model/ParameterValue.html#buildEnvVars%28hudson.model.AbstractBuild,%20java.util.Map%29

            It needs to override buildEnvironment(). This is similar to the problem in JENKINS-26694
            # Install the nodelabel parameter plugin, and workflow plugin
            # create a workflow, with one string parameter (STRING_PARAM1), and one node parameter (NODE_PARAM1)
            # create a workflow like this:
            {code}
            node {
               echo STRING_PARAM1
               echo NODE_PARAM1
            }
            {code}

            If you run this workflow, you will get an error:
            {code}
            groovy.lang.MissingPropertyException: No such property: NODE_PARAM1 for class: WorkflowScript
            {code}

            The problem is that the NodeLabel parameter plugin overrides buildEnvVars which was deprecated in Jenkins 1.344: see http://javadoc.jenkins-ci.org/hudson/model/ParameterValue.html#buildEnvVars%28hudson.model.AbstractBuild,%20java.util.Map%29

            It needs to override buildEnvironment(). This is similar to the problem in JENKINS-27718
            recena Manuel Recena Soto made changes -
            Component/s workflow-plugin [ 18820 ]
            recena Manuel Recena Soto made changes -
            Labels workflow
            domi Dominik Bartholdi made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 167786 ] JNJira + In-Review [ 198274 ]
            abayer Andrew Bayer made changes -
            Labels workflow pipeline workflow
            abayer Andrew Bayer made changes -
            Labels pipeline workflow pipeline
            euphxenos Andrew Lawrence made changes -
            Link This issue is duplicated by JENKINS-32464 [ JENKINS-32464 ]

              People

              • Assignee:
                domi Dominik Bartholdi
                Reporter:
                rodrigc Craig Rodrigues
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: