Fixing Path Analyzer Fatal Error : Cannot create instance using path

Greetings Readers,

While doing a routine maintenance check on a system which is running Sitecore 8.1 Update 2 ,  I would start seeing series of errors related to path analyzer. The details of the issues are below

12008 09:55:52 FATAL [Path Analyzer](ApplicationContainer.GetInstance) Can’t create instance using path ”. Make sure the referred element is present in configuration
12008 09:55:52 ERROR Exception when executing agent pathAnalyzer/newMapAgent
Exception: Sitecore.Exceptions.RequiredObjectIsNullException
Message: tree definition service
Source: Sitecore.PathAnalyzer
at Sitecore.PathAnalyzer.Processing.Agents.NewMapAgent.GetTreeDefinitions()
at Sitecore.PathAnalyzer.Processing.Agents.BuildMapAgent.Execute()
at Sitecore.Analytics.Core.BackgroundService.Run()

As such from the looks of it, it really does not explain in detail as to why the path analyzer instances are not being able register correctly.

Solution

The issue was that the Path Analyzer agent (newMapAgent) starts executing before the Path Analyzer instances are registered correctly.
The underlying issues was with order of processors which were firing in the Initialize pipeline , It may happen because order of the processors “initialize” pipeline is not correct.
To fix it, please modify the Sitecore.PathAnalyzer.config file:
replace this line:

[code language=”xml”]
<processor type="Sitecore.PathAnalyzer.Pipelines.Initialize.Loader, Sitecore.PathAnalyzer" />
[/code]

with the following one:

[code language=”xml”]
<processor type="Sitecore.PathAnalyzer.Pipelines.Initialize.Loader, Sitecore.PathAnalyzer" patch:before="processor[@type=’Sitecore.Pipelines.Loader.LoadHooks, Sitecore.Kernel’]" />
[/code]

Indeed this fix did work for me, Sitecore support also acknowledged that this issues is a defect in sitecore 8.1 Update 2 , please mention reference 99665 in the support ticket.

Please comment if you have further questions or tweet me @sjain_hi