Re-index errors with a NullPointerException when entries is empty

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

  • While running an index, this stacktrace appears in your web browser:

    java.util.concurrent.ExecutionException: java.lang.NullPointerException
    Task completed in 18 seconds with unexpected error.
    Started Today 3:44 PM.
    Finished Today 3:45 PM.
    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:286)
    ...
    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)
    ... 23 more
    Caused by: java.lang.NullPointerException
    at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:187)
    at com.atlassian.jira.issue.changehistory.ChangeHistoryItem$Builder.on(ChangeHistoryItem.java:421)
    at com.atlassian.jira.issue.changehistory.DefaultChangeHistoryManager.getAllChangeItems(DefaultChangeHistoryManager.java:150)
    at com.atlassian.jira.issue.index.DefaultChangeHistoryRetriever.get(DefaultChangeHistoryRetriever.java:53)
    at com.atlassian.jira.issue.index.DefaultChangeHistoryRetriever.get(DefaultChangeHistoryRetriever.java:30)
    at com.atlassian.jira.issue.index.DefaultIssueIndexer$ChangeHistoryDocumentBuilder.get(DefaultIssueIndexer.java:487)
    ...
    
  • Looking in your atlassian-jira.log file there are no errors thrown.  Instead, you see that the index pre-emptively finished:

    2012-11-20 13:55:21,974 JiraTaskExectionThread-1 INFO admin 835x35x1 18gqvo7 1.1.1.1,127.0.0.1 /secure/admin/jira/IndexReIndex.jspa [action.admin.index.IndexAdminImpl] Re-indexing is 0% complete. Current index: Issue
    2012-11-20 13:55:21,974 JiraTaskExectionThread-1 INFO admin 835x35x1 18gqvo7 1.1.1.1,127.0.0.1 /secure/admin/jira/IndexReIndex.jspa [jira.issue.index.DefaultIndexManager] Reindexing all issues
    2012-11-20 13:55:37,475 IssueIndexer:thread-8 INFO admin 835x35x1 18gqvo7 1.1.1.1,127.0.0.1 /secure/admin/jira/IndexReIndex.jspa [action.admin.index.IndexAdminImpl] Re-indexing is 1% complete. Current index: Issue
    2012-11-20 13:55:41,138 IssueIndexer:thread-1 INFO admin 835x35x1 18gqvo7 1.1.1.1,127.0.0.1 /secure/admin/jira/IndexReIndex.jspa [action.admin.index.IndexAdminImpl] Re-indexing is 2% complete. Current index: Issue
    ...
    2012-11-20 13:56:01,120 IssueIndexer:thread-7 INFO admin 835x35x1 18gqvo7 1.1.1.1,127.0.0.1 /secure/admin/jira/IndexReIndex.jspa [action.admin.index.IndexAdminImpl] Re-indexing is 6% complete. Current index: Issue
    2012-11-20 13:56:03,261 IssueIndexer:thread-2 INFO admin 835x35x1 18gqvo7 1.1.1.1,127.0.0.1 /secure/admin/jira/IndexReIndex.jspa [action.admin.index.IndexAdminImpl] Re-indexing is 7% complete. Current index: Issue
    2012-11-20 13:56:03,894 JiraTaskExectionThread-1 INFO admin 835x35x1 18gqvo7 1.1.1.1,127.0.0.1 /secure/admin/jira/IndexReIndex.jspa [action.admin.index.IndexAdminImpl] Re-indexing finished

Cause

There is missing entries from JIRA's history tables.

Resolution

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

  1. Check for the NULL entries within JIRA's changegroup table:
    1. select * from changegroup where created is NULL;
       
      select * from changegroup where author is NULL;
    2. Any returned results indicate a problem, as all entries should have a corresponding date and username.
    3. May look like this:

        id   | issueid |  author  | created 
      -------+---------+----------+---------
       17340 |   14386 | admin    | 
       17352 |   14406 | admin    | 
       17355 |   14411 | admin    | 
       17370 |   14112 | admin    | 

      or

        id   | issueid |  author  | created 
      -------+---------+----------+---------
       17340 |   14386 |          | 2014-07-03 18:49:02.177+08
       17352 |   14406 |          | 2014-07-03 18:49:02.177+08
       17355 |   14411 |          | 2014-07-03 18:49:02.177+08
       17370 |   14112 |          | 2014-07-03 18:49:02.177+08
  2. Update the returned rows with a proper date value.
    1. Ensure that the formatting of the entries are correct. You can do this by simply comparing it to existing non-null values within the same table.
    2. Example proper entry:

        id   | issueid | author |          created           
      -------+---------+--------+----------------------------
       10000 |   10000 | admin  | 2012-11-13 12:10:53.149-08

Last modified on Mar 30, 2016

Was this helpful?

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