Re-Indexing fails with java.lang.NullPointerException on Link Type Indexing
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
Symptoms
When trying to re-index JIRA, the below error is displayed.
1
2
3
4
java.util.concurrent.ExecutionException: java.lang.NullPointerException
Task completed in 5 seconds with unexpected error.
Started Today 11:07 AM.
Finished Today 11:07 AM.
The following appears in the atlassian-jira.log
:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2012-06-14 09:40:13,374 main ERROR [atlassian.jira.upgrade.UpgradeManagerImpl] Exception thrown during upgrade: java.util.concurrent.ExecutionException: java.lang.NullPointerException
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException
at com.atlassian.jira.index.FutureResult.await(FutureResult.java:35)
at com.atlassian.jira.index.CompositeResultBuilder$CompositeResult.await(CompositeResultBuilder.java:82)
at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexAll(DefaultIndexManager.java:257)
...
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at com.atlassian.jira.index.FutureResult.await(FutureResult.java:31)
...
Caused by: java.lang.NullPointerException
at com.atlassian.jira.issue.index.indexers.impl.SubTaskIndexer.addIndex(SubTaskIndexer.java:54)
at com.atlassian.jira.issue.index.IssueDocument.getDocument(IssueDocument.java:40)
at com.atlassian.jira.issue.index.DefaultIssueDocumentFactory.get(DefaultIssueDocumentFactory.java:15)
Cause
The link type for a sub-task is not linked together correctly. The Zephyr for JIRA (v.1.7) plugin has logic in it which will check for, and create a issueLinkType "Relates". It also creates a link using the id 10003, which can cause errors if these links have been renamed or changed.
Resolution
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.
Find out which linking type is being affected:
1
SELECT * from issuelink where linktype NOT IN (SELECT id from issuelinktype);
Check the current link types to see which one to assign to the corrupted entry. They can be identified with the below:
1
SELECT id, linkname from issuelinktype;
Update the corrupted entry to the link type from the previous SQL:
1
UPDATE issuelink SET linktype = <issuetlinktype_id> where id = <result_from_first_query>;
Stop JIRA.
Remove the
$JIRA_HOME/caches/indexes
directory. This will be rebuilt when JIRA is indexed again.Start JIRA.
ℹ️ The above SQL is for PostgreSQL and may need to be modified, depending on the type of database the JIRA instance uses.
Was this helpful?