Symptoms

Assume that a member of a distribution list is also a member of a Response Group service (RGS) agent group in a Microsoft Lync Server 2013 environment. When the member's SIP address is changed, all related changes are blocked from synchronizing from Active Directory to the RGS database. Also, event ID 31128 is logged as follows:

The following exception was thrown during the synchronization process:Exception: System.Data.SqlClient.SqlException - Cannot insert duplicate key row in object 'dbo.Agents' with unique index 'IXAgentsUserSid'. The duplicate key value is (0x0105000000000005150000009e7c5c00db5d97c850f8f9d046220000).The statement has been terminated.Inner Exception: ~The next synchronization attempt will be in 480 minutes.Cause: Unhandled exception.Resolution:Verify the connectivity with the domain controller or if the Active Directory schema was properly applied and all user attributes are present.

Additionally, users who were recently added to the RGS agent group experience the following issues:

Newly added users don't receive the 'You were added as an agent' notification.

Calls that are made to the RGS workflow aren't routed to the newly added RGS agent.

Cause

This issue occurs because the SIP address change prevents RGS from referencing the agent. However, the RGS database indexes agents by using their SIP addresses.