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

IndexOutOfBoundsException when clicking a per-tool report that did not have any warnings

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • warnings-ng-plugin
    • None
    • Jenkins 2.303.3
      Warnings Next Generation Plugin 9.7.0
      Analysis Model API Plugin 10.6.0

      I had configured aggregated reporting in Warnings Next Generation, like this:

      recordIssues(
          tools: [
              docFx(pattern: 'obj/docfx.log.json', reportEncoding: 'UTF-8'),
              msBuild(pattern: 'MSBuild.log', reportEncoding: 'UTF-8')],
          qualityGates: [
              [threshold: 1, type: 'TOTAL_NORMAL', unstable: true],
              [threshold: 1, type: 'TOTAL_HIGH', unstable: false],
              [threshold: 1, type: 'TOTAL_ERROR', unstable: false]],
          sourceCodeEncoding: 'UTF-8',
          publishAllIssues: true,
          aggregatingResults: true)
      

      The build wrote some warnings to obj/docfx.log.json but none to MSBuild.log.
      After the build, Jenkins displayed:

      Static Analysis: 9 warnings (from 2 analyses)

      • Static analysis results from: MSBuild, DocFX
      • New issues: 9
      • Reference build: PR-70 #31
      • Quality gate: Unstable

      I clicked the "DocFX" link and Jenkins correctly displayed the warnings reported by DocFX.
      I then returned to the previous page and clicked the "MSBuild" link. That caused an error:

      Oops!
      A problem occurred while processing the request.

      Logging ID=202cc84a-ee54-4e33-9132-1ced637bf249

      The Jenkins log contains:

      marraskuuta 11, 2021 1:49:17 IP. WARNING hudson.init.impl.InstallUncaughtExceptionHandler handleException
      
      Caught unhandled exception with ID 202cc84a-ee54-4e33-9132-1ced637bf249
      java.lang.IndexOutOfBoundsException: No such index 0 in - (-): 0 issues (0 duplicates)
      	at edu.hm.hafner.analysis.Report.get(Report.java:517)
      	at io.jenkins.plugins.analysis.core.model.DetailFactory.getPropertyValueAsString(DetailFactory.java:201)
      	at io.jenkins.plugins.analysis.core.model.DetailFactory.getDisplayNameOfDetails(DetailFactory.java:184)
      	at io.jenkins.plugins.analysis.core.model.DetailFactory.createFilteredView(DetailFactory.java:133)
      	at io.jenkins.plugins.analysis.core.model.DetailFactory.createTrendDetails(DetailFactory.java:89)
      	at io.jenkins.plugins.analysis.core.model.IssuesDetail.getDynamic(IssuesDetail.java:615)
      	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
      	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:393)
      	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:405)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:208)
      	at org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:455)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:766)
      Caused: javax.servlet.ServletException
      	[REDACTED the rest]
      

      This could possibly be fixed by omitting the link to the per-tool report if there were no issues from that tool. However, it would be better to keep the link and fix the report, because the per-tool trend graph may still be interesting to users.

            drulli Ulli Hafner
            kon Kalle Niemitalo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: