• Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • Jenkins 2.32.3, Pipeline Milestone Step plug-in 1.3

      Hi,

       

      When deleting a job programmatically, a non pipeline job, we have a NPE:

       

      Mar 10, 2017 4:23:21 PM hudson.model.listeners.ItemListener forAll
      WARNING: failed to send event to listener of class org.jenkinsci.plugins.pipeline.milestone.MilestoneStepExecution$CleanupJobsOnDelete
      java.lang.NullPointerException
      at org.jenkinsci.plugins.pipeline.milestone.MilestoneStepExecution$CleanupJobsOnDelete.onDeleted(MilestoneStepExecution.java:348)
      at hudson.model.listeners.ItemListener$4.apply(ItemListener.java:205)
      at hudson.model.listeners.ItemListener$4.apply(ItemListener.java:203)
      at hudson.model.listeners.ItemListener.forAll(ItemListener.java:167)
      at hudson.model.listeners.ItemListener.fireOnDeleted(ItemListener.java:203)
      at jenkins.model.Jenkins.onDeleted(Jenkins.java:2918)
      at jenkins.model.Jenkins.onDeleted(Jenkins.java:324)
      at hudson.model.AbstractItem.delete(AbstractItem.java:572)
      at hudson.model.Job.delete(Job.java:683)

       

      The getMilestonesByOrdinalByJob() method might return null and should be checked against this.

       

      Best regards,

      Damien.

          [JENKINS-42673] NPE when deleting a job

          Hi,

          I've created the https://github.com/jenkinsci/pipeline-milestone-step-plugin/pull/11 PR to fix this issue.

          A bit more context: this happens at Jenkins startup. We have some Groovy scripts in init.groovy.d which delete and recreate some basic infrastructure jobs. The NPE appeared on deletion after we had installed all the pipeline plug-ins, including the milestone one.

           

          Best regards,

          Damien.

          Damien Coraboeuf added a comment - Hi, I've created the https://github.com/jenkinsci/pipeline-milestone-step-plugin/pull/11  PR to fix this issue. A bit more context: this happens at Jenkins startup. We have some Groovy scripts in init.groovy.d which delete and recreate some basic infrastructure jobs. The NPE appeared on deletion after we had installed all the pipeline plug-ins, including the milestone one.   Best regards, Damien.

            amuniz Antonio Muñiz
            damien_coraboeuf Damien Coraboeuf
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: