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

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

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.

*Fisheye および Crucible は除く

問題

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>.

原因

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;


出力

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).

ソリューション

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);

出力

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);

最終更新日 2022 年 8 月 26 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.