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

NPE during Surefire execution of a Maven project without any tests

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Component/s: maven-plugin
    • Labels:
      None
    • Environment:
      Hudson 1.338, Solaris 10 SPARC, Sun JVM 1.6.0_16

      Description

      After upgrading Hudson to 1.338 we got an NPE while Surefire is executing a Maven project with no tests:

      [INFO] ------------------------------------------------------------------------
      [INFO] Building VK Backend: ZGS Mock Admin
      [INFO]    task-segment: [clean, install]
      [INFO] ------------------------------------------------------------------------
      [INFO] [clean:clean {execution: default-clean}]
      [INFO] [enforcer:enforce {execution: Enforcing build rules}]
      [INFO] [resources:resources {execution: default-resources}]
      [INFO] Using 'ISO-8859-1' encoding to copy filtered resources.
      [INFO] Copying 0 resource
      [INFO] [compiler:compile {execution: default-compile}]
      [INFO] Compiling 1 source file to /data/cibuild/hudson/slaves/slave1/workspace/VK-All-CI/trunk/backend/zgsmockadmin/target/classes
      [INFO] [resources:testResources {execution: default-testResources}]
      [INFO] Using 'ISO-8859-1' encoding to copy filtered resources.
      [INFO] Copying 0 resource
      [INFO] [compiler:testCompile {execution: default-testCompile}]
      [INFO] Nothing to compile - all classes are up to date
      [INFO] [surefire:test {execution: default-test}]
      [INFO] Surefire report directory: /data/cibuild/hudson/slaves/slave1/workspace/VK-All-CI/trunk/backend/zgsmockadmin/target/surefire-reports
      ERROR: Processing failed due to a bug in the code. Please report this to users@hudson.dev.java.net
      java.lang.NullPointerException
      	at hudson.model.listeners.RunListener.all(RunListener.java:167)
      	at hudson.model.listeners.RunListener.fireFinalized(RunListener.java:147)
      	at hudson.model.Run.onEndBuilding(Run.java:1301)
      	at hudson.model.Run.run(Run.java:1249)
      	at hudson.maven.MavenBuild.access$600(MavenBuild.java:71)
      	at hudson.maven.MavenBuild$ProxyImpl2.close(MavenBuild.java:453)
      	at hudson.maven.MavenModuleSetBuild$Builder.end(MavenModuleSetBuild.java:681)
      	at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:482)
      	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:417)
      	at hudson.model.Run.run(Run.java:1179)
      	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:304)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:122)
      FATAL: null
      java.lang.NullPointerException
      	at hudson.model.AbstractItem.getFullName(AbstractItem.java:126)
      	at hudson.model.AbstractItem.toString(AbstractItem.java:284)
      	at java.lang.String.valueOf(String.java:2826)
      	at java.lang.StringBuilder.append(StringBuilder.java:115)
      	at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:519)
      	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:417)
      	at hudson.model.Run.run(Run.java:1179)
      	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:304)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:122)
      

      We did no changes to the Hudson configuration. We can't see any related errors in any of Hudsons log files. So no OOM exceptions.

      The jobs MAVEN_OPTS are set to -Xmx1g -XX:MaxPermSize=128m and the jobs is always starting with an empty workspace.

      1. catalina.2011-07-28.log
        7 kB
        Brian Brooks
      2. catalina.2011-07-29.log
        7 kB
        Brian Brooks

        Activity

        Hide
        kohsuke Kohsuke Kawaguchi added a comment -

        NPE is happening in a seemingly impossible locations, such as Hudson.getInstance() returning null (RunListener.java:167.)

        Does this problem happen consistently?

        Show
        kohsuke Kohsuke Kawaguchi added a comment - NPE is happening in a seemingly impossible locations, such as Hudson.getInstance() returning null (RunListener.java:167.) Does this problem happen consistently?
        Hide
        tjuerge tjuerge added a comment -

        Does this problem happen consistently?

        No, this symptom didn't occur anymore.

        Show
        tjuerge tjuerge added a comment - Does this problem happen consistently? No, this symptom didn't occur anymore.
        Hide
        erikgb Erik Godding Boye added a comment -

        We got a similar problem (same stack trace, but on compile).
        Hudson version: 1.353

        [INFO] [compiler:compile {execution: default-compile}]
        [INFO] Compiling 2 source files to /var/lib/hudson/jobs/nav_trunk_int_esb_layers/workspace/layers/modules/cons/nav-cons-elsam-np-simulering/target/classes
        
        ERROR: Processing failed due to a bug in the code. Please report this to users@hudson.dev.java.net
        java.lang.NullPointerException
                at hudson.model.listeners.RunListener.all(RunListener.java:167)
                at hudson.model.listeners.RunListener.fireFinalized(RunListener.java:147)
                at hudson.model.Run.onEndBuilding(Run.java:1365)
                at hudson.model.Run.run(Run.java:1313)
                at hudson.maven.MavenBuild.access$600(MavenBuild.java:71)
                at hudson.maven.MavenBuild$ProxyImpl2.close(MavenBuild.java:453)
                at hudson.maven.MavenModuleSetBuild$Builder.end(MavenModuleSetBuild.java:681)
                at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:482)
                at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416)
                at hudson.model.Run.run(Run.java:1243)
                at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:304)
                at hudson.model.ResourceController.execute(ResourceController.java:88)
                at hudson.model.Executor.run(Executor.java:122)
        FATAL: null
        java.lang.NullPointerException
                at hudson.model.AbstractItem.getFullName(AbstractItem.java:127)
                at hudson.model.AbstractItem.toString(AbstractItem.java:284)
                at java.lang.String.valueOf(String.java:2826)
                at java.lang.StringBuilder.append(StringBuilder.java:115)
                at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:519)
                at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416)
                at hudson.model.Run.run(Run.java:1243)
                at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:304)
                at hudson.model.ResourceController.execute(ResourceController.java:88)
                at hudson.model.Executor.run(Executor.java:122) 
        
        Show
        erikgb Erik Godding Boye added a comment - We got a similar problem (same stack trace, but on compile). Hudson version: 1.353 [INFO] [compiler:compile {execution: default-compile}] [INFO] Compiling 2 source files to /var/lib/hudson/jobs/nav_trunk_int_esb_layers/workspace/layers/modules/cons/nav-cons-elsam-np-simulering/target/classes ERROR: Processing failed due to a bug in the code. Please report this to users@hudson.dev.java.net java.lang.NullPointerException at hudson.model.listeners.RunListener.all(RunListener.java:167) at hudson.model.listeners.RunListener.fireFinalized(RunListener.java:147) at hudson.model.Run.onEndBuilding(Run.java:1365) at hudson.model.Run.run(Run.java:1313) at hudson.maven.MavenBuild.access$600(MavenBuild.java:71) at hudson.maven.MavenBuild$ProxyImpl2.close(MavenBuild.java:453) at hudson.maven.MavenModuleSetBuild$Builder.end(MavenModuleSetBuild.java:681) at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:482) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416) at hudson.model.Run.run(Run.java:1243) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:304) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:122) FATAL: null java.lang.NullPointerException at hudson.model.AbstractItem.getFullName(AbstractItem.java:127) at hudson.model.AbstractItem.toString(AbstractItem.java:284) at java.lang.String.valueOf(String.java:2826) at java.lang.StringBuilder.append(StringBuilder.java:115) at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:519) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416) at hudson.model.Run.run(Run.java:1243) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:304) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:122)
        Hide
        evernat evernat added a comment -

        Hi erikgb,
        Have you reproduced this recently? If yes, which version?

        Show
        evernat evernat added a comment - Hi erikgb, Have you reproduced this recently? If yes, which version?
        Hide
        buzz3791 Brian Brooks added a comment - - edited

        We got the same error for the first time last night (1:00am-ish 7/29 Atlanta-time) with Hudson 1.346.

        We made one change yesterday (7/28). We have a nightly "maven2 project" job that has existed for a few years. The nightly job has a "Build Tiggers" configured with the "Build periodically" enabled "Schedule" is '30 20 * * *'. I'm trying to enable Sonar on this job. Originally I tried using the Sonar Hudson Plugin (packaged as an *.hpi but that failed miserably on our multi-module maven project).

        To workaround this issue, I came up with the idea to just launch a "free-style software project" job. So yesterday (7/28), I created the new free-style job that has only 1 build step a "Invoke top-level Maven targets" with the "Goals" is 'sonar:sonar'. I also configured this free-style job's "Build Triggers" by enabling "Build after other projects are built" and specified the nightly job I mentioned in the previous paragraph.

        This morning the Hudson dashboard shows:
        1. The free-style job has not run: "Last Success", "Last Failure", and "Last Duration" all contain N/A. The the free-style job's 'S' column is gray with the label 'Pending'.
        2. The nightly build did run successfully: "Last Success" 13hr, "Last Failure" N/A, and "Last Duration" 2hr11min.

        Jul 29, 2011 1:00:04 AM hudson.model.Executor run
        SEVERE: Executor throw an exception unexpectedly
        java.lang.NullPointerException
        at hudson.model.listeners.RunListener.all(RunListener.java:167)
        at hudson.model.listeners.RunListener.fireFinalized(RunListener.java:147)
        at hudson.model.Run.onEndBuilding(Run.java:1320)
        at hudson.model.Run.run(Run.java:1268)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
        at hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:122)

        I'll attach our catalina logs for further analysis.

        Show
        buzz3791 Brian Brooks added a comment - - edited We got the same error for the first time last night (1:00am-ish 7/29 Atlanta-time) with Hudson 1.346. We made one change yesterday (7/28). We have a nightly "maven2 project" job that has existed for a few years. The nightly job has a "Build Tiggers" configured with the "Build periodically" enabled "Schedule" is '30 20 * * *'. I'm trying to enable Sonar on this job. Originally I tried using the Sonar Hudson Plugin (packaged as an *.hpi but that failed miserably on our multi-module maven project). To workaround this issue, I came up with the idea to just launch a "free-style software project" job. So yesterday (7/28), I created the new free-style job that has only 1 build step a "Invoke top-level Maven targets" with the "Goals" is 'sonar:sonar'. I also configured this free-style job's "Build Triggers" by enabling "Build after other projects are built" and specified the nightly job I mentioned in the previous paragraph. This morning the Hudson dashboard shows: 1. The free-style job has not run: "Last Success", "Last Failure", and "Last Duration" all contain N/A. The the free-style job's 'S' column is gray with the label 'Pending'. 2. The nightly build did run successfully: "Last Success" 13hr, "Last Failure" N/A, and "Last Duration" 2hr11min. Jul 29, 2011 1:00:04 AM hudson.model.Executor run SEVERE: Executor throw an exception unexpectedly java.lang.NullPointerException at hudson.model.listeners.RunListener.all(RunListener.java:167) at hudson.model.listeners.RunListener.fireFinalized(RunListener.java:147) at hudson.model.Run.onEndBuilding(Run.java:1320) at hudson.model.Run.run(Run.java:1268) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:122) I'll attach our catalina logs for further analysis.
        Hide
        buzz3791 Brian Brooks added a comment -

        Shows nightly build that runs at 8:30pm Atlanta-time and finished around 10:30pm. I would've expected the 'free style' job to run around 10:30pm since the 2 projects are linked.

        Show
        buzz3791 Brian Brooks added a comment - Shows nightly build that runs at 8:30pm Atlanta-time and finished around 10:30pm. I would've expected the 'free style' job to run around 10:30pm since the 2 projects are linked.
        Hide
        buzz3791 Brian Brooks added a comment -

        Shows the NullPointerException...

        Nothing should've been running at 1AM. We have a disabled build that used to run at 1AM but if this 1AM job was the sole source of the problem, then I would've expected the same NullPointerException to appear in the catalina.2011-07-28.log.

        Jul 29, 2011 1:00:04 AM hudson.model.Executor run
        SEVERE: Executor throw an exception unexpectedly
        java.lang.NullPointerException
        at hudson.model.listeners.RunListener.all(RunListener.java:167)
        at hudson.model.listeners.RunListener.fireFinalized(RunListener.java:147)
        at hudson.model.Run.onEndBuilding(Run.java:1320)
        at hudson.model.Run.run(Run.java:1268)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
        at hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:122)

        Show
        buzz3791 Brian Brooks added a comment - Shows the NullPointerException... Nothing should've been running at 1AM. We have a disabled build that used to run at 1AM but if this 1AM job was the sole source of the problem, then I would've expected the same NullPointerException to appear in the catalina.2011-07-28.log. Jul 29, 2011 1:00:04 AM hudson.model.Executor run SEVERE: Executor throw an exception unexpectedly java.lang.NullPointerException at hudson.model.listeners.RunListener.all(RunListener.java:167) at hudson.model.listeners.RunListener.fireFinalized(RunListener.java:147) at hudson.model.Run.onEndBuilding(Run.java:1320) at hudson.model.Run.run(Run.java:1268) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:122)
        Hide
        kutzi kutzi added a comment -

        Can you reproduce this with a recent Jenkins version?

        Show
        kutzi kutzi added a comment - Can you reproduce this with a recent Jenkins version?
        Hide
        kutzi kutzi added a comment -

        No feedback from reporter => closing as not reproducable

        Show
        kutzi kutzi added a comment - No feedback from reporter => closing as not reproducable

          People

          • Assignee:
            kutzi kutzi
            Reporter:
            tjuerge tjuerge
          • Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: