Symptoms
An attempt to remove a mailbox or distribution list from an Exchange user in CCP fails with the following error:
Duplicate key violates unique constraint 'mlabs_protected_emailsuni_0' while executing ''
or
Duplicate key violates unique constraint 'mlabs_protected_emailsuni_0' while executing ' UPDATE mlabs_protected_emails SET sync_status = ? , was_updated = ? WHERE recipient_id = ? AND recipient_type = ? AND sync_status != ?'.
The following error can be found in poa.debug.log:
Plesk::MessageLabs::OrganizationImpl::removeRecipientEmails] ===> ENTRY
Jul 24 17:14:14 PEMOSS01 : DBG [UI:fa4ab42a:1406218454006 1:8660:2134 Kernel]: STMT [Con: 150, 1235DFA8 txn:218584] ' UPDATE mlabs_protected_emails SET sync_status = ? , was_updated = ? WHERE recipient_id = ? AND recipient_type = ? AND sync_status != ?'($0 = 'd', $1 = 'y', $2 = 2776469, $3 = 'mbx', $4 = 'd')
Jul 24 17:14:14 PEMOSS01 : DBG [UI:fa4ab42a:1406218454006 1:8660:2134 Kernel]: [txn:218584 Plesk::DBS::checkSQLError] Diagnostic info about SQL error: sqlreturn=0 state=23000, nativeCode=2627, description=[Microsoft][SQL Server Native Client 10.0][SQL Server]Violation of UNIQUE KEY constraint 'mlabs_protected_emailsuni_0'. Cannot insert duplicate key in object 'dbo.mlabs_protected_emails'.
Jul 24 17:14:14 PEMOSS01 : DBG [UI:fa4ab42a:1406218454006 1:8660:2134 lib]: [txn:218584 Plesk::DBS::Statement::execQuery] {module_id="db_service"; code="110"} Duplicate key violates unique constraint 'mlabs_protected_emailsuni_0' while executing ' UPDATE mlabs_protected_emails SET sync_status = ? , was_updated = ? WHERE recipient_id = ? AND recipient_type = ? AND sync_status != ?'.
Jul 24 17:14:14 PEMOSS01 : DBG [UI:fa4ab42a:1406218454006 1:3212:2220 MessageLabs]: [txn:218584 Plesk::MessageLabs::OrganizationImpl::removeRecipientEmails] <=== EXIT (by exception) [0.046876]
Cause
Such duplicate records appear in OA database due to software-related issue #POA-62297.
It was fixed in Operations Automation 5.3. However, there can be remained records in the database that should be removed.
Resolution
Please contact Odin technical support to fix the database inconsistency.