Application cannot be started in case of issues with the Device Detection database


Description

The application might crash during initialization if the Device Detection database is corrupted. The cause of the crash is an unhandled exception that is written to the Windows Event Log:

Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
   at FiftyOne.DeviceDetection.Hash.Engine.OnPremise.Interop.DeviceDetectionHashEngineModulePINVOKE.EngineHashSwig_process__SWIG_0(System.Runtime.InteropServices.HandleRef, System.Runtime.InteropServices.HandleRef)
   at FiftyOne.DeviceDetection.Hash.Engine.OnPremise.Interop.EngineHashSwig.process(FiftyOne.DeviceDetection.Hash.Engine.OnPremise.Interop.EvidenceDeviceDetectionSwig)
   at FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements.DeviceDetectionHashEngine.ProcessEngine(FiftyOne.Pipeline.Core.Data.IFlowData, FiftyOne.DeviceDetection.Hash.Engine.OnPremise.Data.IDeviceDataHash)
   at FiftyOne.Pipeline.Engines.FlowElements.AspectEngineBase`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].ProcessWithCache(FiftyOne.Pipeline.Core.Data.IFlowData)
   at FiftyOne.Pipeline.Core.FlowElements.FlowElementBase`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Process(FiftyOne.Pipeline.Core.Data.IFlowData)
   at FiftyOne.Pipeline.Core.FlowElements.Pipeline.Process(FiftyOne.Pipeline.Core.Data.IFlowData)
   at Sitecore.CES.DeviceDetection.Providers.FiftyOneDegrees.ProviderWrapperV4.ProcessFlowData(Sitecore.CES.DeviceDetection.Data.UserAgentClientHintsData)

Solution

To resolve the issue, consider the following options:

Alternatively, delete all the files under the /App_Data/DeviceDetection folder and restart the affected instances.