Issue Type: Bug Bug
Affects Versions: current
Assignee: Tomas Westling
Attachments: bfa-npe-cropped.png, bfa-npe-stacktrace.txt
Components: build-failure-analyzer
Created: 31/Jul/14 9:40 AM
Description:

We experience NullPointerExceptions when Build Failure Analyzer Plugin tries to analyze failures of non-existent downstream builds.

To reproduce this error, create a job with a downstream project (a Parameterized Trigger Plugin build step will do as well). Let the downstream project fail (for example with "Shell execute -> exit 1").

Start the job which triggers the failing job and then delete the build of the triggered, now failed job. Browse to the overview of the trigger job and it should look something like this:

The relevant part of the stacktrace (which is also attached) is this:

Caused by: java.lang.NullPointerException
	at java.util.TreeMap.compare(TreeMap.java:1188)
	at java.util.TreeMap.put(TreeMap.java:531)
	at java.util.TreeSet.add(TreeSet.java:255)
	at java.util.AbstractCollection.addAll(AbstractCollection.java:334)
	at java.util.TreeSet.addAll(TreeSet.java:312)
	at com.sonyericsson.jenkins.plugins.bfa.model.FailureCauseBuildAction.getDownstreamBuilds(FailureCauseBuildAction.java:345)

The error occurs, because the triggered downstream build is missing and therefore null in the list returned by dbf.getDownstreamBuilds(build) in the code of FailureCauseBuildAction.
Subsequently the TreeSet.addAll() method tries to compare this null value to another entry and this results in the NullPointerException.

I have already created a quick and dirty fix for that, where the null values are filtered out in the FailureCauseBuildAction.getDownstreamBuilds() method. But a probably better way to fix this, would be to not add the null values in CoreDBF.getDownstreamBuilds() in the first place.

Nevertheless I will provide my fix as a pull request.

By the way: This error is mainly caused by the fact that we discard old builds. A workaround for that would be to increase the kept builds or not throwing away the builds of downstream projects.

Environment: JDK7, Jenkins LTS 1.554.3, BFA 1.9.1
Project: Jenkins
Labels: plugin
Priority: Minor Minor
Reporter: Stefan Eder
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to