Accessing JIRA Issue Results in 'Error Re-indexing Changes for Issue'

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

When attempting to access a specific issue in a JIRA instance, the request never returns and eventually times out. The following appears in the atlassian-jira.log:

1 2 3 4 5 2010-06-22 12:26:10,840 JiraQuartzScheduler_Worker-1 ERROR [event.listeners.search.IssueIndexListener] Error re-indexing changes for issue 'PRO-499' com.atlassian.jira.issue.index.IndexException: com.atlassian.bonnie.LuceneException: org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: SimpleFSLock@E:\jira_index\issues\write.lock at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexIssues(DefaultIndexManager.java:299) at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexIssues(DefaultIndexManager.java:252) at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexIssueObjects(DefaultIndexManager.java:260)

Cause

The above error occurs because there is a problem obtaining a lock on the index when attempting to re-index issue 'PRO-499'. When this error repeats frequently in a short period of time, the indicated issue is likely the problematic issue. It probably has an unreasonable number of comments attached to it.

For example, if an account assigned to an issue in JIRA has its e-mail account removed from the e-mail server, an indefinite e-mail loop can occur between the instance of JIRA and the mail system. If this continues unnoticed for a significant period of time, comments are almost continuously added to said issue and it can cause performance issues when trying to view the affected issue in JIRA. Usually, the request times out before it can be completed.

Resolution

Remove all unnecessary and automated comments from the issue:

Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

  1. Issue the following SQL command to determine the author of the comments:

    1 SELECT a.* FROM jiraaction a, jiraissue i WHERE a.issueid = i.id AND i.pkey = 'PRO-499' GROUP BY author;

    The result of this query will indicate which author has contributed the most comments to this issue. This is more than likely the author whose comments were automatically added as a result of an e-mail error / loop.

  2. Execute the following to remove comments by said author (be sure to replace <name of author> with appropriate value):

    1 2 3 4 DELETE FROM jiraaction WHERE actiontype = 'comment' AND author = <name of author> AND issueid IN (SELECT id FROM jiraissue)
  3. Re-index JIRA.

The previously inaccessible issue should now be accessible.

To mitigate future mailing loops

To prevent loops triggered by e-mail sent from an automated service (e.g. JIRA notification), "bulk" handler parameters should be set for the 'create issue/comment by email' service in JIRA.

To prevent mailing loops triggered by an undeliverable e-mail, appropriate e-mail pre-processing should be implemented. Setup a pre-process filter on the mail server. This will pre-process e-mails delivered to JIRA's listener mailboxes. The pre-process filter will remove 'unwanted' e-mails, including undeliverable failure messages, et cetera.

Updated on April 15, 2025

Still need help?

The Atlassian Community is here for you.