Re-Indexing fails with java.lang.NullPointerException on Link Type Indexing
症状
When trying to re-index JIRA, the below error is displayed.
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.
atlassian-jira.log
に次のエラーが返される。
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)
原因
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.
ソリューション
データベースの変更を行う場合は必ず事前にバックアップを取得してください。可能な場合は、まずステージング サーバーで SQL コマンドの変更、挿入、更新、または削除を行うようにします。
Find out which linking type is being affected:
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:
SELECT id, linkname from issuelinktype;
Update the corrupted entry to the link type from the previous SQL:
UPDATE issuelink SET linktype = <issuetlinktype_id> where id = <result_from_first_query>;
- Jira を停止します。
- Remove the
$JIRA_HOME/caches/indexes
directory. This will be rebuilt when JIRA is indexed again. - Jira を起動します。
The above SQL is for PostgreSQL and may need to be modified, depending on the type of database the JIRA instance uses.