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

"Show nodes" button from nodelabelparameter plugin never shows nodes

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • Jenkins 2.289.2
      nodelabelparameter plugin 1.7.3, 1.8.1, 1.9.0
    • 1.11.0

      When starting a Freestyle job that has been parameterized with a Label parameter from the nodelabelparameter plugin, a "Show Nodes" button is visible to the right of the label field. No matter what value is entered into the label field, the warning always appears that a label must be specified.

      The label argument to the doXXX method seems to always by the empty string or null. The problem has been seen on plugin versions 1.7.3 (from 2016) through the current release and with multiple Jenkins versions

          [JENKINS-66175] "Show nodes" button from nodelabelparameter plugin never shows nodes

          Adam vonNieda added a comment -

          Can confirm that this is happening for me as well. It's been happening for quite a while, I don't think it was introduced with 1.9.0, but unfortunately I'm not certain at what point it began. I'm on LTS 2.289.3 with nodelabelparameter 1.9.0

          Adam vonNieda added a comment - Can confirm that this is happening for me as well. It's been happening for quite a while, I don't think it was introduced with 1.9.0, but unfortunately I'm not certain at what point it began. I'm on LTS 2.289.3 with nodelabelparameter 1.9.0

          Adam vonNieda added a comment -

          I have a second installation of Jenkins which is currently at 2.263.1 / 1.7.2 and it does not have the described issue.  Both of my installations are on Linux.  

          Adam vonNieda added a comment - I have a second installation of Jenkins which is currently at 2.263.1 / 1.7.2 and it does not have the described issue.  Both of my installations are on Linux.  

          Feteu added a comment - - edited

          I'm experiencing the same issue with the LTS version 2.303.1. I would really love to have this issue fixed.

          I suspect the issue to be present somewhere in this area: https://github.com/jenkinsci/nodelabelparameter-plugin/blob/8e8257a47d5d825ed7fa7998d11eaaf091b5d92c/src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/LabelParameterDefinition.java#L162

          Feteu added a comment - - edited I'm experiencing the same issue with the LTS version 2.303.1. I would really love to have this issue fixed. I suspect the issue to be present somewhere in this area:  https://github.com/jenkinsci/nodelabelparameter-plugin/blob/8e8257a47d5d825ed7fa7998d11eaaf091b5d92c/src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/LabelParameterDefinition.java#L162

          Maciej added a comment - - edited

          I can see the issue on Jenkins 2.321     org.jenkins-ci.plugins:nodelabelparameter:1.9.2

          I go to my parametrized job. I click "Build with Parameters". At my LabelParameter I click "Show nodes" button, I get warning "a label is required". This is regardless of the label I enter. The builds though get run properly.

          Seemingly relevant issue: when using script console to list all the running and scheduled builds. I can see the value of all parameters except the LabelParameter. The value of the parameter appears null.

           

          def buildingJobs = Jenkins.instance.getAllItems(Job.class).findAll { it.isBuilding() }
          buildingJobs.each { job->
              allRuns = job._getRuns()
              allRuns.each { item ->
                
                  def runningLabel
                  if (item.isBuilding()) {
                      runningLabel = item.getExecutor().getOwner().getNode().getNodeName()
                  }
          
                  def scheduledLabel = 'zzz';
                  // get parameters
                  def parameters = item?.actions.find{ it instanceof ParametersAction }?.parameters
                  parameters.each {
                      if( it.name == "PARAM_WITH_LABEL") {
                          scheduledLabel = it.value
                      }
                      //println "        ${it.name}: ${it.value}"
                  }
                println "'${item.getUrl()}' ${item.isBuilding()} '${scheduledLabel}' '${runningLabel}'"
              }
          }
          

           

          I get something alike

          'job/dibench/22740/' true 'null' 'nodename1'
          'job/dibench/22739/' true 'null' 'nodename2'
          'job/dibench/22738/' false 'null' 'null'
          'job/dibench/22737/' false 'null' 'null'

          Maciej added a comment - - edited I can see the issue on Jenkins 2.321     org.jenkins-ci.plugins:nodelabelparameter:1.9.2 I go to my parametrized job. I click "Build with Parameters". At my LabelParameter I click "Show nodes" button, I get warning "a label is required". This is regardless of the label I enter. The builds though get run properly. Seemingly relevant issue: when using script console to list all the running and scheduled builds. I can see the value of all parameters except the LabelParameter. The value of the parameter appears null.   def buildingJobs = Jenkins.instance.getAllItems(Job.class).findAll { it.isBuilding() } buildingJobs.each { job->     allRuns = job._getRuns()     allRuns.each { item ->                def runningLabel         if (item.isBuilding()) {             runningLabel = item.getExecutor().getOwner().getNode().getNodeName()         }         def scheduledLabel = 'zzz' ;         // get parameters         def parameters = item?.actions.find{ it instanceof ParametersAction }?.parameters         parameters.each {           if ( it.name == "PARAM_WITH_LABEL" ) {                 scheduledLabel = it.value             }             //println "        ${it.name}: ${it.value}"         }     println " '${item.getUrl()}' ${item.isBuilding()} '${scheduledLabel}' '${runningLabel}' "     } }   I get something alike 'job/dibench/22740/' true ' null ' 'nodename1' 'job/dibench/22739/' true ' null ' 'nodename2' 'job/dibench/22738/' false ' null ' ' null ' 'job/dibench/22737/' false ' null ' ' null '

          Maciej added a comment -

          Looking at code pointed by feteu  looks we hit the case where label is blank a.k.a null.

          The issue might well be related to JENKINS-43720

           

          Maciej added a comment - Looking at code pointed by feteu   looks we hit the case where label is blank a.k.a null. The issue might well be related to JENKINS-43720  

          Rayan Moarkech added a comment - - edited

          I can confirm that i have the same issue. Any news about the fix or update? It was working fine on v1.7.2

          Rayan Moarkech added a comment - - edited I can confirm that i have the same issue. Any news about the fix or update? It was working fine on v1.7.2

          Mark Waite added a comment -

          rayanmoarkech no news on a fix or update. I don't plan to work on this issue any time soon. If you'd like to submit a pull request to address the issue, I may be able to spend some time to review it.

          Mark Waite added a comment - rayanmoarkech no news on a fix or update. I don't plan to work on this issue any time soon. If you'd like to submit a pull request to address the issue, I may be able to spend some time to review it.

          Rayan Moarkech added a comment - markewaite This PR fixes the issue: https://github.com/jenkinsci/nodelabelparameter-plugin/pull/132

          Mark Waite added a comment -

          Thanks rayanmoarkech. Pull request has been reviewed, tested, approved, merged, and released as 1.11.0. Thanks very much!

          Mark Waite added a comment - Thanks rayanmoarkech . Pull request has been reviewed, tested, approved, merged, and released as 1.11.0. Thanks very much!

            Unassigned Unassigned
            markewaite Mark Waite
            Votes:
            6 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: