Skip to content

[JENKINS-15094] Parameters: NPE in canTake() procedures may kill all executors #12939

Closed

Description

@jenkins-infra-bot

Jenkins executors are not robust against nulls returned by createValue() and createDefaultValue(). Such return value is valid according to Javadoc.

NPE in canTake() procedure kills the executor thread. Unfortunately, Jenkins tries other executors after that => any NPE in canTake() terminates ALL active Jenkins executors.

The initial description from Rotem:

when using jenkins-multijob-plugin and parameter from type “File Parameter” the Jenkins crashes.
When i start to run a Multijob with a multijob phase with values in "Advanced: "parameters", if the next job has a parameter from type “File Parameter” Jenkins is eating up all the executers with - ALL available Build executors are turning into zombies with the status 'Dead ' with the exception:

java.lang.NullPointerException
at hudson.model.ParametersAction.getAssignedLabel(ParametersAction.java:126)
at hudson.model.Queue$Item.getAssignedLabel(Queue.java:1265)
at hudson.model.Node.canTake(Node.java:308)
at hudson.model.Queue$JobOffer.canTake(Queue.java:210)
at hudson.model.Queue.maintain(Queue.java:952)
at hudson.model.Queue.pop(Queue.java:783)
at hudson.model.Executor.grabJob(Executor.java:287)
at hudson.model.Executor.run(Executor.java:208)

Even if at this stage I go to the settings and enlarge the number of Executors, they immediately turn into zombies as well.
When I remove the specific “File Parameter” parameter all works fine.
Please advice.


Originally reported by rotem, imported from: Parameters: NPE in canTake() procedures may kill all executors
  • assignee: oleg_nenashev
  • status: Resolved
  • priority: Blocker
  • component(s): core
  • label(s): 1.565.1-fixed
  • resolution: Fixed
  • resolved: 2014-06-01T16:30:14+00:00
  • votes: 0
  • watchers: 6
  • imported: 2025-11-24
Raw content of original issue

Jenkins executors are not robust against nulls returned by createValue() and createDefaultValue(). Such return value is valid according to Javadoc.

NPE in canTake() procedure kills the executor thread. Unfortunately, Jenkins tries other executors after that => any NPE in canTake() terminates ALL active Jenkins executors.

The initial description from Rotem:

when using jenkins-multijob-plugin and parameter from type “File Parameter” the Jenkins crashes. When i start to run a Multijob with a multijob phase with values in "Advanced: "parameters", if the next job has a parameter from type “File Parameter” Jenkins is eating up all the executers with - ALL available Build executors are turning into zombies with the status 'Dead ' with the exception:

java.lang.NullPointerException at hudson.model.ParametersAction.getAssignedLabel(ParametersAction.java:126) at hudson.model.Queue$Item.getAssignedLabel(Queue.java:1265) at hudson.model.Node.canTake(Node.java:308) at hudson.model.Queue$JobOffer.canTake(Queue.java:210) at hudson.model.Queue.maintain(Queue.java:952) at hudson.model.Queue.pop(Queue.java:783) at hudson.model.Executor.grabJob(Executor.java:287) at hudson.model.Executor.run(Executor.java:208)

Even if at this stage I go to the settings and enlarge the number of Executors, they immediately turn into zombies as well. When I remove the specific “File Parameter” parameter all works fine. Please advice.

environment
Jenkins ver. 1.466.1 <br/>
Linux buildserver 2.6.18-164.11.1.el5PAE #1 SMP Wed Jan 6 13:43:57 EST 2010 i686 i686 i386 GNU/Linux

Activity

  1. jenkins-infra-bot commented on Sep 10, 2012

    @jenkins-infra-bot
    Author
    hagzag:
    • Original comment link
    • Raw content of original comment:

      Rotem thanks Our team is checking this issue.

    Rotem thanks
    Our team is checking this issue.

  2. jenkins-infra-bot commented on Sep 10, 2012

    @jenkins-infra-bot
    Author
    hagzag:
    • Original comment link
    • Raw content of original comment:

      Could you please assign this to someone ASAP - looks like a huge show stopper ...

    Could you please assign this to someone ASAP - looks like a huge show stopper ...

  3. jenkins-infra-bot commented on Nov 26, 2012

    @jenkins-infra-bot
    Author
    doronshai:
    • Original comment link
    • Raw content of original comment:

      This issue is a real pain since when using the MultiJob Plugin there is no real way to use the Parametrized Build Plugin and therefore passing parameters from MultiJob Phase to another MultiJob Phase is not possible.

    This issue is a real pain since when using the MultiJob Plugin there is no real way to use the Parametrized Build Plugin and therefore passing parameters from MultiJob Phase to another MultiJob Phase is not possible.

  4. jenkins-infra-bot commented on May 7, 2014

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      I see the issue after the failed logrotate procedure

    I see the issue after the failed logrotate procedure

  5. jenkins-infra-bot commented on May 7, 2014

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      The issue is inside the core

      • ParameterDefinition:createValue() can return null value according to Javadoc.
      • BuildCommand::run() creates a list of parameter values without null checks
      • hudson.model.ParametersAction.getAssignedLabel() iterates parameter values, but there is no null checks

      Any null parameter value in the task (e.g. in CLI call) may lead to the complete DoS of the service. Marked the issue as a blocker

    The issue is inside the core

    • ParameterDefinition:createValue() can return null value according to Javadoc.
    • BuildCommand::run() creates a list of parameter values without null checks
    • hudson.model.ParametersAction.getAssignedLabel() iterates parameter values, but there is no null checks

    Any null parameter value in the task (e.g. in CLI call) may lead to the complete DoS of the service. Marked the issue as a blocker

  6. jenkins-infra-bot commented on May 9, 2014

    @jenkins-infra-bot
    Author
    oleg_nenashev:

    In my case the issue has been caused by JENKINS-22925, but there're many other possible failure causes.
    Created a PR to the core: #1229

    I'll also investigate & re-submit the initial bug to another issue.

  7. jenkins-infra-bot commented on May 19, 2014

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      Updated the issue's description. Probably, workaround in jenkins-multijob-plugin would be useful as well

    Updated the issue's description. Probably, workaround in jenkins-multijob-plugin would be useful as well

  8. jenkins-infra-bot commented on May 19, 2014

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Oleg Nenashev Path: src/main/java/com/synopsys/arc/jenkinsci/plugins/customtools/versions/ToolVersionParameterDefinition.java src/test/java/com/cloudbees/jenkins/plugins/customtools/CustomToolInstallerTest.java src/test/java/com/synopsys/arc/jenkins/plugins/customtools/util/CLICommandInvoker.java src/test/java/com/synopsys/arc/jenkins/plugins/customtools/versions/ToolVersionParameterDefinitionTest.java http://jenkins-ci.org/commit/customtools-plugin/317adc58e636548e5f3619d74ce1fbed7ff95d3c Log: [FIXED JENKINS-22925] - Properly return default values to avoid JENKINS-15094

      Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

    Code changed in jenkins
    User: Oleg Nenashev
    Path:
    src/main/java/com/synopsys/arc/jenkinsci/plugins/customtools/versions/ToolVersionParameterDefinition.java
    src/test/java/com/cloudbees/jenkins/plugins/customtools/CustomToolInstallerTest.java
    src/test/java/com/synopsys/arc/jenkins/plugins/customtools/util/CLICommandInvoker.java
    src/test/java/com/synopsys/arc/jenkins/plugins/customtools/versions/ToolVersionParameterDefinitionTest.java
    http://jenkins-ci.org/commit/customtools-plugin/317adc58e636548e5f3619d74ce1fbed7ff95d3c
    Log:
    [FIXED JENKINS-22925] - Properly return default values to avoid JENKINS-15094

    Signed-off-by: Oleg Nenashev

  9. jenkins-infra-bot commented on Jun 1, 2014

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Oleg Nenashev
    Path:
    core/src/test/java/hudson/model/ParametersActionTest.java
    test/src/test/groovy/hudson/cli/BuildCommandTest.groovy
    http://jenkins-ci.org/commit/jenkins/cd23fac9950c1c0762731372df2c109d4bb80db3
    Log:
    JENKINS-15094 - Unit tests for the issue

    Signed-off-by: Oleg Nenashev

  10. jenkins-infra-bot commented on Jun 1, 2014

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/cli/BuildCommand.java core/src/main/java/hudson/model/ParameterDefinition.java core/src/main/java/hudson/model/ParametersAction.java core/src/main/java/hudson/model/ParametersDefinitionProperty.java http://jenkins-ci.org/commit/jenkins/7b894f57b78be0e4d847fe1c971955d2cbb08e58 Log: [FIXED JENKINS-15094] - Handle null parameter values in BuildCommand (CLI) and Parameter classes (CLI).

      The change adds missing checks for null ParameterValue, which may be passed from the CLI. It prevents the death of Jenkins executors during the canTake() check of node labels.

      Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

    Code changed in jenkins
    User: Oleg Nenashev
    Path:
    core/src/main/java/hudson/cli/BuildCommand.java
    core/src/main/java/hudson/model/ParameterDefinition.java
    core/src/main/java/hudson/model/ParametersAction.java
    core/src/main/java/hudson/model/ParametersDefinitionProperty.java
    http://jenkins-ci.org/commit/jenkins/7b894f57b78be0e4d847fe1c971955d2cbb08e58
    Log:
    [FIXED JENKINS-15094] - Handle null parameter values in BuildCommand (CLI) and Parameter classes (CLI).

    The change adds missing checks for null ParameterValue, which may be passed from the CLI.
    It prevents the death of Jenkins executors during the canTake() check of node labels.

    Signed-off-by: Oleg Nenashev

  11. jenkins-infra-bot commented on Jun 1, 2014

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Oliver Gondža Path: core/src/main/java/hudson/cli/BuildCommand.java core/src/main/java/hudson/model/ParameterDefinition.java core/src/main/java/hudson/model/ParametersAction.java core/src/main/java/hudson/model/ParametersDefinitionProperty.java core/src/test/java/hudson/model/ParametersActionTest.java test/src/test/groovy/hudson/cli/BuildCommandTest.groovy http://jenkins-ci.org/commit/jenkins/9402bd82cdafdde8b28a99c2cd6fede9409499a1 Log: Merge pull request #1229 from synopsys-arc-oss/CLI_null_ParameteValue

      [READY][FIXED JENKINS-15094] - Handle null parameter values to avoid massive executor deaths

    Code changed in jenkins
    User: Oliver Gondža
    Path:
    core/src/main/java/hudson/cli/BuildCommand.java
    core/src/main/java/hudson/model/ParameterDefinition.java
    core/src/main/java/hudson/model/ParametersAction.java
    core/src/main/java/hudson/model/ParametersDefinitionProperty.java
    core/src/test/java/hudson/model/ParametersActionTest.java
    test/src/test/groovy/hudson/cli/BuildCommandTest.groovy
    http://jenkins-ci.org/commit/jenkins/9402bd82cdafdde8b28a99c2cd6fede9409499a1
    Log:
    Merge pull request #1229 from synopsys-arc-oss/CLI_null_ParameteValue

    [READY][FIXED JENKINS-15094] - Handle null parameter values to avoid massive executor deaths

  12. jenkins-infra-bot commented on Jun 1, 2014

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      Marked the issue as lts-candidate

    Marked the issue as lts-candidate

  13. jenkins-infra-bot commented on Jun 1, 2014

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Oliver Gondža
    Path:
    changelog.html
    http://jenkins-ci.org/commit/jenkins/00292ff44c38a4d6c1423020f13f97e48efd7bad
    Log:
    Marking JENKINS-15094 major bug

  14. jenkins-infra-bot commented on Jun 1, 2014

    @jenkins-infra-bot
    Author
    dogfood:
    • Original comment link
    • Raw content of original comment:

      Integrated in jenkins_main_trunk #3425 JENKINS-15094 - Unit tests for the issue (Revision cd23fac9950c1c0762731372df2c109d4bb80db3) [FIXED JENKINS-15094] - Handle null parameter values in BuildCommand (CLI) and Parameter classes (CLI). (Revision 7b894f57b78be0e4d847fe1c971955d2cbb08e58)

      Result = SUCCESS o.v.nenashev : cd23fac9950c1c0762731372df2c109d4bb80db3 Files :

      • core/src/test/java/hudson/model/ParametersActionTest.java
      • test/src/test/groovy/hudson/cli/BuildCommandTest.groovy

      o.v.nenashev : 7b894f57b78be0e4d847fe1c971955d2cbb08e58 Files :

      • core/src/main/java/hudson/model/ParametersAction.java
      • core/src/main/java/hudson/cli/BuildCommand.java
      • core/src/main/java/hudson/model/ParametersDefinitionProperty.java
      • core/src/main/java/hudson/model/ParameterDefinition.java

    Integrated in jenkins_main_trunk #3425
    JENKINS-15094 - Unit tests for the issue (Revision cd23fac)
    [FIXED JENKINS-15094] - Handle null parameter values in BuildCommand (CLI) and Parameter classes (CLI). (Revision 7b894f5)

    Result = SUCCESS
    o.v.nenashev : cd23fac9950c1c0762731372df2c109d4bb80db3
    Files :

    • core/src/test/java/hudson/model/ParametersActionTest.java
    • test/src/test/groovy/hudson/cli/BuildCommandTest.groovy

    o.v.nenashev : 7b894f57b78be0e4d847fe1c971955d2cbb08e58
    Files :

    • core/src/main/java/hudson/model/ParametersAction.java
    • core/src/main/java/hudson/cli/BuildCommand.java
    • core/src/main/java/hudson/model/ParametersDefinitionProperty.java
    • core/src/main/java/hudson/model/ParameterDefinition.java
  15. jenkins-infra-bot commented on Jun 17, 2014

    @jenkins-infra-bot
    Author
    oleg_nenashev:

    For backporting:
    #1229

    Commits:

  16. jenkins-infra-bot commented on Jul 2, 2014

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Oleg Nenashev
    Path:
    core/src/test/java/hudson/model/ParametersActionTest.java
    test/src/test/groovy/hudson/cli/BuildCommandTest.groovy
    http://jenkins-ci.org/commit/jenkins/5cfcebf722ed027cb9dbbd1b5b3142196fc58161
    Log:
    JENKINS-15094 - Unit tests for the issue

    Signed-off-by: Oleg Nenashev
    (cherry picked from commit cd23fac)

  17. jenkins-infra-bot commented on Jul 2, 2014

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/cli/BuildCommand.java core/src/main/java/hudson/model/ParameterDefinition.java core/src/main/java/hudson/model/ParametersAction.java core/src/main/java/hudson/model/ParametersDefinitionProperty.java http://jenkins-ci.org/commit/jenkins/b6b94ea5e7a89068728c0a65e6323ca6991c7ddb Log: [FIXED JENKINS-15094] - Handle null parameter values in BuildCommand (CLI) and Parameter classes (CLI).

      The change adds missing checks for null ParameterValue, which may be passed from the CLI. It prevents the death of Jenkins executors during the canTake() check of node labels.

      Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com> (cherry picked from commit 7b894f57b78be0e4d847fe1c971955d2cbb08e58)

    Code changed in jenkins
    User: Oleg Nenashev
    Path:
    core/src/main/java/hudson/cli/BuildCommand.java
    core/src/main/java/hudson/model/ParameterDefinition.java
    core/src/main/java/hudson/model/ParametersAction.java
    core/src/main/java/hudson/model/ParametersDefinitionProperty.java
    http://jenkins-ci.org/commit/jenkins/b6b94ea5e7a89068728c0a65e6323ca6991c7ddb
    Log:
    [FIXED JENKINS-15094] - Handle null parameter values in BuildCommand (CLI) and Parameter classes (CLI).

    The change adds missing checks for null ParameterValue, which may be passed from the CLI.
    It prevents the death of Jenkins executors during the canTake() check of node labels.

    Signed-off-by: Oleg Nenashev
    (cherry picked from commit 7b894f5)

  18. jenkins-infra-bot commented on Nov 24, 2025

    @jenkins-infra-bot
    Author

    [Original relates_to from Jira: JENKINS-22925]

  19. jenkins-infra-bot commented on Nov 24, 2025

    @jenkins-infra-bot
    Author

    [Original relates_to from Jira: JENKINS-11541]

  20. jenkins-infra-bot commented on Nov 24, 2025

    @jenkins-infra-bot
    Author

    [Original relates_to from Jira: JENKINS-15036]

  21. removed
    bugFor changelog: Minor bug. Will be listed after features
    on Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions