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

NPE when showing warnings trend graphs for multi-branch pipelines

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Jenkins v2.47 with latest pipeline/multi-branch/git plug-ins
      Warnings Plug-In v4.60
      Static Analysis Collector Plug-in v1.50
      (and latest versions of all used static code analysis plug-ins)
    • Similar Issues:

      Description

      When opening the multi-branch pipeline for a specific branch to look at the aggregated warnings graphs and the current pipeline status, a NPE is thrown in the Jenkins log for every installed static code analysis plugin (PMD, DRY, CheckStyle, FindBugs etc)

      My Jenkinsfile looks like this:

          try {
                  [...] // build using mvn and archive artefacts
      
              } finally {
                  step([$class: 'PmdPublisher', defaultEncoding: '', healthy: '', pattern: '', unHealthy: '', unstableNewAll: '', unstableTotalAll: '40', useStableBuildAsReference: true])
                  step([$class: 'DryPublisher', canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: ''])
                  step([$class: 'TasksPublisher', canComputeNew: false, defaultEncoding: '', excludePattern: '', healthy: '',
                          high: '', low: '', normal: 'TODO,FIXME', pattern: '', unHealthy: '', unstableTotalAll: '100'])
                  step([$class: 'WarningsPublisher', consoleParsers: [[parserName: 'Java Compiler (javac)'], [parserName: 'JavaDoc Tool']],
                          defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '',
                          parserConfigurations: [[parserName: 'JSLint', pattern: '**/jshint.xml']],
                          unHealthy: '', unstableTotalAll: '289', useDeltaValues: true, useStableBuildAsReference: true])
                  
                  // publishes combined warnings analysis
                  step([$class                   : 'AnalysisPublisher',
                        checkStyleActivated      : false,
                        dryActivated             : true,
                        findBugsActivated        : false,
                        openTasksActivated       : true,
                        pmdActivated             : true,
                        warningsActivated        : true,
                        healthy                  : '',
                        unHealthy                : '',
                        unstableNewAll           : '',
                        unstableTotalAll         : '',
                        useDeltaValues           : true,
                        useStableBuildAsReference: true,
                        defaultEncoding          : ''
                  ])
      
                  junit testResults: '**/target/surefire-reports/*.xml'
              }
      

      Whenever visiting the URL /job/MyPipelineName/job/master/ then the following NPEs get logged to the jenkins log:

      Checkstyle (full stacktrace)
      Feb 26, 2017 1:51:53 PM hudson.ExpressionFactory2$JexlExpression evaluate
      WARNING: Caught exception evaluating: it.isCheckStyleActivated() in /job/MyPipelineName/job/master/. Reason: java.lang.NullPointerException
      java.lang.NullPointerException
              at hudson.plugins.analysis.collector.WarningsAggregator.hasAction(WarningsAggregator.java:350)
              at hudson.plugins.analysis.collector.WarningsAggregator.hasCheckStyle(WarningsAggregator.java:274)
              at hudson.plugins.analysis.collector.AnalysisProjectAction.isCheckStyleActivated(AnalysisProjectAction.java:98)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:258)
              at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:104)
              at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
              at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
              at org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51)
              at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
              at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:74)
              at org.apache.commons.jelly.expression.ExpressionSupport.evaluateRecurse(ExpressionSupport.java:61)
              at org.apache.commons.jelly.expression.ExpressionSupport.evaluateAsBoolean(ExpressionSupport.java:71)
              at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:97)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
              at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95)
              at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:147)
              at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
              at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)
              at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:150)
              at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
              at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95)
              at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:147)
              at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:99)
              at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
              at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
              at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:120)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:99)
              at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
              at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
              at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
              at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
              at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:120)
              at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
              at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95)
              at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63)
              at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:53)
              at org.kohsuke.stapler.jelly.JellyClassTearOff.serveIndexJelly(JellyClassTearOff.java:112)
              at org.kohsuke.stapler.jelly.JellyFacet.handleIndexRequest(JellyFacet.java:140)
              at org.kohsuke.stapler.IndexViewDispatcher.dispatch(IndexViewDispatcher.java:30)
              at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
              at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:248)
              at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
              at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
              at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:248)
              at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
              at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
              at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
              at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)
              at org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.doFilter(Endpoint.java:225)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
              at io.jenkins.blueocean.ResourceCacheControl.doFilter(ResourceCacheControl.java:134)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
              at jenkins.metrics.impl.MetricsFilter.doFilter(MetricsFilter.java:125)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
              at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:126)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
              at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:49)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
              at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
              at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
              at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
              at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
              at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
              at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
              at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
              at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
              at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)
              at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
              at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
              at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
              at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
              at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
              at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
              at org.eclipse.jetty.server.Server.handle(Server.java:499)
              at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
              at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
              at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
              at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      
      DRY plugin
      Feb 26, 2017 1:51:53 PM hudson.ExpressionFactory2$JexlExpression evaluate
      WARNING: Caught exception evaluating: it.isDryActivated() in /job/MyPipelineName/job/master/. Reason: java.lang.NullPointerException
      java.lang.NullPointerException
              at hudson.plugins.analysis.collector.WarningsAggregator.hasAction(WarningsAggregator.java:350)
              at hudson.plugins.analysis.collector.WarningsAggregator.hasDry(WarningsAggregator.java:288)
              at hudson.plugins.analysis.collector.AnalysisProjectAction.isDryActivated(AnalysisProjectAction.java:107)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
      [...]
      
      FindBugs
      Feb 26, 2017 1:51:53 PM hudson.ExpressionFactory2$JexlExpression evaluate
      WARNING: Caught exception evaluating: it.isFindBugsActivated() in /job/MyPipelineName/job/master/. Reason: java.lang.NullPointerException
      java.lang.NullPointerException
              at hudson.plugins.analysis.collector.WarningsAggregator.hasAction(WarningsAggregator.java:350)
              at hudson.plugins.analysis.collector.WarningsAggregator.hasFindBugs(WarningsAggregator.java:302)
              at hudson.plugins.analysis.collector.AnalysisProjectAction.isFindBugsActivated(AnalysisProjectAction.java:116)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
      [...]
      
      PMD
      Feb 26, 2017 1:51:53 PM hudson.ExpressionFactory2$JexlExpression evaluate
      WARNING: Caught exception evaluating: it.isPmdActivated() in /job/MyPipelineName/job/master/. Reason: java.lang.NullPointerException
      java.lang.NullPointerException
              at hudson.plugins.analysis.collector.WarningsAggregator.hasAction(WarningsAggregator.java:350)
              at hudson.plugins.analysis.collector.WarningsAggregator.hasPmd(WarningsAggregator.java:316)
              at hudson.plugins.analysis.collector.AnalysisProjectAction.isPmdActivated(AnalysisProjectAction.java:125)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
      [...]
      
      OpenTasks
      Feb 26, 2017 1:51:53 PM hudson.ExpressionFactory2$JexlExpression evaluate
      WARNING: Caught exception evaluating: it.isOpenTasksActivated() in /job/MyPipelineName/job/master/. Reason: java.lang.NullPointerException
      java.lang.NullPointerException
              at hudson.plugins.analysis.collector.WarningsAggregator.hasAction(WarningsAggregator.java:350)
              at hudson.plugins.analysis.collector.WarningsAggregator.hasPmd(WarningsAggregator.java:316)
              at hudson.plugins.analysis.collector.AnalysisProjectAction.isOpenTasksActivated(AnalysisProjectAction.java:134)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
      [...]
      
      Warnings
      Feb 26, 2017 1:51:53 PM hudson.ExpressionFactory2$JexlExpression evaluate
      WARNING: Caught exception evaluating: it.isWarningsActivated() in /job/MyPipelineName/job/master/. Reason: java.lang.NullPointerException
      java.lang.NullPointerException
              at hudson.plugins.analysis.collector.WarningsAggregator.hasAction(WarningsAggregator.java:350)
              at hudson.plugins.analysis.collector.WarningsAggregator.hasCompilerWarnings(WarningsAggregator.java:344)
              at hudson.plugins.analysis.collector.AnalysisProjectAction.isWarningsActivated(AnalysisProjectAction.java:143)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
      [...]
      

      The trend graphs seem to show up fine however, so not sure what the impact of the NPE actually is.

        Attachments

          Activity

          Hide
          drulli Ulli Hafner added a comment -

          Actually the NPE is from the analysis collector plugin that shows the combined trend graph.

          Show
          drulli Ulli Hafner added a comment - Actually the NPE is from the analysis collector plugin that shows the combined trend graph.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/analysis/collector/AnalysisProjectAction.java
          http://jenkins-ci.org/commit/analysis-collector-plugin/362d29998c1c5ccbbbb73b0c4143005693b1190b
          Log:
          [FIXED JENKINS-42328] Do not use deprecated project in pipeline jobs.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/analysis/collector/AnalysisProjectAction.java http://jenkins-ci.org/commit/analysis-collector-plugin/362d29998c1c5ccbbbb73b0c4143005693b1190b Log: [FIXED JENKINS-42328] Do not use deprecated project in pipeline jobs.

            People

            • Assignee:
              drulli Ulli Hafner
              Reporter:
              stefanthurnherr Stefan Thurnherr
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: