NullPointerException on Crucible Review re-index

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

The following error appears in the logs when attempting a review re-index:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 [java] 2012-06-22 17:59:45,611 ERROR - Error indexing review [java] java.lang.NullPointerException [java] at com.atlassian.crucible.activity.lucene.DefaultReviewItemIndexer.indexLogItem(DefaultReviewItemIndexer.java:549) [java] at com.atlassian.crucible.activity.lucene.DefaultReviewItemIndexer.access$600(DefaultReviewItemIndexer.java:86) [java] at com.atlassian.crucible.activity.lucene.DefaultReviewItemIndexer$IndexOperationIterator.doNext(DefaultReviewItemIndexer.java:243) [java] at com.atlassian.crucible.activity.lucene.DefaultReviewItemIndexer$2.perform(DefaultReviewItemIndexer.java:357) [java] at com.atlassian.crucible.activity.lucene.DefaultReviewItemIndexer$2.perform(DefaultReviewItemIndexer.java:353) [java] at com.cenqua.fisheye.lucene.LuceneConnection.withWriter(LuceneConnection.java:557) [java] at com.atlassian.crucible.activity.lucene.DefaultReviewItemIndexer.indexInBatches(DefaultReviewItemIndexer.java:353) [java] at com.atlassian.crucible.activity.lucene.DefaultReviewItemIndexer.access$800(DefaultReviewItemIndexer.java:86) [java] at com.atlassian.crucible.activity.lucene.DefaultReviewItemIndexer$3.run(DefaultReviewItemIndexer.java:603) [java] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [java] at java.lang.Thread.run(Thread.java:680)

Cause

The CRU_LOGITEM table contains events for user IDs that do not exist. An earlier version of the scripts that fix this issue with _old1 usernames did not update the CRU_LOGITEM table.

Workaround

The following SQL query will delete any logitems created by users which do not exist in the user table:

1 2 3 4 DELETE FROM CRU_LOGITEM WHERE (cru_user_id NOT IN (SELECT cru_user_id FROM cru_user)) AND (cru_action IN ('REVIEW_REVIEWER_ADDED_MID_REVIEW', 'REVIEW_REVIEWER_REMOVED_MID_REVIEW'))

Alternatively, this SQL query can be used to update any records in the log item table to point to a dummy user ID:

1 2 3 4 5 UPDATE CRU_LOGITEM SET cru_user_id = [NEW_UID] WHERE (cru_user_id NOT IN (SELECT cru_user_id FROM cru_user)) AND (cru_action IN ('REVIEW_REVIEWER_ADDED_MID_REVIEW', 'REVIEW_REVIEWER_REMOVED_MID_REVIEW'))

Resolution

Upgrade to the latest version of Fisheye/Crucible (2.7.15 or 2.8). Later versions contain a fix which will ignore the invalid log entries on re-index.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.