• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core
    • Jenkins: 2.25
      Java: 1.8.0_72

      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.

          [JENKINS-39044] NPE thrown when firing upstream jobs

          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

          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

          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?

          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?

          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.

          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.

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

              Created:
              Updated: