DeviceProfile conflict exception


Description

An exception can occur when two sessions of the same contact are expired at the same time. If this happens, device data is saved to the database by the first session and cannot be saved by the second one because the concurrency token has already been updated. The following exception is written to the log file:

11:53:44 ERROR PostSessionEndPipeline failed.
Exception: Sitecore.XConnect.Operations.EntityOperationException
Message: Operation #0, Conflict, DeviceProfile {c8b3cd10-631e-4c0d-9efe-53e8b7a1b97b}
Source: Sitecore.Xdb.Common.Web
   at Sitecore.Xdb.Common.Web.Synchronous.SynchronousExtensions.SuspendContextLock[TResult](Func`1 taskFactory)
   at Sitecore.XConnect.Client.XConnectSynchronousExtensions.SuspendContextLock(Func`1 taskFactory)
   at Sitecore.Analytics.XConnect.DataAccess.XConnectDataAdapterProvider.<>c__DisplayClass25_0.<savedevice>b__1(IXdbContext xdbContext)
   at Sitecore.Analytics.XConnect.DataAccess.XConnectDataAdapterProvider.<>c__DisplayClass31_0.<executewithexceptionhandling>b__0(IXdbContext c)
   at Sitecore.Analytics.XConnect.DataAccess.XConnectDataAdapterProvider.ExecuteWithExceptionHandling[T](Func`2 func)
   at Sitecore.Analytics.XConnect.Diagnostics.PerformanceCounters.OperationPerformanceMonitorExtensions.<>c__DisplayClass1_0.<monitor>b__0()
   at Sitecore.Analytics.XConnect.Diagnostics.PerformanceCounters.OperationPerformanceMonitorExtensions.Monitor[T](OperationPerformanceMonitorBase monitor, Func`1 operation)
   at Sitecore.Analytics.XConnect.DataAccess.XConnectDataAdapterProvider.SaveDevice(DeviceData deviceData)
   at Sitecore.Analytics.DataAccess.Dictionaries.AverageCounterExtensions.<>c__DisplayClass1_0.<measuremilliseconds>b__0()
   at Sitecore.Analytics.DataAccess.Dictionaries.AverageCounterExtensions.MeasureMilliseconds[T](AverageCounter counter, Func`1 func)
   at Sitecore.Analytics.DataAccess.Dictionaries.ReferenceDataDictionary`2.Put(TValue value)
   at Sitecore.Analytics.Pipelines.SubmitSessionContext.SaveDevice.Process(SubmitSessionContextArgs args)

Solution

To resolve the issue:

Be aware that the hotfixes are built for specific Sitecore XP versions, and must not be installed on other Sitecore XP versions or in combination with other hotfixes. If any other hotfixes have already been installed on a certain Sitecore XP instance, send a request for a compatibility check to Sitecore Support.

Note that you must extract the ZIP file contents to locate installation instructions and related files inside. You must install the hotfixes on a CM instance and then synced with other instances using standard development practices.