• 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 created issue -
          Ulli Hafner made changes -
          Link New: This issue relates to JENKINS-60680 [ JENKINS-60680 ]

          Ulli Hafner added a comment -

          Did you upgrade analysis-model and forensics-api as well? Did you use the beta versions before? Are there any exceptions in Jenkins log? Sadly our XStream wrapper simply ignores exceptions due to serialization errors (and due to class not found exceptions).

          Can you please open the results of any of the pre 8.0.0 results and check in Jenkins log if there are any exceptions thrown...

          Ulli Hafner added a comment - Did you upgrade analysis-model and forensics-api as well? Did you use the beta versions before? Are there any exceptions in Jenkins log? Sadly our XStream wrapper simply ignores exceptions due to serialization errors (and due to class not found exceptions). Can you please open the results of any of the pre 8.0.0 results and check in Jenkins log if there are any exceptions thrown...

          Nick Jones added a comment -

          Yes, all available updates were installed at the same time, including Analysis Model API 8.0.0, Forensics API 0.7.0, and Git Forensics 0.7.0. I was not using beta versions previously.

          No exceptions were thrown in previous instances of this job; the separate instances of recordIssues behaved as expected.

          Nick Jones added a comment - Yes, all available updates were installed at the same time, including Analysis Model API 8.0.0, Forensics API 0.7.0, and Git Forensics 0.7.0. I was not using beta versions previously. No exceptions were thrown in previous instances of this job; the separate instances of recordIssues behaved as expected.

          Ulli Hafner added a comment -

          But can you open the old results? Especially the results of the reference build?

          Ulli Hafner added a comment - But can you open the old results? Especially the results of the reference build?

          Nick Jones added a comment -

          Ah, no. Going back to the reference build for the last successful run of the taskScanner, I get the Angry Jenkins "Oops" page with the same stack trace:

          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 io.jenkins.plugins.analysis.core.model.IssuesDetail.<init>(IssuesDetail.java:173)
          	at io.jenkins.plugins.analysis.core.model.ResultAction.getTarget(ResultAction.java:315)
          	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:703)
          	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)
          	at org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:456)
          	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
          	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)
          	at org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:456)
          	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
          	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)
          	at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:280)
          	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
          	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
          	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)
          	at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:280)
          	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
          	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
          	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)
          	at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:280)
          

          etc.

          Should I roll back to a pre-8.0 release and see how these various pages behave? Or is it useful for me to keep this on 8.0? (This is our Staging Jenkins system, so it's not impacting users yet.)

          Nick Jones added a comment - Ah, no. Going back to the reference build for the last successful run of the taskScanner, I get the Angry Jenkins "Oops" page with the same stack trace: 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 io.jenkins.plugins.analysis.core.model.IssuesDetail.<init>(IssuesDetail.java:173) at io.jenkins.plugins.analysis.core.model.ResultAction.getTarget(ResultAction.java:315) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:703) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878) at org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:456) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878) at org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:456) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878) at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:280) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878) at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:280) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878) at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:280) etc. Should I roll back to a pre-8.0 release and see how these various pages behave? Or is it useful for me to keep this on 8.0? (This is our Staging Jenkins system, so it's not impacting users yet.)

          Ulli Hafner added a comment -

          Since you have this error you should not upgrade to 8.0 in the production environment.
          But do you see anything in the system log of Jenkins? (Security violation during serialization or something similar?)

          Are the tasks you have in your staging environment confidential? Or would it be possible to attach (or send me the files [Jenkins-HOME]/jobs/[job]/builds/[number]/open-tasks-*xml via private Email)?

          Ulli Hafner added a comment - Since you have this error you should not upgrade to 8.0 in the production environment. But do you see anything in the system log of Jenkins? (Security violation during serialization or something similar?) Are the tasks you have in your staging environment confidential? Or would it be possible to attach (or send me the files [Jenkins-HOME] /jobs/ [job] /builds/ [number] /open-tasks-*xml via private Email)?

          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 made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

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

              Created:
              Updated:
              Resolved: