Skip to content

[JENKINS-23526] java.lang.NullPointerException when archive the artifacts as a conditional step (single or multiple) #23210

Closed

Description

@jenkins-infra-bot

Have following config (see attached )

Build fails with following log:

Run condition [Always] enabling perform for step [Archive the artifacts]
FATAL: null
java.lang.NullPointerException
at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:143)
at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:110)
at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:154)
at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105)
at org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder.perform(SingleConditionalBuilder.java:108)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:772)
at hudson.model.Build$BuildExecution.build(Build.java:199)
at hudson.model.Build$BuildExecution.doRun(Build.java:160)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:535)
at hudson.model.Run.execute(Run.java:1732)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:234)

I have also found that issue was introduced int Jenkins v. 1.567


Originally reported by a_eroma, imported from: java.lang.NullPointerException when archive the artifacts as a conditional step (single or multiple)
  • assignee: danielbeck
  • status: Resolved
  • priority: Critical
  • component(s): core
  • label(s): artifact, npe
  • resolution: Fixed
  • resolved: 2014-06-22T21:14:18+00:00
  • votes: 0
  • watchers: 4
  • imported: 2025-11-24
Raw content of original issue

Have following config (see attached )

Build fails with following log:

Run condition [Always] enabling perform for step [Archive the artifacts] FATAL: null java.lang.NullPointerException at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:143) at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:110) at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:154) at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105) at org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder.perform(SingleConditionalBuilder.java:108) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:772) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:535) at hudson.model.Run.execute(Run.java:1732) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:234)

I have also found that issue was introduced int Jenkins v. 1.567

environment
Reproduces on linux/mac/windows environment.<br/>
Reproduces on both: mastres and slaves.<br/>
Jenkins version: 1.568
1 attachment

Activity

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

    @jenkins-infra-bot
    Author
    • Remote link associated with this issue:

  2. jenkins-infra-bot commented on Jun 21, 2014

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

      The issue has been introduced by 6df89e3

      Reassigned it to Daniel Beck.

    The issue has been introduced by 6df89e3

    Reassigned it to Daniel Beck.

  3. jenkins-infra-bot commented on Jun 21, 2014

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

      Not a core bug: When publishers are run, the build already has a result.

      Except when using plugins that mess this up… ffs…

    Not a core bug: When publishers are run, the build already has a result.

    Except when using plugins that mess this up… ffs…

  4. jenkins-infra-bot commented on Jun 21, 2014

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

      I wonder whether changing build.getResult() to return SUCCESS if it's still null would be best.

    I wonder whether changing build.getResult() to return SUCCESS if it's still null would be best.

  5. jenkins-infra-bot commented on Jun 21, 2014

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

      BTW, the change breaks the original behavior even it was incorrect. My users also use Artifacts publishers within build steps, hence it could be a popular use-case.

      What about adding additional check for this case? If <code>onlyIfSuccessful==true</code>, then you can just skip the uploading

    BTW, the change breaks the original behavior even it was incorrect.
    My users also use Artifacts publishers within build steps, hence it could be a popular use-case.

    What about adding additional check for this case?
    If onlyIfSuccessful==true, then you can just skip the uploading

  6. jenkins-infra-bot commented on Jun 22, 2014

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Daniel Beck
    Path:
    core/src/main/java/hudson/tasks/ArtifactArchiver.java
    http://jenkins-ci.org/commit/jenkins/e2cebef67b20bea9b7f3653f649481a99f049f48
    Log:
    [FIXED JENKINS-23526] Tolerate 'null' result when used creatively

  7. jenkins-infra-bot commented on Jun 22, 2014

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Oleg Nenashev
    Path:
    core/src/main/java/hudson/tasks/ArtifactArchiver.java
    http://jenkins-ci.org/commit/jenkins/8aeb7bf9cf9a4fea695364047823526da512c247
    Log:
    Merge pull request #1296 from daniel-beck/JENKINS-23526

    [FIXED JENKINS-23526] Tolerate 'null' result when used creatively

    Compare: 1aec030...8aeb7bf

  8. jenkins-infra-bot commented on Jun 22, 2014

    @jenkins-infra-bot
    Author
    dogfood:

    Integrated in jenkins_main_trunk #3478
    [FIXED JENKINS-23526] Tolerate 'null' result when used creatively (Revision e2cebef)

    Result = SUCCESS
    daniel-beck : e2cebef67b20bea9b7f3653f649481a99f049f48
    Files :

    • core/src/main/java/hudson/tasks/ArtifactArchiver.java
  9. jenkins-infra-bot commented on Jun 30, 2014

    @jenkins-infra-bot
    Author
    danielbeck:

    LTS candidate only if JENKINS-22699 is also included.

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

    @jenkins-infra-bot
    Author
    oleg_nenashev:

    JENKINS-22699 is a new feature. I suppose it won't be backported

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

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

      Depends on whether 1.565 or 1.567 gets to be the baseline.

    Depends on whether 1.565 or 1.567 gets to be the baseline.

  12. jenkins-infra-bot commented on Jul 3, 2014

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

      1.565.x it is.

    1.565.x it is.

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

    @jenkins-infra-bot
    Author

    [Original relates_to from Jira: JENKINS-22699]

  14. 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