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

NullPointerException when requesting "Open Tasks Trend" image

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Won't Fix
    • tasks-plugin
    • None
    • Hudson 1.359 / Static Analysis Collector Plug-in 1.5 / Static Analysis Utilities 1.8 / Task Scanner Plug-in 4.7

    Description

      I configured one of my job to use the Task Scanner Plugin. It was working fine.
      Today I upgraded Hudson and the plugin to their latest version and I have a issue.

      1) If I create a new job and configure it to use the plugin, it works fine.

      2) For old jobs, the "Open Tasks Trend" image does not work anymore. When I try to load the image I get a java.lang.NullPointerException in hudson.plugins.analysis.graph.CategoryBuildResultGraph.createSeriesPerBuild(CategoryBuildResultGraph.java:154)

      Attachments

        1. data.zip
          8 kB
        2. data2.zip
          76 kB
        3. data3.zip
          5 kB

        Activity

          bcoppens bcoppens created issue -
          drulli Ulli Hafner added a comment - - edited

          Stacktrace:

          java.lang.NullPointerException
          
          	hudson.plugins.analysis.graph.CategoryBuildResultGraph.createSeriesPerBuild(CategoryBuildResultGraph.java:154)
          
          	hudson.plugins.analysis.graph.CategoryBuildResultGraph.createChart(CategoryBuildResultGraph.java:131)
          
          	hudson.plugins.analysis.graph.CategoryBuildResultGraph.create(CategoryBuildResultGraph.java:58)
          
          	hudson.plugins.analysis.graph.BuildResultGraph$1.createGraph(BuildResultGraph.java:206)
          
          	hudson.util.Graph.render(Graph.java:87)
          
          	hudson.util.Graph.doPng(Graph.java:98)
          
          	sun.reflect.GeneratedMethodAccessor296.invoke(Unknown Source)
          
          	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          
          	java.lang.reflect.Method.invoke(Method.java:597)
          
          	org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:235)
          
          	org.kohsuke.stapler.Function.bindAndInvoke(Function.java:116)
          
          	org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:57)
          
          	org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:75)
          
          	org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
          
          	org.kohsuke.stapler.Stapler.invoke(Stapler.java:525)
          
          	org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:145)
          
          	org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
          
          	org.kohsuke.stapler.Stapler.invoke(Stapler.java:525)
          
          	org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:319)
          
          	org.kohsuke.stapler.Stapler.invoke(Stapler.java:525)
          
          	org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:181)
          
          	org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
          
          	org.kohsuke.stapler.Stapler.invoke(Stapler.java:525)
          
          	org.kohsuke.stapler.Stapler.invoke(Stapler.java:441)
          
          	org.kohsuke.stapler.Stapler.service(Stapler.java:123)
          
          	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
          
          	hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94)
          
          	hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86)
          
          	hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
          
          	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
          
          	hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
          
          	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
          
          	org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
          
          	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
          
          	org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
          
          	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
          
          	org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
          
          	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
          
          	org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
          
          	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
          
          	org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
          
          	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
          
          	org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
          
          	hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
          
          	hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
          
          	hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
          
          	hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
          
          
          drulli Ulli Hafner added a comment - - edited Stacktrace: java.lang.NullPointerException hudson.plugins.analysis.graph.CategoryBuildResultGraph.createSeriesPerBuild(CategoryBuildResultGraph.java:154) hudson.plugins.analysis.graph.CategoryBuildResultGraph.createChart(CategoryBuildResultGraph.java:131) hudson.plugins.analysis.graph.CategoryBuildResultGraph.create(CategoryBuildResultGraph.java:58) hudson.plugins.analysis.graph.BuildResultGraph$1.createGraph(BuildResultGraph.java:206) hudson.util.Graph.render(Graph.java:87) hudson.util.Graph.doPng(Graph.java:98) sun.reflect.GeneratedMethodAccessor296.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:235) org.kohsuke.stapler.Function.bindAndInvoke(Function.java:116) org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:57) org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:75) org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30) org.kohsuke.stapler.Stapler.invoke(Stapler.java:525) org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:145) org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30) org.kohsuke.stapler.Stapler.invoke(Stapler.java:525) org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:319) org.kohsuke.stapler.Stapler.invoke(Stapler.java:525) org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:181) org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30) org.kohsuke.stapler.Stapler.invoke(Stapler.java:525) org.kohsuke.stapler.Stapler.invoke(Stapler.java:441) org.kohsuke.stapler.Stapler.service(Stapler.java:123) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94) hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86) hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47) hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51) hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166) hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173) hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66) hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
          drulli Ulli Hafner added a comment -

          How many builds with tasks results does the job contain? Which trend graph type is selected? Is the trend graph on the job page or on the dashboard view?

          drulli Ulli Hafner added a comment - How many builds with tasks results does the job contain? Which trend graph type is selected? Is the trend graph on the job page or on the dashboard view?
          bcoppens bcoppens added a comment -

          The job has 110 builds.
          Among these 110 builds, 93 have a open-tasks.xml file.
          The graph type is "Priority distribution of all warnings"
          Graph is on the job page.
          If I add the graph in the dashboard view, same error.

          The stack trace is generated by calling the URL:
          http://<server_name>/hudson/job/<job_name>/tasks/trendGraph/png

          bcoppens bcoppens added a comment - The job has 110 builds. Among these 110 builds, 93 have a open-tasks.xml file. The graph type is "Priority distribution of all warnings" Graph is on the job page. If I add the graph in the dashboard view, same error. The stack trace is generated by calling the URL: http://<server_name>/hudson/job/<job_name>/tasks/trendGraph/png
          drulli Ulli Hafner added a comment -

          Hmm, that is really strange, the build results seems to be null which should never happen. Maybe something in the deserialization is broken. Does this only occur with the tasks plug-in? From which version's did you upgrade?

          Since there are two watchers on this issue: is anybody else seeing this problem?

          drulli Ulli Hafner added a comment - Hmm, that is really strange, the build results seems to be null which should never happen. Maybe something in the deserialization is broken. Does this only occur with the tasks plug-in? From which version's did you upgrade? Since there are two watchers on this issue: is anybody else seeing this problem?

          Code changed in hudson
          User: : drulli
          Path:
          trunk/hudson/plugins/analysis-core/src/main/java/hudson/plugins/analysis/graph/CategoryBuildResultGraph.java
          http://jenkins-ci.org/commit/31380
          Log:
          JENKINS-6613 Added a logging statement to find reason for NPE.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : drulli Path: trunk/hudson/plugins/analysis-core/src/main/java/hudson/plugins/analysis/graph/CategoryBuildResultGraph.java http://jenkins-ci.org/commit/31380 Log: JENKINS-6613 Added a logging statement to find reason for NPE.
          drulli Ulli Hafner added a comment -

          Integrated in Hudson Plug-ins #74
          JENKINS-6613 Added a logging statement to find reason for NPE.

          drulli Ulli Hafner added a comment - Integrated in Hudson Plug-ins #74 JENKINS-6613 Added a logging statement to find reason for NPE.
          bcoppens bcoppens added a comment -

          Unfortunately I dont't know what was the previous version.

          I compiled and deployed your updated CategoryBuildResultGraph.java
          Now the graph appears and I see only one log in the logs:

          Previous result is null: #55

          Build #54 (not #55) is the first build to have a open-tasks.xml file

          bcoppens bcoppens added a comment - Unfortunately I dont't know what was the previous version. I compiled and deployed your updated CategoryBuildResultGraph.java Now the graph appears and I see only one log in the logs: Previous result is null: #55 Build #54 (not #55) is the first build to have a open-tasks.xml file
          bcoppens bcoppens added a comment -

          One more thing: in the graph, the first abscissa is build #55, not #54

          bcoppens bcoppens added a comment - One more thing: in the graph, the first abscissa is build #55, not #54
          drulli Ulli Hafner added a comment -

          Thanks, that helps a lot. (The logging message is somewhat misleading...) The graph is build from the current build to build #55 (the result of #54 is null). Now I need to find out why the method hasPreviousResult() on build #55 returns true. That means that a previous build has a task action but no result, that is strange...

          Can you please attach the build.xml files in the build folders of this job for build #54 and #55? Thanks, Ulli

          drulli Ulli Hafner added a comment - Thanks, that helps a lot. (The logging message is somewhat misleading...) The graph is build from the current build to build #55 (the result of #54 is null). Now I need to find out why the method hasPreviousResult() on build #55 returns true . That means that a previous build has a task action but no result, that is strange... Can you please attach the build.xml files in the build folders of this job for build #54 and #55? Thanks, Ulli
          bcoppens bcoppens added a comment -

          build.xml and open-tasks.xml of jobs 54 and 55

          bcoppens bcoppens added a comment - build.xml and open-tasks.xml of jobs 54 and 55
          bcoppens bcoppens made changes -
          Field Original Value New Value
          Attachment data.zip [ 19457 ]
          drulli Ulli Hafner added a comment -

          Is it possible, that someone edited some build.xml files by hand? In the build file #54 there is no entry for the TasksResultAction, however a openTasks.xml file is written in build #54...

          drulli Ulli Hafner added a comment - Is it possible, that someone edited some build.xml files by hand? In the build file #54 there is no entry for the TasksResultAction, however a openTasks.xml file is written in build #54...
          bcoppens bcoppens added a comment -

          When I check job 54, I can see that build.xml and open-tasks.xml have different timestamps (1 day of difference).
          When I check job 55, I can see that build.xml and open-tasks.xml have the same timestamp.
          Therefore I suppose job 54 was modified manually. I will ask to my colleague tomorrow.

          Is the missing tag the origin of the NPE?

          Is it however possible that the issue did not appear with the previous version of the plugin?

          bcoppens bcoppens added a comment - When I check job 54, I can see that build.xml and open-tasks.xml have different timestamps (1 day of difference). When I check job 55, I can see that build.xml and open-tasks.xml have the same timestamp. Therefore I suppose job 54 was modified manually. I will ask to my colleague tomorrow. Is the missing tag the origin of the NPE? Is it however possible that the issue did not appear with the previous version of the plugin?
          drulli Ulli Hafner added a comment -

          I rewrote that part of the plug-in. I think in previous versions of the plug-in no NPE will occur due to different handling of the results.

          Actually I think that not build #54 is causing the problem. It must be a previous one that has a tag TasksResultAction in the build.xml file, but no result tag. Then the result is serialized to null causing the NPE.

          drulli Ulli Hafner added a comment - I rewrote that part of the plug-in. I think in previous versions of the plug-in no NPE will occur due to different handling of the results. Actually I think that not build #54 is causing the problem. It must be a previous one that has a tag TasksResultAction in the build.xml file, but no result tag. Then the result is serialized to null causing the NPE.
          bcoppens bcoppens added a comment -

          You are right: the first TasksResultAction tag appears in build 29!
          Missing data attached

          bcoppens bcoppens added a comment - You are right: the first TasksResultAction tag appears in build 29! Missing data attached
          bcoppens bcoppens added a comment -

          Data of jobs 29 to 49

          bcoppens bcoppens added a comment - Data of jobs 29 to 49
          bcoppens bcoppens made changes -
          Attachment data2.zip [ 19463 ]
          drulli Ulli Hafner added a comment -

          And it does not appear in 50-54?

          drulli Ulli Hafner added a comment - And it does not appear in 50-54?
          bcoppens bcoppens added a comment -

          The tag does not appear in 50-53 and no open-tasks.xml either.
          But it seems that the files were also modified as the timestamp is different than the others files.
          As this job is managed by my colleague who is currently not there, I can not tell you what was manually modified.

          bcoppens bcoppens added a comment - The tag does not appear in 50-53 and no open-tasks.xml either. But it seems that the files were also modified as the timestamp is different than the others files. As this job is managed by my colleague who is currently not there, I can not tell you what was manually modified.
          bcoppens bcoppens added a comment -

          build 50-53

          bcoppens bcoppens added a comment - build 50-53
          bcoppens bcoppens made changes -
          Attachment data3.zip [ 19464 ]
          drulli Ulli Hafner added a comment -

          Ok, I see now. build.xml #53 has been modified manually:

          <hudson.plugins.tasks.TasksResultAction>
            <owner class="build" reference="../../.."/>
            <healthDescriptor class="hudson.plugins.tasks.TasksHealthDescriptor">
              <priority>LOW</priority>
              <threshold/>
              <newThreshold/>
              <failureThreshold/> 
              <newFailureThreshold/>
              <healthy/>
              <unHealthy/>
              </healthDescriptor>
          </hudson.plugins.tasks.TasksResultAction>
          

          The required section <result class="hudson.plugins.tasks.TasksResult"> has been deleted (resulting in null when deserializing).

          Please also remove the TasksResultAction tags from this (or these builds).

          drulli Ulli Hafner added a comment - Ok, I see now. build.xml #53 has been modified manually: <hudson.plugins.tasks.TasksResultAction> <owner class= "build" reference= "../../.." /> <healthDescriptor class= "hudson.plugins.tasks.TasksHealthDescriptor" > <priority>LOW</priority> <threshold/> <newThreshold/> <failureThreshold/> <newFailureThreshold/> <healthy/> <unHealthy/> </healthDescriptor> </hudson.plugins.tasks.TasksResultAction> The required section <result class="hudson.plugins.tasks.TasksResult"> has been deleted (resulting in null when deserializing). Please also remove the TasksResultAction tags from this (or these builds).
          drulli Ulli Hafner made changes -
          Resolution Won't Fix [ 2 ]
          Status Open [ 1 ] Closed [ 6 ]

          Code changed in hudson
          User: : drulli
          Path:
          trunk/hudson/plugins/analysis-core/src/main/java/hudson/plugins/analysis/graph/CategoryBuildResultGraph.java
          http://jenkins-ci.org/commit/31488
          Log:
          JENKINS-6613 Removed logging statement.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : drulli Path: trunk/hudson/plugins/analysis-core/src/main/java/hudson/plugins/analysis/graph/CategoryBuildResultGraph.java http://jenkins-ci.org/commit/31488 Log: JENKINS-6613 Removed logging statement.
          drulli Ulli Hafner added a comment -

          Integrated in Hudson Plug-ins #85

          drulli Ulli Hafner added a comment - Integrated in Hudson Plug-ins #85
          drulli Ulli Hafner added a comment -

          Integrated in Hudson Plug-ins (Compile) #5
          JENKINS-6613 Removed logging statement.

          drulli Ulli Hafner added a comment - Integrated in Hudson Plug-ins (Compile) #5 JENKINS-6613 Removed logging statement.
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 136708 ] JNJira + In-Review [ 204181 ]

          People

            drulli Ulli Hafner
            bcoppens bcoppens
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: