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

If the job is parameterized but there are no parameters defined it causes all builds to fail

      Jenkins 1.637 introduced a problem related to parameterized builds. This problem has impact in multiple situations, as I am going to describe next.

      Jenkins 1.637 introduced the "OptionalJobProperty" class. Please see this commit: https://github.com/jenkinsci/jenkins/commit/53c86ec857a49609613ed1871a01830d51a89265

      Job configuration

      Follow the following steps:

      • Create a new job "Job1"
      • Activate the option "This build is parameterized"
      • Don't add any parameter
      • Save the job
      • Get back to the job configuration

      Previous to this version, you would see that Jenkins was "smart" enough to understand that it makes no sense to have a parameterized job without parameters, so it wouldn't save this option.

      After this version, the "This build is parameterized" option is active (and actually saved to the config.xml file) without any parameter. See the attached image "1".

      The config.xml file contains the following content.

      <properties>
          <hudson.model.ParametersDefinitionProperty/>
        </properties>

      Downstream job trigger

      Follow these steps:

      • Install the "Parameterized Trigger Plugin"
      • Add a new job "Job0". Add a downstream job "Job1", and pass the current build parameters.
      • Trigger "Job0", and wait for it to trigger "Job1"

      Result

      • Before Jenkins 1.637, the job is triggered with no problems.
      • After Jenkins 1.637, Job1 won't be triggered.
        This appears in Console Output.

      ERROR: Failed to build parameters to trigger project: Job1
      java.lang.NullPointerException
      at hudson.plugins.parameterizedtrigger.ProjectSpecificParameterValuesActionTransform.getParameterDefinitionsMap(ProjectSpecificParameterValuesActionTransform.java:47)
      at hudson.plugins.parameterizedtrigger.ProjectSpecificParameterValuesActionTransform.transformParametersAction(ProjectSpecificParameterValuesActionTransform.java:29)
      at hudson.plugins.parameterizedtrigger.ProjectSpecificParametersActionFactory.getProjectSpecificBuildActions(ProjectSpecificParametersActionFactory.java:32)
      at hudson.plugins.parameterizedtrigger.BuildTriggerConfig.getBuildActions(BuildTriggerConfig.java:290)
      at hudson.plugins.parameterizedtrigger.ParameterizedDependency.shouldTriggerBuild(ParameterizedDependency.java:60)
      at hudson.tasks.BuildTrigger.execute(BuildTrigger.java:245)
      at hudson.model.AbstractBuild$AbstractBuildExecution.cleanUp(AbstractBuild.java:684)
      at hudson.model.Build$BuildExecution.cleanUp(Build.java:200)
      at hudson.model.Run.execute(Run.java:1785)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:410)
      Finished: SUCCESS

      This is not a major problem because there a workaround.

          [JENKINS-33991] If the job is parameterized but there are no parameters defined it causes all builds to fail

          André Carmo created issue -

          André Carmo added a comment - - edited

          This could be seen as a problem of both Jenkins-core and the parameterized trigger plugin.

          I am going to submit a pull request for Jenkins-core, and I will also submit a pull request to the parameterized trigger plugin, in order to increase the possibility of fixing the problem (ideally it would require to upgrade both Jenkins AND the Parameterized Trigger Plugin, but upgrading just one of them will solve part of the problem, which is better than nothing). I will treat the problem on the plugin side on another JIRA issue.

          André Carmo added a comment - - edited This could be seen as a problem of both Jenkins-core and the parameterized trigger plugin. I am going to submit a pull request for Jenkins-core, and I will also submit a pull request to the parameterized trigger plugin, in order to increase the possibility of fixing the problem (ideally it would require to upgrade both Jenkins AND the Parameterized Trigger Plugin, but upgrading just one of them will solve part of the problem, which is better than nothing). I will treat the problem on the plugin side on another JIRA issue.
          André Carmo made changes -
          Assignee New: André Carmo [ atcarmo ]
          André Carmo made changes -
          Environment New: Jenkins 1.637 and above
          André Carmo made changes -
          Description Original: Jenkins 1.637 introduced a problem related to parameterized builds. This problem has impact in multiple situations, as I am going to describe next.

          Jenkins 1.637 introduced the "OptionalJobProperty" class. Please see this commit: https://github.com/jenkinsci/jenkins/commit/53c86ec857a49609613ed1871a01830d51a89265

          *Job configuration*

          Follow the following steps:
          * Create a new job "Job1"
          * Activate the option "This build is parameterized"
          * Don't add any parameter
          * Save the job
          * Get back to the job configuration

          Previous to this version, you would see that Jenkins was "smart" enough to understand that it makes no sense to have a parameterized job without parameters, so it wouldn't save this option.

          After this version, the "This build is parameterized" option is active (and actually saved to the config.xml file) without any parameter. See the attached image "1".

          The config.xml file contains the following content.
          {code}<properties>
              <hudson.model.ParametersDefinitionProperty/>
            </properties>{code}

          *Downstream job trigger"

          Follow these steps:
          * Install the "Parameterized Trigger Plugin"
          * Add a new job "Job0". Add a downstream job "Job1", and pass the current build parameters.
          * Trigger "Job0", and wait for it to trigger "Job1"

          Result
          * Before Jenkins 1.637, the job triggers with no problems.
          * After Jenkins 1.637, Job1 won't trigger.
          This appears in Console Output.

          {quote}ERROR: Failed to build parameters to trigger project: Job1
          java.lang.NullPointerException
          at hudson.plugins.parameterizedtrigger.ProjectSpecificParameterValuesActionTransform.getParameterDefinitionsMap(ProjectSpecificParameterValuesActionTransform.java:47)
          at hudson.plugins.parameterizedtrigger.ProjectSpecificParameterValuesActionTransform.transformParametersAction(ProjectSpecificParameterValuesActionTransform.java:29)
          at hudson.plugins.parameterizedtrigger.ProjectSpecificParametersActionFactory.getProjectSpecificBuildActions(ProjectSpecificParametersActionFactory.java:32)
          at hudson.plugins.parameterizedtrigger.BuildTriggerConfig.getBuildActions(BuildTriggerConfig.java:290)
          at hudson.plugins.parameterizedtrigger.ParameterizedDependency.shouldTriggerBuild(ParameterizedDependency.java:60)
          at hudson.tasks.BuildTrigger.execute(BuildTrigger.java:245)
          at hudson.model.AbstractBuild$AbstractBuildExecution.cleanUp(AbstractBuild.java:684)
          at hudson.model.Build$BuildExecution.cleanUp(Build.java:200)
          at hudson.model.Run.execute(Run.java:1785)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:98)
          at hudson.model.Executor.run(Executor.java:410)
          Finished: SUCCESS{quote}

          This is not a major problem because there a workaround.
          New: Jenkins 1.637 introduced a problem related to parameterized builds. This problem has impact in multiple situations, as I am going to describe next.

          Jenkins 1.637 introduced the "OptionalJobProperty" class. Please see this commit: https://github.com/jenkinsci/jenkins/commit/53c86ec857a49609613ed1871a01830d51a89265

          *Job configuration*

          Follow the following steps:
          * Create a new job "Job1"
          * Activate the option "This build is parameterized"
          * Don't add any parameter
          * Save the job
          * Get back to the job configuration

          Previous to this version, you would see that Jenkins was "smart" enough to understand that it makes no sense to have a parameterized job without parameters, so it wouldn't save this option.

          After this version, the "This build is parameterized" option is active (and actually saved to the config.xml file) without any parameter. See the attached image "1".

          The config.xml file contains the following content.
          {code}<properties>
              <hudson.model.ParametersDefinitionProperty/>
            </properties>{code}

          *Downstream job trigger*

          Follow these steps:
          * Install the "Parameterized Trigger Plugin"
          * Add a new job "Job0". Add a downstream job "Job1", and pass the current build parameters.
          * Trigger "Job0", and wait for it to trigger "Job1"

          Result
          * Before Jenkins 1.637, the job triggers with no problems.
          * After Jenkins 1.637, Job1 won't trigger.
          This appears in Console Output.

          {quote}ERROR: Failed to build parameters to trigger project: Job1
          java.lang.NullPointerException
          at hudson.plugins.parameterizedtrigger.ProjectSpecificParameterValuesActionTransform.getParameterDefinitionsMap(ProjectSpecificParameterValuesActionTransform.java:47)
          at hudson.plugins.parameterizedtrigger.ProjectSpecificParameterValuesActionTransform.transformParametersAction(ProjectSpecificParameterValuesActionTransform.java:29)
          at hudson.plugins.parameterizedtrigger.ProjectSpecificParametersActionFactory.getProjectSpecificBuildActions(ProjectSpecificParametersActionFactory.java:32)
          at hudson.plugins.parameterizedtrigger.BuildTriggerConfig.getBuildActions(BuildTriggerConfig.java:290)
          at hudson.plugins.parameterizedtrigger.ParameterizedDependency.shouldTriggerBuild(ParameterizedDependency.java:60)
          at hudson.tasks.BuildTrigger.execute(BuildTrigger.java:245)
          at hudson.model.AbstractBuild$AbstractBuildExecution.cleanUp(AbstractBuild.java:684)
          at hudson.model.Build$BuildExecution.cleanUp(Build.java:200)
          at hudson.model.Run.execute(Run.java:1785)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:98)
          at hudson.model.Executor.run(Executor.java:410)
          Finished: SUCCESS{quote}

          This is not a major problem because there a workaround.
          André Carmo made changes -
          Description Original: Jenkins 1.637 introduced a problem related to parameterized builds. This problem has impact in multiple situations, as I am going to describe next.

          Jenkins 1.637 introduced the "OptionalJobProperty" class. Please see this commit: https://github.com/jenkinsci/jenkins/commit/53c86ec857a49609613ed1871a01830d51a89265

          *Job configuration*

          Follow the following steps:
          * Create a new job "Job1"
          * Activate the option "This build is parameterized"
          * Don't add any parameter
          * Save the job
          * Get back to the job configuration

          Previous to this version, you would see that Jenkins was "smart" enough to understand that it makes no sense to have a parameterized job without parameters, so it wouldn't save this option.

          After this version, the "This build is parameterized" option is active (and actually saved to the config.xml file) without any parameter. See the attached image "1".

          The config.xml file contains the following content.
          {code}<properties>
              <hudson.model.ParametersDefinitionProperty/>
            </properties>{code}

          *Downstream job trigger*

          Follow these steps:
          * Install the "Parameterized Trigger Plugin"
          * Add a new job "Job0". Add a downstream job "Job1", and pass the current build parameters.
          * Trigger "Job0", and wait for it to trigger "Job1"

          Result
          * Before Jenkins 1.637, the job triggers with no problems.
          * After Jenkins 1.637, Job1 won't trigger.
          This appears in Console Output.

          {quote}ERROR: Failed to build parameters to trigger project: Job1
          java.lang.NullPointerException
          at hudson.plugins.parameterizedtrigger.ProjectSpecificParameterValuesActionTransform.getParameterDefinitionsMap(ProjectSpecificParameterValuesActionTransform.java:47)
          at hudson.plugins.parameterizedtrigger.ProjectSpecificParameterValuesActionTransform.transformParametersAction(ProjectSpecificParameterValuesActionTransform.java:29)
          at hudson.plugins.parameterizedtrigger.ProjectSpecificParametersActionFactory.getProjectSpecificBuildActions(ProjectSpecificParametersActionFactory.java:32)
          at hudson.plugins.parameterizedtrigger.BuildTriggerConfig.getBuildActions(BuildTriggerConfig.java:290)
          at hudson.plugins.parameterizedtrigger.ParameterizedDependency.shouldTriggerBuild(ParameterizedDependency.java:60)
          at hudson.tasks.BuildTrigger.execute(BuildTrigger.java:245)
          at hudson.model.AbstractBuild$AbstractBuildExecution.cleanUp(AbstractBuild.java:684)
          at hudson.model.Build$BuildExecution.cleanUp(Build.java:200)
          at hudson.model.Run.execute(Run.java:1785)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:98)
          at hudson.model.Executor.run(Executor.java:410)
          Finished: SUCCESS{quote}

          This is not a major problem because there a workaround.
          New: Jenkins 1.637 introduced a problem related to parameterized builds. This problem has impact in multiple situations, as I am going to describe next.

          Jenkins 1.637 introduced the "OptionalJobProperty" class. Please see this commit: https://github.com/jenkinsci/jenkins/commit/53c86ec857a49609613ed1871a01830d51a89265

          *Job configuration*

          Follow the following steps:
          * Create a new job "Job1"
          * Activate the option "This build is parameterized"
          * Don't add any parameter
          * Save the job
          * Get back to the job configuration

          Previous to this version, you would see that Jenkins was "smart" enough to understand that it makes no sense to have a parameterized job without parameters, so it wouldn't save this option.

          After this version, the "This build is parameterized" option is active (and actually saved to the config.xml file) without any parameter. See the attached image "1".

          The config.xml file contains the following content.
          {code}<properties>
              <hudson.model.ParametersDefinitionProperty/>
            </properties>{code}

          *Downstream job trigger*

          Follow these steps:
          * Install the "Parameterized Trigger Plugin"
          * Add a new job "Job0". Add a downstream job "Job1", and pass the current build parameters.
          * Trigger "Job0", and wait for it to trigger "Job1"

          Result
          * Before Jenkins 1.637, the job is triggered with no problems.
          * After Jenkins 1.637, Job1 won't be triggered.
          This appears in Console Output.

          {quote}ERROR: Failed to build parameters to trigger project: Job1
          java.lang.NullPointerException
          at hudson.plugins.parameterizedtrigger.ProjectSpecificParameterValuesActionTransform.getParameterDefinitionsMap(ProjectSpecificParameterValuesActionTransform.java:47)
          at hudson.plugins.parameterizedtrigger.ProjectSpecificParameterValuesActionTransform.transformParametersAction(ProjectSpecificParameterValuesActionTransform.java:29)
          at hudson.plugins.parameterizedtrigger.ProjectSpecificParametersActionFactory.getProjectSpecificBuildActions(ProjectSpecificParametersActionFactory.java:32)
          at hudson.plugins.parameterizedtrigger.BuildTriggerConfig.getBuildActions(BuildTriggerConfig.java:290)
          at hudson.plugins.parameterizedtrigger.ParameterizedDependency.shouldTriggerBuild(ParameterizedDependency.java:60)
          at hudson.tasks.BuildTrigger.execute(BuildTrigger.java:245)
          at hudson.model.AbstractBuild$AbstractBuildExecution.cleanUp(AbstractBuild.java:684)
          at hudson.model.Build$BuildExecution.cleanUp(Build.java:200)
          at hudson.model.Run.execute(Run.java:1785)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:98)
          at hudson.model.Executor.run(Executor.java:410)
          Finished: SUCCESS{quote}

          This is not a major problem because there a workaround.
          André Carmo made changes -
          Summary Original: If the jobs is parameterized but there are no parameters defined it causes all builds to fail New: If the job is parameterized but there are no parameters defined it causes all builds to fail
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 170005 ] New: JNJira + In-Review [ 183725 ]

          Roland Lukacs added a comment -

          Is there any update about this bug?

          Roland Lukacs added a comment - Is there any update about this bug?
          Daniel Beck made changes -
          Labels New: regression

            huybrechts huybrechts
            atcarmo André Carmo
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: