I have got Sitecore 9.1.1
installed on CM and CD server
. I am getting the below exception only on the CD server:
5048 12:18:51 ERROR Application error.
Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Sitecore.Mvc
at Sitecore.Mvc.Pipelines.Request.RequestBegin.EnsureLoggedInForPreview.Process(PipelineArgs args)
at (Object , Object )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
at Sitecore.Mvc.Pipelines.PipelineService.RunPipeline[TArgs](String pipelineName, TArgs args)
at Sitecore.Mvc.Routing.RouteHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
I did have a look at the process in Sitecore.Mvc
it is:
public class EnsureLoggedInForPreview
{
public void Process(PipelineArgs args)
{
if (Context.PageMode.get_IsNormal() || Context.get_IsLoggedIn())
return;
using (new SiteContextSwitcher(Factory.GetSite("shell")))
{
using (new UserSwitcher(Context.get_User()))
ShellPage.IsLoggedIn();
}
}
I am imagining the page mode is not available on CD server. Should I disable the pipeline on the CD server?
PipelineArgs
arenull
Please cross check.