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

This article only applies to Atlassian's server products. Learn more about the differences between cloud and server.

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:

select message_id, queue, count(3) from AO_E8B6CC_MESSAGE_QUEUE_ITEM group by message_id, queue having count(3) > 1;

Output

mysql> 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):

select message_id, queue, id from AO_E8B6CC_MESSAGE_QUEUE_ITEM where message_id in (956, 957);

Output

mysql> 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:

delete from AO_E8B6CC_MESSAGE_QUEUE_ITEM where id in (10002, 20004, 20005);

Last modified on May 6, 2019

Was this helpful?

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