"SessionEndPipeline failed" errors appear in the log when Analytics tracking is disabled


Description

The following error may appear in the Sitecore XP log when the Sitecore.Analytics.Tracking.config file is disabled:

ERROR SessionEndPipeline failed.
Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Sitecore.Analytics.Automation
   at Sitecore.Analytics.Pipelines.VisitEnd.RunAutomation.RunAutomationX(Database database)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Web.Application.RaiseSessionEndEvent(HttpApplication context)

This error appears when the RunAutomationX method tries to run automatically when the SessionEnd event processing is done for the website visit. However, this logic should not be executed on the servers that have disabled Analytics tracking (for example, on a separate Content Management, Processing or Reporting server).

Solution

Place the Sitecore.Support.97004.config file into the /App_Config/Include folder of the server that has disabled Analytics tracking.