Thursday, November 7, 2019

Path Analyzer Map Errors Populating Sitecore Logs After Sitecore 9.1 Upgrade

Recently we upgraded a Sitecore 8.1 solution to Sitecore 9.1 Update-1

After the upgrade we rebuild the reporting database. After the reporting database rebuild we started to notice that our Sitecore logs (setup to log level "ERROR") is getting populated with lot of Path Analyzer errors.

7404 18:45:08 ERROR [Path Analyzer] Cannot apply rule on the interaction.
Exception: Sitecore.XConnect.Segmentation.ExpressionBuilder.PredicateDescriptorException
Message: No known predicate type could be determined from ' Sitecore.Analytics.Rules.Conditions.ContactVisitIndexCondition,Sitecore.Analytics' specified in the definition item (Id = '61370693-189d-44a0-abc5-2592dbd579ed', db = 'master') : Could not load type 'Sitecore.Analytics.Rules.Conditions.ContactVisitIndexCondition' from assembly 'Sitecore.Analytics'.
Source: Sitecore.Marketing.Segmentation.xMgmt
   at Sitecore.Marketing.Segmentation.ExpressionBuilder.ContentTreePredicateDescriptorLocator.GetDescriptor(Guid id)
   at Sitecore.Marketing.Segmentation.RuleXmlConverter.ConditionXmlNodeConverter.LookupType(Guid descriptorId)
   at Sitecore.Marketing.Segmentation.RuleXmlConverter.ConditionXmlNodeConverter.ConvertNodeInternal(INodeConversionContext`2 context, XElement element)
   at Sitecore.Marketing.Segmentation.RuleXmlConverter.BaseXmlRuleNodeConverter`1.Convert(INodeConversionContext`2 context, XElement node)
   at Sitecore.Marketing.Segmentation.RuleXmlConverter.AndXmlNodeConverter.ConvertNodeInternal(INodeConversionContext`2 context, XElement element)
   at Sitecore.Marketing.Segmentation.RuleXmlConverter.BaseXmlRuleNodeConverter`1.Convert(INodeConversionContext`2 context, XElement node)
   at Sitecore.XConnect.Segmentation.ExpressionBuilder.TreeConverter.TreeConverter`2.Convert(TFromNode treeRoot)
   at Sitecore.Marketing.Segmentation.RuleXmlConverter.RuleXmlConverter.CreateRule(XElement ruleElement)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Sitecore.PathAnalyzer.Rules.RulesBuilder.BuildXmlRules(String rulesXml)
   at Sitecore.PathAnalyzer.Rules.RulesBuilder.BuildRules(String rulesXml)
   at Sitecore.PathAnalyzer.Rules.RulesValidator.ValidateRule(Interaction interaction, String rulesXml, ConditionParameters parameters)
   at Sitecore.PathAnalyzer.Construction.TreeBuilder.IsApplicable(Interaction interaction, String rulesXml, ConditionParameters conditionParameters)
Nested Exception
Exception: System.TypeLoadException
Message: Could not load type 'Sitecore.Analytics.Rules.Conditions.ContactVisitIndexCondition' from assembly 'Sitecore.Analytics'.
Source: mscorlib
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
   at System.Type.GetType(String typeName, Boolean throwOnError)
   at Sitecore.Marketing.Segmentation.ExpressionBuilder.ContentTreePredicateDescriptorLocator.GetDescriptor(Guid id)

Unsure if following steps did help, but anyways mentioning them also :

  • Since the item ID mentioned in the error was "/sitecore/system/Settings/Rules/Definitions/Elements/Visitor/Global Visit No", I did try to remove/clean all the items that used this rule 
  • Deleted all the custom Maps from Sitecore 8.1
  • Cleared all the table in the RefData database and Deploy all the Marketing Definitions again
  • Removing EMPTY Site definition entry in "SiteNames" table in Reporting database entry that I removed was SiteNameId was set to 0 & SiteName was empty


But all the above steps did not stopped the error population on the logs.


Then I did the following steps and after the last step the error went away.

Step 1: Delete all the Map definitions from "TreeDefinitions" table in Reporting database

Step 2: Redeploy all Path Analyzer Map definitions by visiting following tool and clicking "Deploy all maps that are not deployed" button
http:/<sitecore_hostname>/Sitecore/admin/pathanalyzer.aspx

Step 3: In the same tool above, click "Rebuild" button on "Historic Map Rebuild" section

NOTE: These were mainly taking from https://sitecore.stackexchange.com/questions/17162/sitecore-9-processing-server-exception-when-executing-agent-pathanalyzer-mapre post on Sitecore StackExchange


Some useful links related to Sitecore Path Analyzer Errors on Log files :

https://sitecore.namics.com/2019/08/14/sitecore-pathanalyzer-undeploy-maps/
https://sitecore.stackexchange.com/questions/11253/no-known-predicate-type-could-be-determined-from-sitecore-analytics-omnichannel
https://blog.wesleylomax.co.uk/posts/2019-08-08-sitecore-9-1-processing-server-an-error-occured-evaluating-the-primary-condition-of-the-rule/




No comments:

Post a Comment