[JIRA] (JENKINS-61293) NPE from second recordIssues step

38 views
Skip to first unread message

medianick@gmail.com (JIRA)

unread,
Mar 2, 2020, 10:43:03 AM3/2/20
to jenkinsc...@googlegroups.com
Nick Jones created an issue
 
Jenkins / Bug JENKINS-61293
NPE from second recordIssues step
Issue Type: Bug Bug
Assignee: Ulli Hafner
Components: warnings-ng-plugin
Created: 2020-03-02 15:42
Environment: Warnings Next Generation 8.0.0
Priority: Major Major
Reporter: Nick Jones

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?

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 2, 2020, 10:48:02 AM3/2/20
to jenkinsc...@googlegroups.com
Ulli Hafner commented on Bug JENKINS-61293
 
Re: NPE from second recordIssues step

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...

medianick@gmail.com (JIRA)

unread,
Mar 2, 2020, 11:04:03 AM3/2/20
to jenkinsc...@googlegroups.com

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.

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 2, 2020, 11:06:04 AM3/2/20
to jenkinsc...@googlegroups.com

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

medianick@gmail.com (JIRA)

unread,
Mar 2, 2020, 12:11:06 PM3/2/20
to jenkinsc...@googlegroups.com

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.)

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 2, 2020, 1:13:02 PM3/2/20
to jenkinsc...@googlegroups.com

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)?

medianick@gmail.com (JIRA)

unread,
Mar 2, 2020, 3:26:03 PM3/2/20
to jenkinsc...@googlegroups.com

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?

medianick@gmail.com (JIRA)

unread,
Mar 2, 2020, 3:40:03 PM3/2/20
to jenkinsc...@googlegroups.com

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

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 2, 2020, 4:13:03 PM3/2/20
to jenkinsc...@googlegroups.com
Ulli Hafner started work on Bug JENKINS-61293
 
Change By: Ulli Hafner
Status: Open In Progress

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 2, 2020, 4:30:04 PM3/2/20
to jenkinsc...@googlegroups.com

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>

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 2, 2020, 4:31:02 PM3/2/20
to jenkinsc...@googlegroups.com
Ulli Hafner edited a comment on Bug JENKINS-61293
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:
{code}

    <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>

{code}

medianick@gmail.com (JIRA)

unread,
Mar 2, 2020, 4:58:02 PM3/2/20
to jenkinsc...@googlegroups.com
Nick Jones updated an issue
 
Change By: Nick Jones
Attachment: open-tasks-new-issues.xml
Attachment: open-tasks-outstanding-issues.xml
Attachment: open-tasks-blames.xml
Attachment: open-tasks-fixed-issues.xml
Attachment: open-tasks-forensics.xml

medianick@gmail.com (JIRA)

unread,
Mar 2, 2020, 4:59:02 PM3/2/20
to jenkinsc...@googlegroups.com
Nick Jones commented on Bug JENKINS-61293
 
Re: NPE from second recordIssues step

Great suggestion, Ulli Hafner. 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.

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 3, 2020, 2:02:04 AM3/3/20
to jenkinsc...@googlegroups.com
Ulli Hafner updated an issue
 

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

Change By: Ulli Hafner
URL: https://github.com/jenkinsci/warnings-ng-plugin/pull/415

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 3, 2020, 2:54:02 AM3/3/20
to jenkinsc...@googlegroups.com

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 3, 2020, 3:24:02 AM3/3/20
to jenkinsc...@googlegroups.com

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 3, 2020, 3:24:03 AM3/3/20
to jenkinsc...@googlegroups.com

medianick@gmail.com (JIRA)

unread,
Mar 3, 2020, 9:38:02 AM3/3/20
to jenkinsc...@googlegroups.com
Nick Jones commented on Bug JENKINS-61293
 
Re: NPE from second recordIssues step

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

ullrich.hafner@gmail.com (JIRA)

unread,
Mar 3, 2020, 10:28:03 AM3/3/20
to jenkinsc...@googlegroups.com
Ulli Hafner closed an issue as Fixed
 
Change By: Ulli Hafner
Status: Resolved Closed
Reply all
Reply to author
Forward
0 new messages