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

When a job hits 'Max # of builds to keep' Nunit Publisher starts to throw NPE

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • junit-plugin, nunit-plugin
    • Ubuntu Wheezy x86_64. Jenkins 1.499 (and on previous 1.496,497,498 possibly earlier)

      It seems as though jenkins somehow gets in a situation where at the end of running a job, at the point of trying to publish nunit results it throws an NPE, of the form:

      ERROR: Publisher hudson.plugins.nunit.NUnitPublisher aborted due to exception
      java.lang.NullPointerException
      at hudson.model.Run.getRootDir(Run.java:927)
      at hudson.tasks.junit.TestResultAction.getDataFile(TestResultAction.java:91)
      at hudson.tasks.junit.TestResultAction.load(TestResultAction.java:147)
      at hudson.tasks.junit.TestResultAction.getResult(TestResultAction.java:97)
      at hudson.tasks.junit.TestResultAction.getResult(TestResultAction.java:55)
      at hudson.tasks.test.AbstractTestResultAction.findCorrespondingResult(AbstractTestResultAction.java:183)
      at hudson.tasks.test.TestResult.getPreviousResult(TestResult.java:145)
      at hudson.tasks.junit.SuiteResult.getPreviousResult(SuiteResult.java:296)
      at hudson.tasks.junit.CaseResult.getPreviousResult(CaseResult.java:375)
      at hudson.tasks.junit.CaseResult.freeze(CaseResult.java:486)
      at hudson.tasks.junit.SuiteResult.freeze(SuiteResult.java:338)
      at hudson.tasks.junit.TestResult.freeze(TestResult.java:564)
      at hudson.tasks.junit.TestResultAction.setResult(TestResultAction.java:74)
      at hudson.tasks.junit.TestResultAction.<init>(TestResultAction.java:67)
      at hudson.plugins.nunit.NUnitPublisher.recordTestResult(NUnitPublisher.java:150)
      at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:109)
      at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:810)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:785)
      at hudson.model.Build$BuildExecution.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:732)
      at hudson.model.Run.execute(Run.java:1568)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:236)

      Once this starts happening it continues to happen for every build for that particular job. A restart does not stop this behaviour from happening. We noted a while back that deleting the build history from the filesystem for this job does allow it carry on successfully, until such time as the error appears again.

      Very recently a team member noted that the number of builds in the history for that job was equal to (or thereabouts [most recent #405 oldest #306) to the value stored in the configuration setting 'Max # of builds to keep' (in our case 100). This could be a co-incidence, and I've upped the setting to 200 to see if builds start working again (but this takes ~6 hours to reach the failing job), but it does look like a smoking gun

      I had hoped that it would be related to https://issues.jenkins-ci.org/browse/JENKINS-16194 but having upgraded to the latest version we still see this issue.

      I'm mostly logging this in case others are seeing it

          [JENKINS-16449] When a job hits 'Max # of builds to keep' Nunit Publisher starts to throw NPE

          ciaranj created issue -
          ciaranj made changes -
          Description Original: It seems as though jenkins somehow gets in a situation where at the end of running a job, at the point of trying to publish nunit results it throws an NPE, of the form:

          ERROR: Publisher hudson.plugins.nunit.NUnitPublisher aborted due to exception
          java.lang.NullPointerException
          at hudson.model.Run.getRootDir(Run.java:927)
          at hudson.tasks.junit.TestResultAction.getDataFile(TestResultAction.java:91)
          at hudson.tasks.junit.TestResultAction.load(TestResultAction.java:147)
          at hudson.tasks.junit.TestResultAction.getResult(TestResultAction.java:97)
          at hudson.tasks.junit.TestResultAction.getResult(TestResultAction.java:55)
          at hudson.tasks.test.AbstractTestResultAction.findCorrespondingResult(AbstractTestResultAction.java:183)
          at hudson.tasks.test.TestResult.getPreviousResult(TestResult.java:145)
          at hudson.tasks.junit.SuiteResult.getPreviousResult(SuiteResult.java:296)
          at hudson.tasks.junit.CaseResult.getPreviousResult(CaseResult.java:375)
          at hudson.tasks.junit.CaseResult.freeze(CaseResult.java:486)
          at hudson.tasks.junit.SuiteResult.freeze(SuiteResult.java:338)
          at hudson.tasks.junit.TestResult.freeze(TestResult.java:564)
          at hudson.tasks.junit.TestResultAction.setResult(TestResultAction.java:74)
          at hudson.tasks.junit.TestResultAction.<init>(TestResultAction.java:67)
          at hudson.plugins.nunit.NUnitPublisher.recordTestResult(NUnitPublisher.java:150)
          at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:109)
          at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:810)
          at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:785)
          at hudson.model.Build$BuildExecution.post2(Build.java:183)
          at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:732)
          at hudson.model.Run.execute(Run.java:1568)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:236)

          Once this starts happening it continues to happen for every build for that particular job. A restart does not stop this behaviour from happening. We noted a while back that deleting the build history from the filesystem for this job does allow it carry on successfully, until such time as the error appears again.

          Very recently a team member noted that the number of builds in the history for that job was equal to (or thereabouts) to the value stored in the configuration setting 'Max # of builds to keep' (in our case 100). This could be a co-incidence, and I've upped the setting to 200 to see if builds start working again (but this takes ~6 hours to reach the failing job), but it does look like a smoking gun :)

          I had hoped that it would be related to [https://issues.jenkins-ci.org/browse/JENKINS-16194] but having upgraded to the latest version we still see this issue.

          I'm mostly logging this in case others are seeing it ;)




          New: It seems as though jenkins somehow gets in a situation where at the end of running a job, at the point of trying to publish nunit results it throws an NPE, of the form:

          ERROR: Publisher hudson.plugins.nunit.NUnitPublisher aborted due to exception
          java.lang.NullPointerException
          at hudson.model.Run.getRootDir(Run.java:927)
          at hudson.tasks.junit.TestResultAction.getDataFile(TestResultAction.java:91)
          at hudson.tasks.junit.TestResultAction.load(TestResultAction.java:147)
          at hudson.tasks.junit.TestResultAction.getResult(TestResultAction.java:97)
          at hudson.tasks.junit.TestResultAction.getResult(TestResultAction.java:55)
          at hudson.tasks.test.AbstractTestResultAction.findCorrespondingResult(AbstractTestResultAction.java:183)
          at hudson.tasks.test.TestResult.getPreviousResult(TestResult.java:145)
          at hudson.tasks.junit.SuiteResult.getPreviousResult(SuiteResult.java:296)
          at hudson.tasks.junit.CaseResult.getPreviousResult(CaseResult.java:375)
          at hudson.tasks.junit.CaseResult.freeze(CaseResult.java:486)
          at hudson.tasks.junit.SuiteResult.freeze(SuiteResult.java:338)
          at hudson.tasks.junit.TestResult.freeze(TestResult.java:564)
          at hudson.tasks.junit.TestResultAction.setResult(TestResultAction.java:74)
          at hudson.tasks.junit.TestResultAction.<init>(TestResultAction.java:67)
          at hudson.plugins.nunit.NUnitPublisher.recordTestResult(NUnitPublisher.java:150)
          at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:109)
          at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:810)
          at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:785)
          at hudson.model.Build$BuildExecution.post2(Build.java:183)
          at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:732)
          at hudson.model.Run.execute(Run.java:1568)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:236)

          Once this starts happening it continues to happen for every build for that particular job. A restart does not stop this behaviour from happening. We noted a while back that deleting the build history from the filesystem for this job does allow it carry on successfully, until such time as the error appears again.

          Very recently a team member noted that the number of builds in the history for that job was equal to (or thereabouts [most recent #405 oldest #306) to the value stored in the configuration setting 'Max # of builds to keep' (in our case 100). This could be a co-incidence, and I've upped the setting to 200 to see if builds start working again (but this takes ~6 hours to reach the failing job), but it does look like a smoking gun :)

          I had hoped that it would be related to [https://issues.jenkins-ci.org/browse/JENKINS-16194] but having upgraded to the latest version we still see this issue.

          I'm mostly logging this in case others are seeing it ;)




          Ivan Boyko made changes -
          Assignee Original: redsolo [ redsolo ] New: Ivan Boyko [ boiky ]
          Ivan Boyko made changes -
          Assignee Original: Ivan Boyko [ boiky ] New: redsolo [ redsolo ]
          Bruno P. Kinoshita made changes -
          Assignee Original: redsolo [ redsolo ] New: Bruno P. Kinoshita [ kinow ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 147271 ] New: JNJira + In-Review [ 176856 ]
          Alex Earl made changes -
          Assignee Original: Bruno P. Kinoshita [ kinow ] New: Alex Earl [ slide_o_mix ]
          Ulli Hafner made changes -
          Link New: This issue is duplicated by JENKINS-45846 [ JENKINS-45846 ]
          Christian Häussler made changes -
          Labels New: NPE
          Alex Earl made changes -
          Resolution New: Cannot Reproduce [ 5 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

            slide_o_mix Alex Earl
            ciaranj ciaranj
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: