0

I'm seeing this error on my CMS server not able to pin point what exactly its trying to do.

Sitecore version 9.3

6604 10:32:45 ERROR Error in Mobile device processing.
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Sitecore.Reflection.ReflectionUtil.CreateObject(Type type)
   at Sitecore.Rules.DefaultRuleFactory.GetRuleCondition[T](Database database, XElement element)
   at Sitecore.Rules.DefaultRuleFactory.GetRuleConditionFactor[T](Database database, XElement element)
   at Sitecore.Rules.DefaultRuleFactory.GetRuleConditionFactor[T](Database database, XElement element)
   at Sitecore.Rules.DefaultRuleFactory.GetRuleConditions[T](Database database, XElement element, Rule`1 result)
   at Sitecore.Rules.DefaultRuleFactory.GetRule[T](Database database, XElement element)
   at Sitecore.Rules.DefaultRuleFactory.ParseRules[T](Database database, XElement node)
   at Sitecore.Rules.DefaultRuleFactory.GetRules[T](Field field)
   at Sitecore.Rules.DefaultRuleFactory.GetRules[T](IEnumerable`1 items, String fieldName)
   at Sitecore.Data.Items.DeviceItem.MatchesRules(HttpContextBase httpContext, SafeDictionary`2 customData)
   at Sitecore.Data.Items.DeviceItem.ResolveHelper.FindBestMatch(Database database, HttpContextBase httpContext)

Nested Exception

Exception: System.InvalidOperationException
Message: No service for type 'Sitecore.CES.DeviceDetection.Rules.IRuleDeviceInformationManager' has been registered.
Source: Microsoft.Extensions.DependencyInjection.Abstractions
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Sitecore.CES.DeviceDetection.Rules.Conditions.DeviceHardwareDisplayWidthCondition`1..ctor()

Thanks in advance

| improve this question | | | | |
0

It looks like you have a Sitecore rule for detecting device, some thing similar to what you can see in the following screenshot:

enter image description here

Following what you can find when checking Sitecore documentation for device detection:

From Sitecore 9.0 and later, Sitecore Device Detection is enabled to use Sitecore services and the database provided by 51Degrees by default

There are some configuration you can double check that you have them right in addition to verify that you server can access and download the database, following where you can find the details information:

  1. https://doc.sitecore.com/developers/93/sitecore-experience-manager/en/configure-sitecore-device-detection.html
  2. https://labs.tadigital.com/index.php/2018/11/05/device-detection-in-sitecore/
| improve this answer | | | | |
0

It turns out to be that the device detection rule config in sitecore 9.3 doesn't include Content Management Role by default so by patching this role solves the problem.

<?xml version="1.0" encoding="utf-8" ?>
<!--

Purpose: This include file configures the device detection rules component.

-->
<configuration xmlns:x="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
  **<sitecore role:require="Standalone or ContentDelivery or Processing">**
    <services>
      <register
        serviceType="Sitecore.CES.DeviceDetection.Rules.IRuleDeviceInformationManager, Sitecore.CES.DeviceDetection.Rules"
        implementationType="Sitecore.CES.DeviceDetection.Rules.RuleDeviceInformationManager, Sitecore.CES.DeviceDetection.Rules"
        lifetime="Singleton" />
    </services>
  </sitecore>
</configuration>
| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.