Logs are full of DVCS Sync warnings: "found more than one match for"

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

Problem

When syncing a DVCS Account (Bitbucket Cloud, Github, Github Enterprise), JIRA throws a lot of warnings and the sync may fail intermittently:

2018-06-13 09:26:55,367 DVCSConnector.MessageExecutor:thread-1 WARN anonymous 574x1658718x1 qhlua0 10.0.0.108 /rest/bitbucket/1.0/repository/579/sync [c.a.j.p.d.dao.impl.MessageQueueItemAoDaoImpl] found more than one match for 956 com.atlassian.jira.plugins.dvcs.sync.BitbucketSynchronizeActivityMessageConsumer
2018-06-13 09:26:55,367 DVCSConnector.MessageExecutor:thread-1 WARN anonymous 574x1658718x1 qhlua0 10.0.0.108 /rest/bitbucket/1.0/repository/579/sync [c.a.j.p.d.dao.impl.MessageQueueItemAoDaoImpl] found more than one match for 957 com.atlassian.jira.plugins.dvcs.sync.BitbucketSynchronizeActivityMessageConsumer

The key phrase here is found more than one match for <Message_ID>.

Cause

There are duplicate Sync entries for individual message IDs in the database. This SQL query can be run to find them out:

Query (MySQL)
SELECT message_id, queue, count(3) FROM AO_E8B6CC_MESSAGE_QUEUE_ITEM GROUP BY message_id, queue HAVING count(3) > 1;
Query (PostgreSQL)
select "MESSAGE_ID", "QUEUE", count(3) from "AO_E8B6CC_MESSAGE_QUEUE_ITEM" as ao group by ao."MESSAGE_ID", ao."QUEUE" having count(3) >1;


Output

SELECT message_id, queue, count(3) FROM AO_E8B6CC_MESSAGE_QUEUE_ITEM GROUP BY message_id, queue HAVING count(3) > 1;
+------------+----------------------------------------------------------------------------------+----------+
| message_id | queue                                                                            | count(3) |
+------------+----------------------------------------------------------------------------------+----------+
|        956 | com.atlassian.jira.plugins.dvcs.sync.BitbucketSynchronizeActivityMessageConsumer |        2 |
+------------+----------------------------------------------------------------------------------+----------+
|        957 | com.atlassian.jira.plugins.dvcs.sync.BitbucketSynchronizeActivityMessageConsumer |        3 |
+------------+----------------------------------------------------------------------------------+----------+
2 rows in set (0.00 sec)

In this specific example, there are 2 entries for message ID 956 and 3 entries for message ID 957 in the same queue BitbucketSynchronizeActivity. JIRA will throw a lot of warnings for these in the logs.

The sync may fail if there are too many duplicate entries (JIRA keeps retrying probably leading to Rate Limit Exceeded).

Resolution

Upon identifying the message IDs with duplicate entries, run this query to list them down (replace 956 and 957 with the right message IDs identified above):

Query (MySQL)
SELECT message_id, queue, id FROM AO_E8B6CC_MESSAGE_QUEUE_ITEM WHERE message_id IN (956, 957);
Query (PostgreSQL)
SELECT "MESSAGE_ID","QUEUE","ID" FROM "AO_E8B6CC_MESSAGE_QUEUE_ITEM" WHERE "MESSAGE_ID" IN (956, 957);

Output

SELECT message_id, queue, id FROM AO_E8B6CC_MESSAGE_QUEUE_ITEM WHERE message_id IN (956, 957);
+------------+----------------------------------------------------------------------------------+----------+
| message_id | queue                                                                            | id       |
+------------+----------------------------------------------------------------------------------+----------+
|        956 | com.atlassian.jira.plugins.dvcs.sync.BitbucketSynchronizeActivityMessageConsumer |    10002 |
+------------+----------------------------------------------------------------------------------+----------+
|        956 | com.atlassian.jira.plugins.dvcs.sync.BitbucketSynchronizeActivityMessageConsumer |    10003 |
+------------+----------------------------------------------------------------------------------+----------+
|        957 | com.atlassian.jira.plugins.dvcs.sync.BitbucketSynchronizeActivityMessageConsumer |    20004 |
+------------+----------------------------------------------------------------------------------+----------+
|        957 | com.atlassian.jira.plugins.dvcs.sync.BitbucketSynchronizeActivityMessageConsumer |    20005 |
+------------+----------------------------------------------------------------------------------+----------+
|        957 | com.atlassian.jira.plugins.dvcs.sync.BitbucketSynchronizeActivityMessageConsumer |    20006 |
+------------+----------------------------------------------------------------------------------+----------+
5 rows in set (0.00 sec)

Delete all the duplicate entries with older (smaller) IDs (keep only 1 entry for each message ID) then restart JIRA. In this example 10002, 20004, and 20005 are to be deleted:

Query (MySQL)
DELETE FROM AO_E8B6CC_MESSAGE_QUEUE_ITEM WHERE id IN (10002, 20004, 20005);
Query (PostgreSQL)
DELETE FROM "AO_E8B6CC_MESSAGE_QUEUE_ITEM" WHERE "ID" IN (10002, 20004, 20005);

Last modified on Aug 26, 2022

Was this helpful?

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