Search code examples
jenkinsjenkins-2

Jenkins 2 loose parameters from previous Build Job


I have just upgrade from Jenkins 1.656 to jenkins 2.14 and my jobs failed because they didn't receive any parameters from previous jobs.

When reinstalling old 1.656 the comportement is back to normal (parameters are send normally to downstream jobs).

I'm using "Trigger/call builds on other projects" plugin with "Current build parameters" option. I tried with "Predefined parameters" as well without success.

In Jenkin's log I see the following message which shows that parameters are not transmitted:

WARNING: Skipped parameter `tenantName` as it is undefined on `etg-healthcheck-h1_log`. Set `-Dhudson.model.ParametersAction.keepUndefinedParameters`=true to allow undefined parameters to be injected as environment variables or `-Dhudson.model.ParametersAction.safeParameters=[comma-separated list]` to whitelist specific parameter names, even though it represents a security breach

Any help would be greatly appreciated as i'm stuck in 1.6 release.

Jean-Marc.


Solution

  • OK, Jenkins2 have change the behaviour of Job parameters. When a Job have non parameters declared, it will not receive any parameters. This seems logical and safe but it a serious incompatibility with 1.6 release.

    To make this work again you have 3 choices:

    1. add the parameters in the concerned jobs. Depending of the number of Jbos this could be some important work,
    2. set the "-Dhudson.model.ParametersAction.keepUndefinedParameters=true into the /etc/default/jenkins file in JAVA_ARGS variable. This malke Jenkins 2 compatible with 1.6 behaviour,
    3. (not tried) add "-Dhudson.model.ParametersAction.safeParameters=[comma-separated list]" into /etc/default/jenkins file in JAVA_ARGS variable.

    More informations here : https://issues.jenkins-ci.org/browse/JENKINS-29031

    I hope this helps someone

    Jean-Marc