Repository navigation
[JENKINS-39044] NPE thrown when firing upstream jobs #17611
Copy link
Copy link
Description
I've run into an issue where, when trying to trigger a pipeline job from a freestyle (classic), I'm seeing a NPE in the jenkins log. This happens when the pipeline job is an upstream of a freestyle job; and trying to watch for new builds of the freestyle.
The full stack trace is:
WARNING: RunListener failed java.lang.NullPointerException at hudson.model.Result.isBetterOrEqualTo(Result.java:130) at jenkins.triggers.ReverseBuildTrigger.shouldTrigger(ReverseBuildTrigger.java:139) at jenkins.triggers.ReverseBuildTrigger.access$000(ReverseBuildTrigger.java:89) at jenkins.triggers.ReverseBuildTrigger$RunListenerImpl.onCompleted(ReverseBuildTrigger.java:258) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:214) at hudson.model.Run.execute(Run.java:1765) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:401)
This is preventing the upstream job from getting triggered.
Originally reported by mdelaney, imported from: NPE thrown when firing upstream jobs
- status: Open
- priority: Major
- component(s): core
- label(s): newbie-friendly
- resolution: Unresolved
- votes: 0
- watchers: 3
- imported: 2025-11-24
Raw content of original issue
I've run into an issue where, when trying to trigger a pipeline job from a freestyle (classic), I'm seeing a NPE in the jenkins log. This happens when the pipeline job is an upstream of a freestyle job; and trying to watch for new builds of the freestyle.
The full stack trace is:
WARNING: RunListener failed java.lang.NullPointerException at hudson.model.Result.isBetterOrEqualTo(Result.java:130) at jenkins.triggers.ReverseBuildTrigger.shouldTrigger(ReverseBuildTrigger.java:139) at jenkins.triggers.ReverseBuildTrigger.access$000(ReverseBuildTrigger.java:89) at jenkins.triggers.ReverseBuildTrigger$RunListenerImpl.onCompleted(ReverseBuildTrigger.java:258) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:214) at hudson.model.Run.execute(Run.java:1765) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:401)This is preventing the upstream job from getting triggered.
environment
Jenkins: 2.25<br/>
Java: 1.8.0_72
2 attachments
Reactions are currently unavailable
Activity
jenkins-infra-bot commentedon Nov 10, 2016
Raw content of original comment:
Jenkins API explicitly prohibits passing null: https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Result.java#L129-L131. Hence there is a bug in the core
jenkins-infra-bot commentedon Nov 10, 2016
Raw content of original comment:
On the other hand, https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/jenkins/triggers/ReverseBuildTrigger.java#L139 assumes that threshold is somehow not specified in your job
Please provide your job configuration. Do you also use any Job Generators to create such config?
jenkins-infra-bot commentedon Nov 12, 2016
mdelaney:
Raw content of original comment:
The attached files sample-classic.xml
and sample-pipeline.xml
cause the N.P.E. I do not have generators, I created these by hand.
Add reverse trigger NPE detection attempt