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

NPE thrown when firing upstream jobs

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: core
    • Labels:
    • Environment:
      Jenkins: 2.25
      Java: 1.8.0_72
    • Similar Issues:

      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.

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment - - edited

          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

          Show
          oleg_nenashev Oleg Nenashev added a comment - - edited 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
          Hide
          oleg_nenashev Oleg Nenashev added a 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?

          Show
          oleg_nenashev Oleg Nenashev added a 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?
          Hide
          mdelaney Mike Delaney added a 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.

          Show
          mdelaney Mike Delaney added a 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.

            People

            • Assignee:
              Unassigned
              Reporter:
              mdelaney Mike Delaney
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: