Update status on any ticket with rest call /rest/api/2/issue/<issueid>/comment throws IndexingFailureException

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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

Whenever a ticket is updated through rest endpoints, the action is not completed and errors with IndexingFailureException. The error on the application logs can be observed as follows:  

http-nio-8080-exec-25 ERROR kadamson 491x1406560x1 191asph 10.98.72.5,10.98.28.150 /rest/api/2/issue/GEN-57649/comment [c.a.event.internal.AsynchronousAbleEventDispatcher] There was an exception thrown trying to dispatch event [com.atlassian.jira.event.comment.CommentCreatedEvent@7995e329] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.onresolve.jira.groovy.jql.OutdatedLastCommentReindexer.onCommentCreated(com.atlassian.jira.event.comment.CommentCreatedEvent), listener=com.onresolve.jira.groovy.jql.OutdatedLastCommentReindexer@5cc58032}]
java.lang.RuntimeException: Indexing completed with 1 errors. Listener: com.onresolve.jira.groovy.jql.OutdatedLastCommentReindexer event: com.atlassian.jira.event.comment.CommentCreatedEvent
.......
.......
Caused by: com.atlassian.jira.index.IndexingFailureException: Indexing completed with 1 errors
com.atlassian.jira.index.AccumulatingResultBuilder$CompositeResult.await(AccumulatingResultBuilder.java:189)
com.atlassian.jira.issue.index.DefaultIndexManager.obtain(DefaultIndexManager.java:896)
com.atlassian.jira.issue.index.DefaultIndexManager.await(DefaultIndexManager.java:876)

Environment

Jira 8.10.x and above.

Diagnosis

The issue was found to occur always associated with ScriptRunner for Jira, whenever listener for OutdatedLastCommentReindexer fires for the CommentCreatedEvent. There was an error with re-indexing one of the scriptrunner related field with a message such as below:

[c.a.jira.index.AccumulatingResultBuilder] DocValuesField "sr_sort_comment_created" appears more than once in this document (only one value is allowed per field)
java.lang.IllegalArgumentException: DocValuesField "sr_sort_comment_created" appears more than once in this document (only one value is allowed per field)
org.apache.lucene.index.NumericDocValuesWriter.addValue(NumericDocValuesWriter.java:55)
org.apache.lucene.index.DefaultIndexingChain.indexDocValue(DefaultIndexingChain.java:536)
org.apache.lucene.index.DefaultIndexingChain.processField(DefaultIndexingChain.java:466)

Cause

The problem occurs from Scriptrunner which causes duplicate fields from multiple issueFunction fields owing to a past bug. A similar error has been documented in the scriptrunner KB appears-more-than-once-in-this-document.

Solution 1:

The problem can has been found to be resolved in one of the following ways.

  1. Disable Scriptrunner and re-enable scriptrunner or clear the Scriptrunner cache as suggested under Clear groovy caches.
  2. Utilize the Scriptrunner script in the KB provided on their site to clear up the duplicate issuefunction field.

Solution 2:

If the Solution 1 doesn't work for you, you can try the solve the issue with the below steps. If you still couldn't solve the problem with these steps, please reach out to Adaptavist Support Team to report your problem.

  1. Disable the Scriptrunner plugin.
  2. Shutdown JIRA.
  3. Backup your Index folder (You can find this folder under Administration>System>Indexing).
  4. Go to Index Folder and delete all index folders.
  5. Start JIRA.
  6. Perform re-indexing.
  7. Re-enable the script runner plugin.


Last modified on Oct 14, 2022

Was this helpful?

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