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

NPE in cobertura publisher while cobertura is not configured anymore on the project

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None
    • Platform: All, OS: All

      I am not sure what exactly happened as I am not the one who played with hudson's
      config.

      I think someone tried to enable the cobertura plugin on a project, then removed
      it. Then the project stopped building with the following exception.

      [INFO] Trace
      java.lang.NullPointerException
      at
      hudson.plugins.cobertura.CoberturaProjectAction.<init>(CoberturaProjectAction.java:27)
      at
      hudson.plugins.cobertura.MavenCoberturaPublisher.getProjectAction(MavenCoberturaPublisher.java:198)
      at hudson.maven.MavenModule.addTransientActionsFromBuild(MavenModule.java:396)
      at hudson.maven.MavenModule.addTransientActionsFromBuild(MavenModule.java:68)
      at
      hudson.maven.AbstractMavenProject.updateTransientActions(AbstractMavenProject.java:57)
      at hudson.maven.MavenModuleSet.updateTransientActions(MavenModuleSet.java:179)
      at hudson.maven.MavenModuleSetBuild.notifyModuleBuild(MavenModuleSetBuild.java:288)
      at hudson.maven.MavenBuild$ProxyImpl2.end(MavenBuild.java:386)
      at sun.reflect.GeneratedMethodAccessor554.invoke(Unknown Source)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at
      hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:263)
      at
      hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:246)
      at
      hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:206)
      at hudson.remoting.UserRequest.perform(UserRequest.java:92)
      at hudson.remoting.UserRequest.perform(UserRequest.java:46)
      at hudson.remoting.Request$2.run(Request.java:236)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at
      java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)

      Looking at the configure page, cobertura wasn't enabled, so I restarted hudson.
      Now the project is missing and in the hudson console log, I can find:

      WARNING: Failed to load /home/hudson/.hudson/jobs/ABD-trunk
      java.lang.NullPointerException
      at
      hudson.plugins.cobertura.CoberturaProjectAction.<init>(CoberturaProjectAction.java:27)
      at
      hudson.plugins.cobertura.MavenCoberturaPublisher.getProjectAction(MavenCoberturaPublisher.java:198)
      at
      hudson.maven.MavenModule.addTransientActionsFromBuild(MavenModule.java:396)
      at
      hudson.maven.MavenModule.addTransientActionsFromBuild(MavenModule.java:68)
      at
      hudson.maven.AbstractMavenProject.updateTransientActions(AbstractMavenProject.java:57)
      at hudson.model.AbstractProject.onLoad(AbstractProject.java:199)
      at hudson.maven.MavenModule.onLoad(MavenModule.java:180)
      at hudson.model.Items.load(Items.java:110)
      at hudson.model.ItemGroupMixIn.loadChildren(ItemGroupMixIn.java:58)
      at hudson.maven.MavenModuleSet.onLoad(MavenModuleSet.java:356)
      at hudson.model.Items.load(Items.java:110)
      at hudson.model.Hudson.load(Hudson.java:1866)
      at hudson.model.Hudson.<init>(Hudson.java:519)
      at hudson.WebAppMain$2.run(WebAppMain.java:190)

      What's funny is that /home/hudson/.hudson/jobs/ABD-trunk/config.xml doesn't
      contain any reference to the cobertura plugin. Here is the publishers section:

      <publishers>
      <hudson.maven.RedeployPublisher>
      <id>snapshots</id>
      <url>http://deesse.bbc.no:8081/nexus/content/repositories/snapshots</url>
      <uniqueVersion>false</uniqueVersion>
      </hudson.maven.RedeployPublisher>
      <hudson.tasks.BuildTrigger>
      <childProjects>ABD-trunk-it</childProjects>
      <threshold>
      <name>SUCCESS</name>
      <ordinal>0</ordinal>
      <color>BLUE</color>
      </threshold>
      </hudson.tasks.BuildTrigger>
      </publishers>

      Another project does but this one loads properly.

      Filling issue with core as I feel the problem is more of hudson somewhat
      incorrectly dispatching the configs or maybe the project parameter, or something
      like that.

      Using hudson 1.291

          [JENKINS-3279] NPE in cobertura publisher while cobertura is not configured anymore on the project

          Alan Harder added a comment -

          try the cobertura 0.8.6-SNAPSHOT build attached to issue #2823

              • This issue has been marked as a duplicate of 2823 ***

          Alan Harder added a comment - try the cobertura 0.8.6-SNAPSHOT build attached to issue #2823 This issue has been marked as a duplicate of 2823 ***

          lacostej added a comment -

          Hei I filed the issue on hudson core, not on the plugin.

          For me hudson should be more resilient to such features. If a plugin is broken,
          even if I stop using it, my project disappears.

          Patch coming to make hudson more stable. Tested and both startup and build,
          where hudson will write in the console:

          WARNING: Failed to recover action from step:
          hudson.plugins.cobertura.MavenCoberturaPublisher@9c6fd8. Report issue to plugin
          developers.
          java.lang.NullPointerException
          at
          hudson.plugins.cobertura.CoberturaProjectAction.<init>(CoberturaProjectAction.java:27)
          at
          hudson.plugins.cobertura.MavenCoberturaPublisher.getProjectAction(MavenCoberturaPublisher.java:198)
          at hudson.maven.MavenModule.addTransientActionsFromBuild(MavenModule.java:400)
          at hudson.maven.MavenModule.addTransientActionsFromBuild(MavenModule.java:71)
          at
          hudson.maven.AbstractMavenProject.updateTransientActions(AbstractMavenProject.java:57)
          at hudson.maven.MavenModuleSet.updateTransientActions(MavenModuleSet.java:179)
          at hudson.maven.MavenModuleSetBuild.notifyModuleBuild(MavenModuleSetBuild.java:288)
          at hudson.maven.MavenBuild$ProxyImpl2.end(MavenBuild.java:386)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at
          sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at
          hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:263)
          at
          hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:246)
          at
          hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:206)
          at hudson.remoting.UserRequest.perform(UserRequest.java:92)
          at hudson.remoting.UserRequest.perform(UserRequest.java:46)
          at hudson.remoting.Request$2.run(Request.java:236)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at
          java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:619)

          lacostej added a comment - Hei I filed the issue on hudson core, not on the plugin. For me hudson should be more resilient to such features. If a plugin is broken, even if I stop using it, my project disappears. Patch coming to make hudson more stable. Tested and both startup and build, where hudson will write in the console: WARNING: Failed to recover action from step: hudson.plugins.cobertura.MavenCoberturaPublisher@9c6fd8. Report issue to plugin developers. java.lang.NullPointerException at hudson.plugins.cobertura.CoberturaProjectAction.<init>(CoberturaProjectAction.java:27) at hudson.plugins.cobertura.MavenCoberturaPublisher.getProjectAction(MavenCoberturaPublisher.java:198) at hudson.maven.MavenModule.addTransientActionsFromBuild(MavenModule.java:400) at hudson.maven.MavenModule.addTransientActionsFromBuild(MavenModule.java:71) at hudson.maven.AbstractMavenProject.updateTransientActions(AbstractMavenProject.java:57) at hudson.maven.MavenModuleSet.updateTransientActions(MavenModuleSet.java:179) at hudson.maven.MavenModuleSetBuild.notifyModuleBuild(MavenModuleSetBuild.java:288) at hudson.maven.MavenBuild$ProxyImpl2.end(MavenBuild.java:386) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:263) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:246) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:206) at hudson.remoting.UserRequest.perform(UserRequest.java:92) at hudson.remoting.UserRequest.perform(UserRequest.java:46) at hudson.remoting.Request$2.run(Request.java:236) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)

          lacostej added a comment -

          Created an attachment (id=613)
          Patch for the issue

          lacostej added a comment - Created an attachment (id=613) Patch for the issue

          lacostej added a comment -

          And I meant "resilient to such failures" earlier.

          lacostej added a comment - And I meant "resilient to such failures" earlier.

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenModule.java
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=24848
          Log:
          [FIXED JENKINS-3279] Make maven project more resilient to exceptions from plugins

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenModule.java trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=24848 Log: [FIXED JENKINS-3279] Make maven project more resilient to exceptions from plugins

            mindless Alan Harder
            lacostej lacostej
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: