Somewhere along the line, Sitecore decided to include device detection as part of the vanilla Sitecore offering instead of a paid add-on service. This transition did not come without issues.
Problems related to device detection and Sitecore Analytics appear to occur in instances of Sitecore XP 9.0 rev. 171002 (Initial Release) and SItecore XP 9.0 rev. 171219 (Update-1). Most developers spotting this issue for the first time will see the following errors in the Sitecore log.
WARN Authentication on CES Discovery service failed.
Message: The remote server returned an error: (403) Forbidden.
at Sitecore.CES.Client.WebClient.Execute[T](Func`1 action, String requestUri)
at Sitecore.CES.Client.ResourceConnector`1.Request(String endpoint, Object parameters)
at Sitecore.CES.Discovery.EndpointSource.GetEndpoint(String serviceName)
ERROR Could not update device detection database
Message: Null ids are not allowed.
Parameter name: endpointUri
at Sitecore.Diagnostics.Assert.ArgumentNotNullOrEmpty(String argument, String argumentName)
at Sitecore.CES.Client.WebClient.DownloadBinaryContent(String endpointUri, String resourcePath, DownladBinaryContentParameters parameters)
at Sitecore.CES.DeviceDetection.Providers.FiftyOneDegrees.FiftyOneDeviceDetectionClient.DoUpdate(String serviceName, String& newDatabasePath, String& newDatabaseVersion)
The simplest solution is to simply disable device detection via a Sitecore config patch or spot replacement in the default config file (not recommended). However, this has the potential to produce issues if your site is making use of device detection and can also cause suspect analytics data to come through which can be jarring for clients relying on the analytics data.
Sitecore has had an official hotfix since February 2018, meaning that many instances are still plagued with this issue.
The hotfix is an updated version of Sitecore.CES.dll.
On single instance installs, this hotfix will likely fix your issue. Simply install the package via the Package Installer GUI. Make sure you're installing the right package. This hotfix in particular is a .zip file containing a readme file and another .zip file. If you install the top level zip, you will be given the impression that the fix was installed successfully, when in reality nothing has occurred. When you proceed through the package install process the package should see the package information fields populated:
However, more work is required for more complex instances.
Azure App Services / PaaS / ARM Templates / Sitecore Managed Cloud
More complex instances of Sitecore will include various App Services. Installing the hotfix package via the GUI is not enough.
Replace the Sitecore.CES.dll in all App Services that contain the file. The following are a good starting point.
One easy way to update these files on Azure is to use the App Service Editor. An easy way to navigate to the file system and directly to the problematic DLL is via your web browser using the following URL:
From there you will easily be able to right click the bin folder and upload and replace the fixed DLL in one swift action.
Log In, Log Out (KEY!)
After applying the fix in all locations, make sure to log out of Sitecore and back in again. We've witnessed several occasions where this step was missed, giving the developer the impression that the hotfix did not work.
Once the fix has been properly applied, none of your Sitecore logs will show device detection errors. Additionaly, all Sitecore Analytics should be working as expected. If this is not the case, ensure that you've completed all of the steps.
Good luck out there,