• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • warnings-ng-plugin
    • None
    • Warnings Next Generation 8.0.0

      I have a pipeline that does the following:

              recordIssues(
                  healthy: 1,
                  qualityGates: [[threshold: 40, type: 'TOTAL', unstable: true]],
                  tools: [msBuild(), fxcop(pattern: 'fxcop.xml'), styleCop(pattern: '**/StyleCopViolations.xml')],
                  unhealthy: 39)
              recordIssues(
                  tools: [taskScanner(highTags: 'HACK,FIXME', includePattern: '**/*.cs,**/app/**/*.js', normalTags: 'TODO')])
      

      This is done in order to use the unhealthy threshold only for the MSBuild/FxCop/StyleCop issues, and allow the TaskScanner portion to produce any number of "issues" without running into a threshold.

      Prior to 8.0.0, this worked fine, but now the second recordIssues generates this:

       java.lang.NullPointerException
       	at edu.hm.hafner.analysis.Report.addAll(Report.java:166)
       	at edu.hm.hafner.analysis.Report.copyIssuesAndProperties(Report.java:639)
       	at edu.hm.hafner.analysis.Report.addAll(Report.java:186)
       	at io.jenkins.plugins.analysis.core.model.AnalysisResult.getIssues(AnalysisResult.java:413)
       	at java.util.Optional.map(Optional.java:215)
       	at io.jenkins.plugins.analysis.core.model.AnalysisHistory.getIssues(AnalysisHistory.java:142)
       	at io.jenkins.plugins.analysis.core.model.DeltaReport.<init>(DeltaReport.java:48)
       	at io.jenkins.plugins.analysis.core.steps.IssuesPublisher.attachAction(IssuesPublisher.java:110)
       	at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.publishResult(IssuesRecorder.java:706)
       	at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.record(IssuesRecorder.java:636)
       	at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.perform(IssuesRecorder.java:602)
       	at io.jenkins.plugins.analysis.core.steps.RecordIssuesStep$Execution.run(RecordIssuesStep.java:1007)
       	at io.jenkins.plugins.analysis.core.steps.RecordIssuesStep$Execution.run(RecordIssuesStep.java:969)
       	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
       	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
       	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
       	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
       	at java.lang.Thread.run(Thread.java:748)
      

      Is there a different 8.0-compatible way to accomplish this behavior, or is this just a legitimate bug?

          [JENKINS-61293] NPE from second recordIssues step

          Nick Jones added a comment -

          The job name and source code files do disclose some proprietary information so I would have to produce sanitized versions in order to be able to send them to you or post them here. Are there questions I could answer about the files (e.g., their structure) without sending the files themselves?

          Nick Jones added a comment - The job name and source code files do disclose some proprietary information so I would have to produce sanitized versions in order to be able to send them to you or post them here. Are there questions I could answer about the files (e.g., their structure) without sending the files themselves?

          Nick Jones added a comment -

          All I can see in the system log is this:

          2020-03-02 20:37:38.094+0000 [id=11719]	WARNING	h.util.RobustReflectionConverter#doUnmarshal: Cannot convert type edu.hm.hafner.util.TreeString to type java.lang.String
          

          Nick Jones added a comment - All I can see in the system log is this: 2020-03-02 20:37:38.094+0000 [id=11719] WARNING h.util.RobustReflectionConverter#doUnmarshal: Cannot convert type edu.hm.hafner.util.TreeString to type java.lang.String

          Ulli Hafner added a comment - - edited

          Does one of the [Jenkins-HOME]/jobs/[job]/builds/[number]/open-tasks-*xml files contain the text TreeString?

          Maybe you can send the xml tags from the 4 files from the build (from 7.x)? See https://superuser.com/questions/731760/how-to-delete-values-from-xml-in-notepad on how to remove the values. (Or use the regex >.*< and replace with >< in an IDE.)

          Example I need:

              <issue>
                <category></category>
                <type></type>
                <severity></severity>
                <lineStart></lineStart>
                <lineEnd></lineEnd>
                <columnStart></columnStart>
                <columnEnd></columnEnd>
                <lineRanges/>
                <id></id>
                <reference></reference>
                <origin></origin>
                <moduleName></moduleName>
                <packageName></packageName>
                <pathName></pathName>
                <fileName></fileName>
                <message></message>
                <description></description>
                <fingerprint></fingerprint>
              </issue>
          
          

          Ulli Hafner added a comment - - edited Does one of the [Jenkins-HOME] /jobs/ [job] /builds/ [number] /open-tasks-*xml files contain the text TreeString ? Maybe you can send the xml tags from the 4 files from the build (from 7.x)? See https://superuser.com/questions/731760/how-to-delete-values-from-xml-in-notepad on how to remove the values. (Or use the regex >.*< and replace with >< in an IDE.) Example I need: <issue> <category></category> <type></type> <severity></severity> <lineStart></lineStart> <lineEnd></lineEnd> <columnStart></columnStart> <columnEnd></columnEnd> <lineRanges/> <id></id> <reference></reference> <origin></origin> <moduleName></moduleName> <packageName></packageName> <pathName></pathName> <fileName></fileName> <message></message> <description></description> <fingerprint></fingerprint> </issue>

          Nick Jones added a comment -

          Great suggestion, drulli. I've attached the sanitized (structure-only) versions of those open-tasks*.xml files from the last successful build (using v7). I don't see anything with TreeString in it, but then the builds with v8 don't generate these files at all, so the only ones I can examine are the older v7 ones.

          Nick Jones added a comment - Great suggestion, drulli . I've attached the sanitized (structure-only) versions of those open-tasks*.xml files from the last successful build (using v7). I don't see anything with TreeString in it, but then the builds with v8 don't generate these files at all, so the only ones I can examine are the older v7 ones.

          Ulli Hafner added a comment -

          Thanks, that helped! now I can reproduce the bug.

          Ulli Hafner added a comment - Thanks, that helped! now I can reproduce the bug.

          Ulli Hafner added a comment -

          Ulli Hafner added a comment - Ok, fixed in upstream https://github.com/jenkinsci/analysis-model/pull/311 .

          Ulli Hafner added a comment -

          Ulli Hafner added a comment - Note: You need to update to https://github.com/jenkinsci/analysis-model/releases/tag/analysis-model-8.0.1 .

          Nick Jones added a comment -

          Fix confirmed here, after upgrading to Analysis Model API 8.0.1. Thanks drulli!

          Nick Jones added a comment - Fix confirmed here, after upgrading to Analysis Model API 8.0.1. Thanks drulli !

          Zbynek Konecny added a comment - - edited

          drulli stacktrace with these exact methods (slightly different line numbers) seems to be back after upgrade to 9.0.

          java.lang.NullPointerException at edu.hm.hafner.analysis.Report.addAll(Report.java:174) at 
          edu.hm.hafner.analysis.Report.copyIssuesAndProperties(Report.java:660) at 
          edu.hm.hafner.analysis.Report.addAll(Report.java:194) at 
          io.jenkins.plugins.analysis.core.model.AnalysisResult.getIssues(AnalysisResult.java:413) at java.util.Optional.map(Optional.java:215) at io.jenkins.plugins.analysis.core.model.AnalysisHistory.getIssues(AnalysisHistory.java:142) at io.jenkins.plugins.analysis.core.model.DeltaReport.<init>(DeltaReport.java:48) at io.jenkins.plugins.analysis.core.steps.IssuesPublisher.attachAction(IssuesPublisher.java:110) at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.publishResult(IssuesRecorder.java:721) at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.record(IssuesRecorder.java:651) at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.perform(IssuesRecorder.java:617) at io.jenkins.plugins.analysis.core.steps.RecordIssuesStep$Execution.run(RecordIssuesStep.java:1024) at io.jenkins.plugins.analysis.core.steps.RecordIssuesStep$Execution.run(RecordIssuesStep.java:985) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) 

          Zbynek Konecny added a comment - - edited drulli stacktrace with these exact methods (slightly different line numbers) seems to be back after upgrade to 9.0. java.lang.NullPointerException at edu.hm.hafner.analysis.Report.addAll(Report.java:174) at edu.hm.hafner.analysis.Report.copyIssuesAndProperties(Report.java:660) at edu.hm.hafner.analysis.Report.addAll(Report.java:194) at io.jenkins.plugins.analysis.core.model.AnalysisResult.getIssues(AnalysisResult.java:413) at java.util.Optional.map(Optional.java:215) at io.jenkins.plugins.analysis.core.model.AnalysisHistory.getIssues(AnalysisHistory.java:142) at io.jenkins.plugins.analysis.core.model.DeltaReport.<init>(DeltaReport.java:48) at io.jenkins.plugins.analysis.core.steps.IssuesPublisher.attachAction(IssuesPublisher.java:110) at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.publishResult(IssuesRecorder.java:721) at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.record(IssuesRecorder.java:651) at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.perform(IssuesRecorder.java:617) at io.jenkins.plugins.analysis.core.steps.RecordIssuesStep$Execution.run(RecordIssuesStep.java:1024) at io.jenkins.plugins.analysis.core.steps.RecordIssuesStep$Execution.run(RecordIssuesStep.java:985) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)

          Ulli Hafner added a comment -

          Ulli Hafner added a comment - See JENKINS-63659 .

            drulli Ulli Hafner
            medianick Nick Jones
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: