• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • core
    • Jenkins 2.55

      I'm using the CLI to delete some jobs, and I've noticed that sometimes I receive a NullPointerException when deleting.

      java.lang.NullPointerException
      	at hudson.model.queue.Executables.getParentOf(Executables.java:44)
      	at hudson.model.AbstractItem.delete(AbstractItem.java:625)
      	at hudson.model.Job.delete(Job.java:669)
      	at hudson.cli.DeleteJobCommand.run(DeleteJobCommand.java:73)
      	at hudson.cli.CLICommand.main(CLICommand.java:274)
      	at org.jenkinsci.main.modules.sshd.CLICommandAdapter$1.run(CLICommandAdapter.java:37)
      	at org.jenkinsci.main.modules.sshd.AsynchronousCommand$1.run(AsynchronousCommand.java:112)
      	at java.lang.Thread.run(Thread.java:745)

      I only see this in Jenkins 2.55 and not 2.54 and judging by the stack trace, my guess is that the error is related to this change: https://github.com/jenkinsci/jenkins/commit/52a1a1035fa71a2e023e93c083a626898bcb0d47

       

          [JENKINS-43653] NullPointerException when deleting job

          Oleg Nenashev added a comment -

          Yes, this is a regression

          Oleg Nenashev added a comment - Yes, this is a regression

          Oleg Nenashev added a comment -

          Taking it in order to get the fix in 2.56

          Oleg Nenashev added a comment - Taking it in order to get the fix in 2.56

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/model/AbstractItem.java
          core/src/main/java/hudson/model/Executor.java
          core/src/main/java/hudson/model/queue/Executables.java
          core/src/main/java/hudson/model/queue/WorkUnit.java
          http://jenkins-ci.org/commit/jenkins/132ca7cffe9162b4b04bf52d2cf13a44c0f902e0
          Log:
          JENKINS-43653 - Ensure AbstractItem#delete() NPE safety when checking executors (#2854)

          • JENKINS-43653 - Ensure AbstractItem#delete() NPE and RTE safety when checking executors.

          This change adds missing NPE checks and also improves handling of Executables#getParentOf(), which may throw undocumented Runtime exceptions if Executable uses core API below 1.377 and does not implement getParent(). Executor#stop() has been also modified to explicitly handle the issue though there is still the same issue with estimated execution times.

          • JENKINS-43653 - Address comments from @jglick, restrict newly introduced API
          • JENKINS-43653 - Cleanup "unrelevant" changes to make @stephenc and @jglick happy

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/AbstractItem.java core/src/main/java/hudson/model/Executor.java core/src/main/java/hudson/model/queue/Executables.java core/src/main/java/hudson/model/queue/WorkUnit.java http://jenkins-ci.org/commit/jenkins/132ca7cffe9162b4b04bf52d2cf13a44c0f902e0 Log: JENKINS-43653 - Ensure AbstractItem#delete() NPE safety when checking executors (#2854) JENKINS-43653 - Ensure AbstractItem#delete() NPE and RTE safety when checking executors. This change adds missing NPE checks and also improves handling of Executables#getParentOf(), which may throw undocumented Runtime exceptions if Executable uses core API below 1.377 and does not implement getParent(). Executor#stop() has been also modified to explicitly handle the issue though there is still the same issue with estimated execution times. JENKINS-43653 - Address comments from @jglick, restrict newly introduced API JENKINS-43653 - Address comments from @stephenc JENKINS-43653 - Cleanup "unrelevant" changes to make @stephenc and @jglick happy JENKINS-43653 - Cleanup the leftover JENKINS-43653 - Drop the changes in Executables

          Oleg Nenashev added a comment -

          The fix has been integrated towards 2.56

          Oleg Nenashev added a comment - The fix has been integrated towards 2.56

            oleg_nenashev Oleg Nenashev
            krische Brian Krische
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: