Troubleshooting Stuck Assets Re-index Caused by Duplicate Attribute Values Removal
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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 upgrading to 5.12+ and 5.16+, the Assets re-index might be stuck at a different percentage or very slow.
Environment
Jira Service Management 5.12+, 5.16+;
Diagnosis
Asset indexing does not complete and halts at different percentages.
Log files show warnings about duplicate object attributes:
2024-12-06 16:11:42,946+0100 insight-InsightThreadGroup-worker-thread-1 WARN Anonymous user [c.r.j.p.i.s.c.d.dao.sql.AbstractAOService] Found duplicate object attributes for object with id 1906545
Threads appear stuck while trying to resolve duplicates attribute values:
06-Dec-2024 16:45:16.006 WARNING [Catalina-utility-1] org.apache.catalina.valves.StuckThreadDetectionValve.notifyStuckThreadDetected Thread [https-jsse-nio-8443-exec-9...] has been active for [123,549] milliseconds and may be stuck (configured threshold for this StuckThreadDetectionValve is [120] seconds). There is/are [2] thread(s) in total that are monitored by this Valve and may be stuck. java.lang.Throwable at com.riadalabs.jira.plugins.insight.services.core.dal.impl.ObjectDalImpl.findDuplicateObjectAttributeValueIds(ObjectDalImpl.java:524) at com.riadalabs.jira.plugins.insight.services.core.dal.impl.ObjectDalImpl.removeDuplicates(ObjectDalImpl.java:464)
Cause
This issue is related to a bug identified in Jira 5.12+, 5.16+, referenced as: JSDSERVER-15551 - Getting issue details... STATUS
The bug causes Assets to attempt removing non-existent duplicate attributes during re-indexing, resulting in blocked threads.
Solution
Upgrade Jira Service Management to v.10.2.0+, where the issue is fixed.
Workaround
Add the following Dark Feature to disable duplicates handling during reindexing:
assets.index.dedupe.attributes.disabled
Do note, enabling this feature flag might result in duplicate attribute values after imports in the future.