Error when saving a contact to xDB


Description

The following message might be found in the xConnect logs after a contact has been trying to be saved to xDB:

ERROR General error when submitting contact.
Exception: Sitecore.XConnect.Operations.FacetOperationException
Message: Operation #0, AlreadyExists, <ContactId>, Classification
Source: Sitecore.Xdb.Common.Web

or

[TIMESTAMP value] [Error] Sitecore.XConnect.Operations.AddContactOperation: Sitecore.XConnect.Operations.EntityOperationException: Operation #0, AlreadyExists, Contact
[TIMESTAMP value] [Error] Sitecore.XConnect.Operations.SetFacetOperation`1[Sitecore.XConnect.Facet]: Sitecore.XConnect.Operations.FacetOperationException: Operation #1, ReferenceNotFound, Contact, Classification
[TIMESTAMP value] [Error] ["XdbContextLoggingPlugin"] XdbContext Batch Execution Exception
Sitecore.XConnect.Operations.EntityOperationException: Operation #0, AlreadyExists, Contact
[TIMESTAMP value] [Error] ["XdbContextLoggingPlugin"] XdbContext Batch Execution Exception
Sitecore.XConnect.Operations.FacetOperationException: Operation #1, ReferenceNotFound, Contact, Classification

Solution

  1. Check if the shared session state is configured in accordance with the article (see the Session state configuration scenarios section).
  2. Check if a custom code (if any) that saves or modifies contacts also reloads them into the session as described here (see the Re-loading contact data section).
  3. Download and install the hotfix compatible with the affected product version:
    Be aware that the hotfixes were built for the specific Sitecore XP versions and must not be installed on other Sitecore XP versions or in combination with other hotfixes.

    Note that the ZIP file contents must be extracted to locate installation instructions and related files inside. The hotfix must be installed on a CM instance and then synced with other instances using standard development practices.

    Before installation:
    1. Make sure that you do not have any other hotfixes related to the following dlls:
      • \bin\Sitecore.Analytics.DataAccess.dll
      • \bin\Sitecore.Analytics.dll
      • \bin\Sitecore.Analytics.OmniChannel.dll
      • \bin\Sitecore.Analytics.XConnect.dll
      • \bin\Sitecore.Xdb.Tracking.Client.dll
      In case any other hotfixes have already been installed on a certain Sitecore XP instance, send a request for a compatibility check to Sitecore Support.
    2. Uninstall the Sitecore.Support.Diagnostics.AlreadyExists diagnostics (if any).