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

NullPointerException using project-stats-plugin

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • project-stats-plugin
    • None
    • Jenkins 1.478 - Project statistics Plugin 0.3

      NullPointerException using Project Stats plugin in Jenkins :
      Stack trace :
      java.lang.NullPointerException
      at hudson.plugins.projectstats.NumBuildsStats.compute(NumBuildsStats.java:51)
      at hudson.plugins.projectstats.column.NumBuildsColumn.getStats(NumBuildsColumn.java:53)
      at sun.reflect.GeneratedMethodAccessor137.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
      at java.lang.reflect.Method.invoke(Method.java:611)
      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:73)
      at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72)
      at org.apache.commons.jelly.tags.core.CoreTagLibrary$3.run(CoreTagLibrary.java:134)
      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:81)
      at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:99)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270)
      at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)
      ...

      Error occured in this method :

      public void compute(Job job) {
      List<Run> builds = job.getBuilds();
      for (Run build : builds)

      { if (build.getResult().isBetterOrEqualTo(Result.SUCCESS)) addSuccess(); else if (build.getResult().isBetterOrEqualTo(Result.UNSTABLE)) addUnstable(); else if (build.getResult().isBetterOrEqualTo(Result.FAILURE)) addFail(); }

      }

      build.getResult() seems to be null.
      I've made a groovy script to find job where a build can have a null result :

      Jenkins.instance.items.findAll

      {job -> job.isBuildable()}

      .each{ Job job ->
      if(job.getBuilds() != null) {
      for (Run build : job.getBuilds()) {
      if(build.getResult() == null)

      { println "('"+build.number+"') null : " + job.name }

      }
      }
      }

      All resulting jobs are currently building.

      It seems that the plugin don't check if the job is currently building, that result in a NullPointerException here.

      Michaƫl

            mpapo Michael Pailloncy
            mpapo Michael Pailloncy
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: