-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Jenkins 1.436, NodeLabel 1.1.1, Parameterized Trigger 2.11
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.
to be more precise, this occurs if the target job does not have any parameters set.