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

Null pointer exception fails job with warnings-ng 8.4.2

      A freestyle job that builds the Jenkins git plugin fails with a null pointer exception after updating to warnings-ng plugin 8.4.2.

      The null pointer exception is:

      [SpotBugs] No filter has been set, publishing all 0 issues
      ERROR: Build step failed with exception
      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.IssuesRecorder.perform(IssuesRecorder.java:595)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
      	at hudson.model.Build$BuildExecution.post2(Build.java:186)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
      	at hudson.model.Run.execute(Run.java:1919)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:428)
      Build step 'Record compiler warnings and static analysis results' marked build as failure
      

      Same null pointer exception also fails pipeline jobs for the git plugin.

          [JENKINS-63659] Null pointer exception fails job with warnings-ng 8.4.2

          Christoph Fetzer added a comment - - edited

          My file contains a lot of issues but I can't send it without a huge amount of modification..... sorry.

          This is the beginning with the first issue:

          <?xml version='1.1' encoding='UTF-8'?>
          <analysisReport serialization="custom">
            <analysisReport>
              <int>763</int>
              <string>D:/workdir/.jenkins</string>
              <string>../build/XXX/workspace/XXX/XXX/XXX.h</string>
              <int>52</int>
              <int>52</int>
              <int>0</int>
              <int>0</int>
              <edu.hm.hafner.analysis.LineRangeList/>
              <string>C4251</string>
              <string>-</string>
              <string>-</string>
              <string></string>
              <string>NORMAL</string>
              <string>&apos;XXX::XXX; : XXX;</string>
              <string></string>
              <string>msbuild</string>
              <string>1129</string>
              <string>94E8C005B75E7F70F8B26995F31908FA</string>
              <null/>
              <uuid>cac68e48-4c64-45f4-a3ab-318967d8d728</uuid>
          

          Christoph Fetzer added a comment - - edited My file contains a lot of issues but I can't send it without a huge amount of modification..... sorry. This is the beginning with the first issue: <?xml version= '1.1' encoding= 'UTF-8' ?> <analysisReport serialization= "custom" > <analysisReport> < int >763</ int > <string>D:/workdir/.jenkins</string> <string>../build/XXX/workspace/XXX/XXX/XXX.h</string> < int >52</ int > < int >52</ int > < int >0</ int > < int >0</ int > <edu.hm.hafner.analysis.LineRangeList/> <string>C4251</string> <string>-</string> <string>-</string> <string></string> <string>NORMAL</string> <string>&apos;XXX::XXX; : XXX;</string> <string></string> <string>msbuild</string> <string>1129</string> <string>94E8C005B75E7F70F8B26995F31908FA</string> < null /> <uuid>cac68e48-4c64-45f4-a3ab-318967d8d728</uuid>

          I think the file maven-warnings-outstanding-issues.xml in the analysisReports.zip should have issues.

          Christian Strebel added a comment - I think the file maven-warnings-outstanding-issues.xml in the  analysisReports.zip should have issues.

          Ulli Hafner added a comment -

          I see. The intermediate reports with 8.4.1 and 9.0.0 do use a totally different format. This is the old (and 8.4.2.) format:

          <analysisReport plugin="analysis-model-api@5.1.1">
            <elements class="linked-hash-set">
              <issue>
                <category>ConstructorLeaksThis</category>
                <type>-</type>
                <severity>NORMAL</severity>
                <message>Constructors should not pass the &apos;this&apos; reference out in method invocations, since the object may not be fully constructed.</message>
                <lineStart>83</lineStart>
                <lineEnd>83</lineEnd>
                <columnStart>44</columnStart>
                <columnEnd>44</columnEnd>
                <lineRanges/>
                <id>5ce72949-7dea-45e1-81e0-216a63784168</id>
                <description></description>
                <reference>23</reference>
                <origin>java</origin>
                <moduleName>Static Analysis Model and Parsers</moduleName>
                <packageName>edu.hm.hafner.analysis</packageName>
                <fileName>/var/data/workspace/pipeline-analysis-model/src/main/java/edu/hm/hafner/analysis/Report.java</fileName>
                <fingerprint>80C3F57B38248EC7695EF8BDFCA9F7A9</fingerprint>
              </issue>
          

          Ulli Hafner added a comment - I see. The intermediate reports with 8.4.1 and 9.0.0 do use a totally different format. This is the old (and 8.4.2.) format: <analysisReport plugin= "analysis-model-api@5.1.1" > <elements class= "linked-hash-set" > <issue> <category>ConstructorLeaksThis</category> <type>-</type> <severity>NORMAL</severity> <message>Constructors should not pass the &apos; this &apos; reference out in method invocations, since the object may not be fully constructed.</message> <lineStart>83</lineStart> <lineEnd>83</lineEnd> <columnStart>44</columnStart> <columnEnd>44</columnEnd> <lineRanges/> <id>5ce72949-7dea-45e1-81e0-216a63784168</id> <description></description> <reference>23</reference> <origin>java</origin> <moduleName>Static Analysis Model and Parsers</moduleName> <packageName>edu.hm.hafner.analysis</packageName> <fileName>/ var /data/workspace/pipeline-analysis-model/src/main/java/edu/hm/hafner/analysis/Report.java</fileName> <fingerprint>80C3F57B38248EC7695EF8BDFCA9F7A9</fingerprint> </issue>

          Ulli Hafner added a comment -

          So these are possible workarounds up to now:

          • Install warnings-ng 8.4.2 and analysis-model 9.0.0 and delete all builds that contain files with <analysisReport serialization="custom">
          • Install warnings-ng 8.4.2 and analysis-model 9.0.0 and overwrite files with <analysisReport serialization="custom"> with a file from one of your old builds (that contains <analysisReport plugin="analysis-model-api@9.0.0">)
          • Revert to warnings-ng 8.4.1 and analysis-model 9.0.0

          Ulli Hafner added a comment - So these are possible workarounds up to now: Install warnings-ng 8.4.2 and analysis-model 9.0.0 and delete all builds that contain files with <analysisReport serialization="custom"> Install warnings-ng 8.4.2 and analysis-model 9.0.0 and overwrite files with <analysisReport serialization="custom"> with a file from one of your old builds (that contains <analysisReport plugin="analysis-model-api@9.0.0"> ) Revert to warnings-ng 8.4.1 and analysis-model 9.0.0

          Petr Leitner added a comment -

          Any progress? Because i think this is NOT minor bug but critical bug. When ALL jobs failing and whole server is paralyzed it is not minor bug..

          Petr Leitner added a comment - Any progress? Because i think this is NOT minor bug but critical bug. When ALL jobs failing and whole server is paralyzed it is not minor bug..

          Ulli Hafner added a comment -

          Did you try one of the workarounds?

          Ulli Hafner added a comment - Did you try one of the workarounds?

          Petr Leitner added a comment -

          Yes, I confirm  "Revert to warnings-ng 8.4.1 and analysis-model 9.0.0" work for me. 

          Petr Leitner added a comment - Yes, I confirm  "Revert to warnings-ng 8.4.1 and analysis-model 9.0.0" work for me. 

          I had a similar problem with later versions, but got it solved already.

          I got this stack trace when using Warnings Next Generation Plugin 8.4.4 and Analysis Model API Plugin 9.2.1 on 2020-10-28, for build #69 of a branch whose previous build #68 had been done on 2020-02-03:

          java.lang.NullPointerException
            at java.util.AbstractCollection.addAll(AbstractCollection.java:343)
            at edu.hm.hafner.analysis.Report.copyProperties(Report.java:669)
            at edu.hm.hafner.analysis.Report.copyIssuesAndProperties(Report.java:661)
            at edu.hm.hafner.analysis.Report.addAll(Report.java:194)
            at io.jenkins.plugins.analysis.core.model.AnalysisResult.getIssues(AnalysisResult.java:413)
            at io.jenkins.plugins.analysis.core.model.AnalysisHistory$$Lambda$359/0000000000000000.apply(Unknown Source)
            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)
            at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$$Lambda$330/0000000000000000.run(Unknown Source)
            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:821)
          

          A commit on the branch soon triggered build #70, which failed with the same stack trace.

          I then downgraded Warnings Next Generation Plugin from 8.4.4 to 8.4.3 and Analysis Model API Plugin from 9.2.1 to 9.1.0, and started build #71, which succeeded.

          Finally, I upgraded Warnings Next Generation Plugin from 8.4.3 to 8.4.4 and Analysis Model API Plugin from 9.1.0 to 9.2.1, and started build #72, which succeeded, even though build #70 of the same commit had failed with the same plugin versions.

          So, the problem apparently still exists in the newer plugin versions in some way, but I got the branch building again, without having to delete any previous builds or edit XML files.

          Kalle Niemitalo added a comment - I had a similar problem with later versions, but got it solved already. I got this stack trace when using Warnings Next Generation Plugin  8.4.4 and Analysis Model API Plugin 9.2.1 on 2020-10-28, for build #69 of a branch whose previous build #68 had been done on 2020-02-03: java.lang.NullPointerException at java.util.AbstractCollection.addAll(AbstractCollection.java:343) at edu.hm.hafner.analysis.Report.copyProperties(Report.java:669) at edu.hm.hafner.analysis.Report.copyIssuesAndProperties(Report.java:661) at edu.hm.hafner.analysis.Report.addAll(Report.java:194) at io.jenkins.plugins.analysis.core.model.AnalysisResult.getIssues(AnalysisResult.java:413) at io.jenkins.plugins.analysis.core.model.AnalysisHistory$$Lambda$359/0000000000000000.apply(Unknown Source) 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) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$$Lambda$330/0000000000000000.run(Unknown Source) 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:821) A commit on the branch soon triggered build #70, which failed with the same stack trace. I then downgraded Warnings Next Generation Plugin from 8.4.4 to 8.4.3 and Analysis Model API Plugin from 9.2.1 to 9.1.0, and started build #71, which succeeded. Finally, I upgraded Warnings Next Generation Plugin from 8.4.3 to 8.4.4 and Analysis Model API Plugin from 9.1.0 to 9.2.1, and started build #72, which succeeded, even though build #70 of the same commit had failed with the same plugin versions. So, the problem apparently still exists in the newer plugin versions in some way, but I got the branch building again, without having to delete any previous builds or edit XML files.

          Ulli Hafner added a comment -

          kon Can you please file a new bug report for analysis-model? This is a different bug (though a similar exception). It needs to be fixed in analysis-model module.

          Ulli Hafner added a comment - kon Can you please file a new bug report for analysis-model? This is a different bug (though a similar exception). It needs to be fixed in analysis-model module.

          Kalle Niemitalo added a comment - - edited

          drulli OK, filed as JENKINS-64070.

          Kalle Niemitalo added a comment - - edited drulli OK, filed as JENKINS-64070 .

            drulli Ulli Hafner
            markewaite Mark Waite
            Votes:
            14 Vote for this issue
            Watchers:
            23 Start watching this issue

              Created:
              Updated:
              Resolved: