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

Triggering a build with "Current build parameters" fails when the current build parameters includes a node name

    Details

      Description

      In the process of discussing JENKINS-12155, I realized there was an underlying problem with the way these plugins interact.

      Triggering a build of a job with "Current build parameters" doesn't work if there's a node parameter involved.
      It creates this error:
      Building remotely on [node]
      FATAL: null
      java.lang.NullPointerException
      at org.jvnet.jenkins.plugins.nodelabelparameter.NodeParameterValue.createBuildWrapper(NodeParameterValue.java:82)
      at hudson.model.ParametersAction.createBuildWrappers(ParametersAction.java:74)
      at hudson.model.Build$RunnerImpl.doRun(Build.java:130)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:460)
      at hudson.model.Run.run(Run.java:1404)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:230)

      I discovered the only way to pass a node parameter to another job is to trigger it individually with a "NodeLabel parameter". This breaks the "Current build parameters" functionality.

      WORKAROUND:
      To achieve the same effect as "Current build parameters", I have to choose a NodeLabel parameter with node=$NODE_NAME, and copy all of my previously defined parameters into "Predefined parameters". This is a minor pain.

        Activity

        Hide
        domi Dominik Bartholdi added a comment -

        to be more precise, this occurs if the target job does not have any parameters set.

        Show
        domi Dominik Bartholdi added a comment - to be more precise, this occurs if the target job does not have any parameters set.
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in jenkins
        User: imod
        Path:
        src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/NodeParameterValue.java
        http://jenkins-ci.org/commit/nodelabelparameter-plugin/af9c2220c3b089cdd3f5631446b2c7e136419f21
        Log:
        [FIXED JENKINS-12226] Triggering a build with 'Current build parameters' fails when the current build parameters includes a node name

        Compare: https://github.com/jenkinsci/nodelabelparameter-plugin/compare/456f830...af9c222

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: imod Path: src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/NodeParameterValue.java http://jenkins-ci.org/commit/nodelabelparameter-plugin/af9c2220c3b089cdd3f5631446b2c7e136419f21 Log: [FIXED JENKINS-12226] Triggering a build with 'Current build parameters' fails when the current build parameters includes a node name Compare: https://github.com/jenkinsci/nodelabelparameter-plugin/compare/456f830...af9c222

          People

          • Assignee:
            domi Dominik Bartholdi
            Reporter:
            mconlon Michael Conlon
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: