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

RunList returning null from its elements in 1.485

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • Ubuntu Linux 2.6 Server x86 GNU/Linux

      Kohsuke's updated summary

      In 1.485, there's a bug that causes Jenkins to return null when someone is listing historical build records. The caller is not expecting null return value, so this normally results in NullPointerException.

      Because there are numerous code inside Jenkins that touches build history, such NullPointerException can occur in a large number of different places.

      If you are not sure your NullPointerException is just another manifestation of this bug or an unrelated bug, please feel free to file a separate ticket, and mention this ticket as a possible cause so that the plugin developers won't get confused.

      Original bug report

      running the build fails with the following error:

      ERROR: Processing failed due to a bug in the code. Please report this to jenkinsci-users@googlegroups.com
      java.lang.NullPointerException
      at hudson.tasks.LogRotator.perform(LogRotator.java:119)
      at hudson.model.Job.logRotate(Job.java:338)
      at hudson.model.Run.execute(Run.java:1581)
      at hudson.maven.MavenBuild.access$600(MavenBuild.java:83)
      at hudson.maven.MavenBuild$ProxyImpl2.close(MavenBuild.java:545)
      at hudson.maven.AbstractMavenBuilder.end(AbstractMavenBuilder.java:106)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:794)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:589)
      at hudson.model.Run.execute(Run.java:1516)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:236)
      project=hudson.maven.MavenModuleSet@280d8b87[deploy sdk]

          [JENKINS-15465] RunList returning null from its elements in 1.485

          Phumzile Saleni created issue -

          Kjetil Måge added a comment -

          We're facing the same issue after upgrading to 1.485. Seems like all our builds now fail with this error.

          Kjetil Måge added a comment - We're facing the same issue after upgrading to 1.485. Seems like all our builds now fail with this error.
          Phumzile Saleni made changes -
          Summary Original: Running a maven build on jenkins gives the following log and fails the build NB: htis build was assing before the latest update New: Running a maven build on jenkins gives the following log and fails the build NB: this build was working before the latest update

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          core/src/main/java/hudson/model/RunMap.java
          core/src/main/java/hudson/util/RunList.java
          http://jenkins-ci.org/commit/jenkins/807dc7174cd8ed4ec3cb9562f1c3f90f4035cf33
          Log:
          JENKINS-15465 tweaking subList implementation and iterator.

          I can't really think of how null ends up in the resulting list, but adding a check in Iterator to detect that situation.

          Also, improved the efficiency of the subList implementation.

          Compare: https://github.com/jenkinsci/jenkins/compare/35eadbcf6e96...807dc7174cd8

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: core/src/main/java/hudson/model/RunMap.java core/src/main/java/hudson/util/RunList.java http://jenkins-ci.org/commit/jenkins/807dc7174cd8ed4ec3cb9562f1c3f90f4035cf33 Log: JENKINS-15465 tweaking subList implementation and iterator. I can't really think of how null ends up in the resulting list, but adding a check in Iterator to detect that situation. Also, improved the efficiency of the subList implementation. Compare: https://github.com/jenkinsci/jenkins/compare/35eadbcf6e96...807dc7174cd8

          Updating the title to better represent what this is about.

          Kohsuke Kawaguchi added a comment - Updating the title to better represent what this is about.
          Kohsuke Kawaguchi made changes -
          Assignee New: Kohsuke Kawaguchi [ kohsuke ]
          Summary Original: Running a maven build on jenkins gives the following log and fails the build NB: this build was working before the latest update New: RunList returning null from its elements in 1.485

          narve saetre added a comment -

          Excellent - thanks! I just finished compiling Jenkins, in an attempt to fix it myself.

          Will there be a release soon, considering that this is a showstopper for many, or should people needing it right away compile their own version? Since this is an bundled plugin, updating jenkins.war should be enough I guess?

          (The RC-link http://mirrors.jenkins-ci.org/war-rc/latest/jenkins.war currently shows 404)

          narve saetre added a comment - Excellent - thanks! I just finished compiling Jenkins, in an attempt to fix it myself. Will there be a release soon, considering that this is a showstopper for many, or should people needing it right away compile their own version? Since this is an bundled plugin, updating jenkins.war should be enough I guess? (The RC-link http://mirrors.jenkins-ci.org/war-rc/latest/jenkins.war currently shows 404)

          dogfood added a comment -

          Integrated in jenkins_main_trunk #1987
          JENKINS-15465 tweaking subList implementation and iterator. (Revision 807dc7174cd8ed4ec3cb9562f1c3f90f4035cf33)

          Result = UNSTABLE
          kohsuke : 807dc7174cd8ed4ec3cb9562f1c3f90f4035cf33
          Files :

          • core/src/main/java/hudson/util/RunList.java
          • core/src/main/java/hudson/model/RunMap.java

          dogfood added a comment - Integrated in jenkins_main_trunk #1987 JENKINS-15465 tweaking subList implementation and iterator. (Revision 807dc7174cd8ed4ec3cb9562f1c3f90f4035cf33) Result = UNSTABLE kohsuke : 807dc7174cd8ed4ec3cb9562f1c3f90f4035cf33 Files : core/src/main/java/hudson/util/RunList.java core/src/main/java/hudson/model/RunMap.java
          Kohsuke Kawaguchi made changes -
          Component/s New: core [ 15593 ]
          Component/s Original: maven [ 16033 ]

          Those who are seeing this issue, can you please try build #1987 or later and report what happens?

          This is a very critical bug that I'd like to fix quickly, so I really appreciate everyone's help.

          Kohsuke Kawaguchi added a comment - Those who are seeing this issue, can you please try build #1987 or later and report what happens? This is a very critical bug that I'd like to fix quickly, so I really appreciate everyone's help.

            kohsuke Kohsuke Kawaguchi
            thasaleni Phumzile Saleni
            Votes:
            4 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved: