JIRA indexing failure - 'The issue null has serious data integrity issues'

Still need help?

The Atlassian Community is here for you.

Ask the community

The queries on this page only apply if the instance is on a version prior to 6.1.  The pkey data is separated into new columns and the original is nullified as part of an upgrade task.  Please see https://developer.atlassian.com/display/JIRADEV/Preparing+for+JIRA+6.1#PreparingforJIRA6.1-editprojectkeydb for further information.

 

Symptoms

Attempting to index JIRA will fail with a java.lang.NullPointerException.

The following appears in the indexing screen:

java.util.concurrent.ExecutionException: java.lang.NullPointerException
Task completed in 17 minutes, 42 seconds with unexpected error.
Started Today 08:18 AM.
Finished Today 08:35 AM.
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)
   ...
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException
   at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
   at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at com.atlassian.jira.index.FutureResult.await(FutureResult.java:31)
   ...
Caused by: java.lang.NullPointerException
at java.util.ArrayList.addAll(ArrayList.java:472)
at com.atlassian.jira.issue.index.DefaultChangeHistoryRetriever.filterChangeItems(DefaultChangeHistoryRetriever.java:120)
at com.atlassian.jira.issue.index.DefaultChangeHistoryRetriever.createChangeGroupsFromChangeItems(DefaultChangeHistoryRetrieve

The following appears Using the Database Integrity Checker:

ERROR: ALF-14729 - The workflow entry with id 146727 has an incorrect state. (JRA-4241)
ERROR: null - The workflow entry with id 154773 has an incorrect state. (JRA-4241)
ERROR: null - The workflow entry with id 154772 has an incorrect state. (JRA-4241)
ERROR: null - The workflow entry with id 154771 has an incorrect state. (JRA-4241)
ERROR: null - The workflow entry with id 154770 has an incorrect state. (JRA-4241)
ERROR: null - The workflow entry with id 154769 has an incorrect state. (JRA-4241)
 
 
ERROR: null - The workflow entry with id 154762 does not have a corresponding current step. (JRA-4539)
ERROR: null - The workflow entry with id 154763 does not have a corresponding current step. (JRA-4539)
ERROR: null - The workflow entry with id 154764 does not have a corresponding current step. (JRA-4539)
ERROR: null - The workflow entry with id 154765 does not have a corresponding current step. (JRA-4539)
ERROR: null - The workflow entry with id 154766 does not have a corresponding current step. (JRA-4539)

The following appears in the atlassian-jira.log:

2012-09-11 06:22:35,085 IssueIndexer:thread-7 WARN xxxxxxx 360x7021178x1 1nl6hn8 82.0.214.230 /secure/admin/jira/IndexReIndex.jspa [jira.issue.history.AbstractDateRangeBuilder] The issue null has serious data integrity issues
java.lang.NullPointerException
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:187)
	at com.atlassian.jira.issue.changehistory.ChangeHistoryItem$Builder.on(ChangeHistoryItem.java:389)
	at com.atlassian.jira.issue.history.ReporterDateRangeBuilder.createInitialChangeItem(ReporterDateRangeBuilder.java:35)
	at com.atlassian.jira.issue.history.AbstractDateRangeBuilder.buildDateRanges(AbstractDateRangeBuilder.java:38)

Diagnosis

  • Using the Database Integrity Checker check if the JIRA instance is exhibited the same errors as above.
    • If you happen to encounter an error while running Integrity Checker, please see if it is a similar error and follow the workaround suggested  JRA-4714 - Getting issue details... STATUS  
  • Run the following SQL against the JIRA database to see if it returns issues:

    select * from jiraissue where pkey is null;

     

     

Cause

There are data integrity issues in the database due to a null issue key. It's currently unknown at this stage what causes this.

Workaround

This workaround will simulate the same process that is run by JIRA when deleting an issue.

Always back up your data before performing any modification to the database. If possible, try your modifications on a test server.

  1. Shutdown JIRA.
  2. Identify problematic issues with the below SQL:

    select * from jiraissue where pkey is null;
  3. Remove them from the database with the following queries:

    DELETE FROM jiraaction WHERE issueid in (<issue id from previous SQL>);
    DELETE FROM worklog WHERE issueid in (<issue id from previous SQL>);
    DELETE FROM changegroup WHERE issueid in (<issue id from previous SQL>);
    DELETE FROM nodeassociation WHERE SOURCE_NODE_ID in (<issue id from previous SQL>) AND SOURCE_NODE_ENTITY='Issue';
    DELETE FROM userassociation WHERE SINK_NODE_ID in (<issue id from previous SQL>) AND SINK_NODE_ENTITY='Issue';
    DELETE FROM customfieldvalue WHERE ISSUE in (<issue id from previous SQL>);
    DELETE FROM jiraissue WHERE ID in (<issue id from previous SQL>);
    DELETE FROM notificationinstance WHERE SOURCE in (<issue id from previous SQL>);

    For example:

    DELETE FROM jiraissue WHERE ID in (1234,5678,9101,2131);
  4. Start JIRA.
  5. Reindex JIRA, which will now complete successfully.
    (info) If there are any problems, restore the previous database backup immediately.

 

 

Last modified on Mar 30, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.