After upgrading JIRA indexing is disabled
Symptoms
After upgrading JIRA indexing is disabled, the following error appears in the screen:
The following appears in the atlassian-jira.log
:
2013-03-05 16:10:34,616 http-bio-8090-exec-13 WARN admin 970x217x1 1nazqu3 127.0.0.1 /secure/admin/IndexAdmin.jspa [jira.issue.index.IndexConsistencyUtils] Index consistency check failed for index 'Issue': com.atlassian.jira.issue.index.SearchUnavailableException: java.lang.IllegalStateException: Indexing is disabled.
OR
2014-06-20 10:39:23,781 localhost-startStop-1 ERROR [atlassian.jira.upgrade.ConsistencyCheckImpl] Indexing is turned on, but index path [/localdisk/var/jira/jira-index] invalid - disabling indexing
Diagnosis
Execute the query below and check the propertyvalue column. Values 0 means disabled and 1 means enabled:
select * from propertynumber where id in (select id from propertyentry where property_key = 'jira.path.index.use.default.directory' or property_key = 'jira.option.indexing');
Cause
Prior to JIRA 4.2 it was possible to customize the index path. Due to security improvements, this is no longer possible. This issue occurs when the new version of JIRA can not reach the customized index path. This error is similar to the one as described in How to fix a JIRA application that is unable to perform a background re-index "at this time error". There is a bug raised for this under JRASERVER-38845 - Migrating an instance can result in indexing being disabled.
Resolution
For JIRA 8.x and later 7.x versions, this property is no longer stored in the propertystring table and this modification will not work.
This value is also not stored in the jpm.xml file, and later versions of JIRA do not have a jira-config.properties file by default.
Always back up your data before performing any modification to the database. If possible, try your modifications on a test server.
- Shutdown JIRA.
Execute the update statement bellow:
update propertynumber set propertyvalue = 1 where id in (select id from propertyentry where property_key = 'jira.path.index.use.default.directory' or property_key = 'jira.option.indexing');
Restart JIRA.
If the index path is invalid:
Stop JIRA.
Execute the following to identify the index path:
select * from propertystring ps join propertyentry pe on ps.id = pe.id where property_key = 'jira.path.index';
This will output something like the following:
id | propertyvalue | id | entity_name | entity_id | property_key | propertytype -------+--------------------------------------------------------------+-------+-----------------+-----------+-----------------+-------------- 10007 | /Users/aquaman/deployments/avengers/jira-home/caches/indexes | 10007 | jira.properties | 1 | jira.path.index | 5
Update the database to the new directory is:
update propertystring set propertyvalue = '<index path>' where id = '<id from step 2>';
- Start JIRA.