Promoted builds do not receive parameterized builds

Article ID:219046328
1 minute readKnowledge base

Issue

  • Promoted build step ignores build parameters.

  • Promoted build step does not receive any parameterized build options.

  • I am receiving the following error after upgrading Jenkins:

FATAL: Illegal choice for parameter PARAMETER: $PARAMETER
java.lang.IllegalArgumentException: Illegal choice for parameter PARAMETER: $PARAMETER
at hudson.model.ChoiceParameterDefinition.checkValue(ChoiceParameterDefinition.java:79)
at hudson.model.ChoiceParameterDefinition.createValue(ChoiceParameterDefinition.java:91)
at hudson.model.ChoiceParameterDefinition.createValue(ChoiceParameterDefinition.java:19)
at hudson.plugins.parameterizedtrigger.ProjectSpecificParameterValuesActionTransform.convertToDefinedType(ProjectSpecificParameterValuesActionTransform.java:82)
at hudson.plugins.parameterizedtrigger.ProjectSpecificParameterValuesActionTransform.transformParametersAction(ProjectSpecificParameterValuesActionTransform.java:33)
at hudson.plugins.parameterizedtrigger.ProjectSpecificParametersActionFactory.getProjectSpecificBuildActions(ProjectSpecificParametersActionFactory.java:33)
at hudson.plugins.parameterizedtrigger.BuildTriggerConfig.getBuildActions(BuildTriggerConfig.java:351)
at hudson.plugins.parameterizedtrigger.BuildTriggerConfig.perform(BuildTriggerConfig.java:372)
at hudson.plugins.parameterizedtrigger.BuildTrigger.perform(BuildTrigger.java:83)
at hudson.plugins.promoted_builds.Promotion$RunnerImpl.build(Promotion.java:403)
at hudson.plugins.promoted_builds.Promotion$RunnerImpl.doRun(Promotion.java:345)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1738)
at hudson.model.Run.run(Run.java:1676)
at hudson.plugins.promoted_builds.Promotion.run(Promotion.java:284)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Finished: FAILURE

Environment

  • Jenkins LTS 1.651.2

  • CloudBees Jenkins Enterprise 1.651.2.1

  • Parameterized Build

Resolution

Due to the security fix in: Jenkins Security Advisory 2016-05-11 caused a regression in the promoted builds plugin which does ignores parameterized build configuration: JENKINS-34826.

As of writing this article the only known workaround is to add the parameter configuration to the promoted build job.

Workaround Steps

1 . First step is to grab the parameter name (In my example I used REMOTE_SSH) image::common-kb::Screen_Shot_2016-05-13_at_5.02.10_PM.png[]

1a . Example of my promoted build using the parameter and passing it to another remote job: image::common-kb::Screen_Shot_2016-05-13_at_5.03.17_PM.png[]

2 . On the left side of the job page is a link called "Promotion Status". Click that link:

Screen Shot 2016 05 13 at 5.04.12 PM

3 . After clicking on the link then click on the name of the promotion job:

Screen Shot 2016 05 13 at 5.12.09 PM

4 . After clicking on the promotion job click on the configure link:

Screen Shot 2016 05 13 at 5.12.19 PM

5 . Configure a paramaterized build option and click save (it can be a String parameter): Note: Make sure it contains the same parameterized variable name as the one from the promoted build.

Screen Shot 2016 05 13 at 5.04.38 PM

6 . After clicking save you can trigger a new build which will properly pass the parameterized build configuration to the downstream job:

Screen Shot 2016 05 13 at 5.05.07 PM
Screen Shot 2016 05 13 at 5.06.27 PM
This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.