Jira Data Pipeline Exports are Failing with Null Pointer Exception Error
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When attempting to perform Data Pipeline exports, they are failing with a Null Pointer Exception error, and the following stack trace is logged:
1
2
3
4
5
6
7
8
9
2023-03-29 09:19:22,263+0000 data-pipeline-export-executor-0 ERROR anonymous [c.a.b.i.core.service.DefaultDataExportOrchestrator] Failed writing entities to file - processId: 2
java.lang.NullPointerException
at com.atlassian.business.insights.jira.extract.issuelinks.IssueLinksExtractor.lambda$getIssueLinks$1(IssueLinksExtractor.java:56)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312)
Diagnosis
You should review the first line in the stack trace and make sure it's the same as in the example above. If it's different, then your export is failing due to a different error and you should stop here.
Cause
In this example, the specific portion of the code that's failing is retrieving the issue link type and the related Jira issue IDs:
1
2
3
4
5
6
7
8
9
issueLinkManager.getInwardLinks(issue.getId()).stream()
.map(issueLink ->
new IssueLinkDocument(issueLink.getDestinationId(),
issueLink.getSourceId(),
issueLink.getLinkTypeId(),
issueLink.getIssueLinkType().getInward(),
issueLink.getId()
)
)).collect(Collectors.toList());
Given that it's a NullPointerException, it is likely that there are some null values on the database for either theissuetypecolumn or for the source/destination issues in theissuelinktable, which holds the association for all issue links.
Run the following SQL queries in your database:
1
2
3
4
5
6
SELECT a.*
FROM issuelink a
LEFT OUTER JOIN
jiraissue b
ON a.source = b.id
WHERE B.id IS NULL;
If you get any outputs, then indeed you have an issue on the issuelink table with an empty source issue, leading to the NPE.
Solution
Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
You should delete the invalid issue link from the database. Make sure to have backups available in case the deletion goes wrong.
Use the following SQL query, replacing the ID column with the ID obtained in the query above:
1
delete from issuelink where id = <replace>
Then, attempt to perform the export again. No restart is required as this value is not cached on the application.
Was this helpful?