Re-indexing is taking over an hour after upgrade from Jira 7.7.0 to 8.x versions

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

Summary

After an upgrade from Jira 7.7.0 to any version of Jira higher than 8.0, the reindex progress is not moving forward and spends hours in 1% status.

Environment

All Jira 8 versions and upwards.

Diagnosis

We can see from the atlassian-jira.log that there isn't a complete index available after the upgrade. The index is in a state of inconsistency:

1 2021-05-27 22:10:47,022-0400 Structure-Jobs49a07818 Queue-Thread#7 WARN anonymous [c.a.j.issue.index.IndexConsistencyUtils] Index consistency check failed for index 'Issue': expectedCount=61085; actualCount=19329

When trying to perform a Full Reindex, Jira is running into a ScriptRunner error to load custom fields with Scriptrunner's ComponentManager:

1 2 3 4 5 6 2021-06-01 07:51:41,354-0400 JiraTaskExecutionThread-12 ERROR admin 462x121189x1 test1 /secure/admin/IndexReIndex!reindex.jspa [c.o.scriptrunner.customfield.GroovyCustomField] ************************************************************************************* 2021-06-01 07:51:41,354-0400 JiraTaskExecutionThread-12 ERROR admin 462x121189x1 test1 /secure/admin/IndexReIndex!reindex.jspa [c.o.scriptrunner.customfield.GroovyCustomField] Script field failed on issue: TEST-1234, field: Last Comment org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script93274.groovy: 1: unable to resolve class com.atlassian.jira.ComponentManager @ line 1, column 1. import com.atlassian.jira.ComponentManager

Cause

ComponentManager has been deprecated since JIRA 7.11, which is the reason that this class cannot be resolved in Jira 8.x versions any longer.

The ScriptRunner error will not prevent the index from starting or completing, however, it will contribute to log spam and slow down the reindex.

Workaround

Please follow best practices for Change Management and test and validate these settings in a Test/Development and Staging environment prior to rolling any changes into a Production environment. This is to validate these changes and ensure that they will function well within your infrastructure prior to placing these changes in production.

1. Visit Jira Admin -> Manage Apps -> Manage Apps.

2. Find ScriptRunner in the list, then Disable it.

3. Perform the Full Reindex again.

4. Once the reindex is finished, re-enable ScriptRunner.

Check if the reindex progress is faster with ScriptRunner disabled. This may result in the index proceeding, but ScriptRunner fields won't be added to the index and, therefore, may not be available in search results. Therefore, to fully workaround the issue we recommend:

5. Visit Jira Admin > Apps > Script Runner > Browse.

6. Click Fields.

7. Locate any Scripted Custom fields that include com.atlassian.jira.ComponentManager.

8. Update or temporarily remove these scripts.

9. Perform the Full Reindex again.

Solution

ScriptRunner's vendor Adaptavist recommends migrating all scripts that still use com.atlassian.jira.ComponentManager to ComponentAccessor.

For support on how to migrate and re-write the code, we recommend reaching out to Adaptavist.

Updated on March 18, 2025

Still need help?

The Atlassian Community is here for you.