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

Predefined parameters not passing correct NODE_LABELS environment variable information.

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The value of "master" gets passed to the down stream job when you define NODE_LABELS in the Predefined parameters section of an upstream job.

      See attached screenshot showing the "Predefined parameters section" of the upstream job and the console output of the downstream job.

        Attachments

          Activity

          Hide
          jaystan Jason Stanley added a comment -

          In this case, the upstream job was not run on the master but a slave.

          If you look at the screenshot of the job output, you will see the value of NODE_LABELS is not master, but the name of the slave which the job is running on.

          All of the other environment variables are correctly passed to the downstream job except this one.

          Show
          jaystan Jason Stanley added a comment - In this case, the upstream job was not run on the master but a slave. If you look at the screenshot of the job output, you will see the value of NODE_LABELS is not master, but the name of the slave which the job is running on. All of the other environment variables are correctly passed to the downstream job except this one.
          Hide
          cjo9900 cjo9900 added a comment -

          I think you have hit the issue that has already been fixed in commit
          https://github.com/jenkinsci/parameterized-trigger-plugin/commit/16586248c382ef417e0aaa1d2cdb00baee87ec18
          which has not yet been released.

          Where the Environment variables are not correct, due to using the Dependancy Graph to trigger the downstream builds which always runs on master therefore gets the node labels from there, rather than from the slave that the job ran on.

          Show
          cjo9900 cjo9900 added a comment - I think you have hit the issue that has already been fixed in commit https://github.com/jenkinsci/parameterized-trigger-plugin/commit/16586248c382ef417e0aaa1d2cdb00baee87ec18 which has not yet been released. Where the Environment variables are not correct, due to using the Dependancy Graph to trigger the downstream builds which always runs on master therefore gets the node labels from there, rather than from the slave that the job ran on.
          Hide
          cjo9900 cjo9900 added a comment -

          Please retest with version 2.17 of the plugin and close if resolved.

          Show
          cjo9900 cjo9900 added a comment - Please retest with version 2.17 of the plugin and close if resolved.
          Hide
          hiteswar_kumar hiteswar kumar added a comment -

          I checked below at 2.17:
          downstream triggered build got parameter NODE_LABELS and its value corerctly
          but build is not triggered on node which received in NODE_LABELS.
          downstream triggered job tested with below both parameters:
          label
          or
          node

          upstream build sending NODE_LABELS value by predefined parameter window.

          as an alternative solution: nodelabelparamter setting at config of "trigger/call build on other project " at upstream job allow downstream build on correct slave as defined in NODE_LABELS

          Show
          hiteswar_kumar hiteswar kumar added a comment - I checked below at 2.17: downstream triggered build got parameter NODE_LABELS and its value corerctly but build is not triggered on node which received in NODE_LABELS. downstream triggered job tested with below both parameters: label or node upstream build sending NODE_LABELS value by predefined parameter window. as an alternative solution: nodelabelparamter setting at config of "trigger/call build on other project " at upstream job allow downstream build on correct slave as defined in NODE_LABELS
          Hide
          ikedam ikedam added a comment -

          I tested and see fixed in latest Jenkins 1.532.2 + Parameterized Trigger 2.23.
          How I tested:

          1. Create a free style project "downstream"
            • Add "Execute Windows batch command" and call "set"
              • It would be same to add "Execute shell" and call "export"
          2. Create a free style project "upstream"
            • Add "Execute Windows batch command" and call "set"
              • It would be same to add "Execute shell" and call "export"
            • Add "Trigger parameterized builds on other projects"
              • set "Projects to build" to "downstream"
              • Add "Predefined parameters" and set "PASSED_NODE_LABELS=${NODE_LABELS}"
          3. Launch upstream build
          4. See console log of downstream build and see "PASSED_NODE_LABELS=master" is output.
          Show
          ikedam ikedam added a comment - I tested and see fixed in latest Jenkins 1.532.2 + Parameterized Trigger 2.23. How I tested: Create a free style project "downstream" Add "Execute Windows batch command" and call "set" It would be same to add "Execute shell" and call "export" Create a free style project "upstream" Add "Execute Windows batch command" and call "set" It would be same to add "Execute shell" and call "export" Add "Trigger parameterized builds on other projects" set "Projects to build" to "downstream" Add "Predefined parameters" and set "PASSED_NODE_LABELS=${NODE_LABELS}" Launch upstream build See console log of downstream build and see "PASSED_NODE_LABELS=master" is output.

            People

            Assignee:
            cjo9900 cjo9900
            Reporter:
            jaystan Jason Stanley
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: