2

Since introducing SXA 1.3 on Sitecore 8.2 Update 4 we're seeing some odd behavior from our custom 404 pages. The pages work fine for URLs that have more than one level in the path (i.e. http://site/level1/level2) but we get an error on URLs with only one level (i.e. http://site/level1). This is happening for both our new SXA site (configured to use the SXA 404 setting) and our legacy site (configured to use the pre-SXA 404 settings). I'm not sure where to look to figure out what isn't configured correctly.

The error we get is:

[NullReferenceException: Object reference not set to an instance of an object.]
   Sitecore.XA.Foundation.LocalDatasources.Pipelines.GetXmlBasedLayoutDefinition.ResolveLocalDatasources.Process(GetXmlBasedLayoutDefinitionArgs args) +85
   (Object , Object[] ) +73
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +478
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +21
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +191
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args, Func`2 resultGetter) +160
   Sitecore.Mvc.Pipelines.Response.BuildPageDefinition.ProcessXmlBasedLayoutDefinition.AddRenderings(PageDefinition pageDefinition, BuildPageDefinitionArgs args) +218
   (Object , Object[] ) +73
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +478
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +21
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +191
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args, Func`2 resultGetter) +160
   Sitecore.Mvc.Presentation.PageContext.GetPageDefinition() +267
   Sitecore.Mvc.Presentation.PageContext.get_PageDefinition() +30
   Sitecore.Mvc.Presentation.PageContext.GetPageView() +123
   Sitecore.Mvc.Presentation.PageContext.get_PageView() +30
   Sitecore.Mvc.Controllers.SitecoreController.GetDefaultAction() +25
   lambda_method(Closure , ControllerBase , Object[] ) +89
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +228
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +34
   System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +38
   System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +70
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +41
   System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +71
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +385
   System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +385
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +38
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +36

Has anyone seen this or know where to look to get moving in the right direction?

  • Can you try to create a new 404 page and configure it via the settings item and check ? Looks like a broken local datasource item. – Naveed Ahmad Sep 22 '17 at 2:39
  • I can, but the same behavior is happening for both the new SXA 404 page in the new SXA site and the legacy 404 page on the legacy site. There is nothing in common between these two pages so I'd have to have had two items get corrupted at the same time. – Ben Stichter Sep 22 '17 at 14:01
1

Our issue ended up being caused by a bad MVC route that was intercepting our item resolution before it could get to the item resolver pipelines. Our solution was to remove the MVC routes in favor of using a custom item resolver for all item resolution.

| improve this answer | |
  • Can you tell what exactly you have done to fix this? – shiva Jul 30 '19 at 22:55

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.