Unique key violation error when accessing Aagent workspace


Description

While accessing Agent workspace, the customer is getting an error as below (like the screenshot):

Error MessageUnique Key violation detected by database ((conn=306964) Duplicate entry '16fc89f81b76249036870f69cc4bcb28-48e395bc3b102300f1612c2b54efc46' for key 'agent')

Along with this, the Inbox will not show the statuses present, or the channels on which agents will be online.


Cause

For the Workspace, the available states are shown from the below URL config:
/awa_presence_state.do?sys_id=0b10223c57a313005baaaa65ef94f970

For this, in the Service Channels field, the entry for the Chat channel (sys_id 48e395bc3b102300f1612c2b54efc46f) might not be showing up on the slush bucket. But if Show XML is checked, it would be there.

This 48e395bc3b102300f1612c2b54efc46f belongs to awa_service_channel table, but chances are it might be missing on the impacted instance.

Resolution

To resolve this, bring this record from any of the working instances or from any OOB instance.