Original Submission Not sure if you have noticed but several SQL errors are reported when a project is migrated to Gerrit. Here is as example:
STATEMENT: INSERT INTO account_group_members (account_id, group_id) SELECT A.account_id, G.group_id FROM account_external_ids A, account_groups G WHERE A.external_id='username:evlacan' AND G.name='patrick/testers-2'
ERROR: duplicate key value violates unique constraint "account_group_members_pkey"
DETAIL: Key (account_id, group_id)=(1000008, 13) already exists.
STATEMENT: INSERT INTO account_group_members (account_id, group_id) SELECT A.account_id, G.group_id FROM account_external_ids A, account_groups G WHERE A.external_id='username:lmcnale' AND G.name='patrick/testers-2'
ERROR: duplicate key value violates unique constraint "account_group_members_pkey"
DETAIL: Key (account_id, group_id)=(1000000, 13) already exists.
STATEMENT: INSERT INTO account_group_members (account_id, group_id) SELECT A.account_id, G.group_id FROM account_external_ids A, account_groups G WHERE A.external_id='username:lmcpare' AND G.name='patrick/testers-2'
ERROR: duplicate key value violates unique constraint "account_group_members_pkey"
DETAIL: Key (account_id, group_id)=(1000010, 13) already exists.
STATEMENT: INSERT INTO account_group_members (account_id, group_id) SELECT A.account_id, G.group_id FROM account_external_ids A, account_groups G WHERE A.external_id='username:lmcpcar' AND G.name='patrick/testers-2'
I suspect this happens because Tuleap brutally attempts to add users to groups without first checking if the said users are already members of the target group. Luckily this causes no harm to the data integrity but it should be avoided.
This happens when migrating subsequent repos from a given project. Obviously it does not happen when migrating the very first repo of a project.