Sitecore Version: 10.2.2
We have started AB testing in our application. We were able to set Page level AB testing and we were trying for component level AB testing and Multivariant testing. Once we start the test the page doesn't come up on web.
We are getting the following error in our CD servers,
[NullReferenceException: Object reference not set to an instance of an object.]
Sitecore.ContentTesting.ComponentTesting.TestVariationSelector.GetTestValueItem(Language language) +107
Sitecore.ContentTesting.Mvc.Pipelines.Response.CustomizeRendering.SelectVariation.Evaluate(CustomizeRenderingArgs args) +281
(Object , Object ) +13
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +1267
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +235
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +21
Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +194
Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args, Func`2 resultGetter) +160
Sitecore.Personalization.Mvc.Pipelines.Response.GetRenderer.CustomizeRendering.Process(GetRendererArgs args) +365
(Object , Object ) +13
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +1267
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +235
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +21
Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +194
Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args, Func`2 resultGetter) +160
Sitecore.Mvc.Presentation.Rendering.GetRenderer() +335
Sitecore.Mvc.Presentation.Rendering.get_Renderer() +30
Sitecore.Mvc.Pipelines.Response.RenderPlaceholder.PerformRendering.CreateCyclePreventer(String placeholderName, Rendering rendering) +90
Sitecore.Mvc.Pipelines.Response.RenderPlaceholder.PerformRendering.Render(String placeholderName, TextWriter writer, RenderPlaceholderArgs args) +162
(Object , Object ) +13
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +1267
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +235
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +21
Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +194
Sitecore.Mvc.Helpers.SitecoreHelper.RenderPlaceholderCore(String placeholderName, TextWriter writer) +249
Sitecore.Mvc.Helpers.SitecoreHelper.Placeholder(String placeholderName) +60
ASP._Page_Views__Layout__Global_cshtml.Execute() in D:\CD1\Views\_Layout\_Global.cshtml:114
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +251
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +147
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +121
System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +135
Sitecore.Mvc.Presentation.ViewRenderer.Render(TextWriter writer) +262
[InvalidOperationException: Error while rendering view: '/Views/_Layout/_Global.cshtml' (model: 'Sitecore.Mvc.Presentation.RenderingModel, Sitecore.Mvc').
]
Sitecore.Mvc.Presentation.ViewRenderer.Render(TextWriter writer) +735
Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Render(Renderer renderer, TextWriter writer, RenderRenderingArgs args) +147
Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Process(RenderRenderingArgs args) +74
(Object , Object ) +14
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +1268
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +236
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +195
Sitecore.Mvc.Presentation.RenderingView.Render(ViewContext viewContext, TextWriter writer) +297
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +378
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +91
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +795
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +795
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
System.Web.Mvc.Async.<>c__DisplayClass3_1.<BeginInvokeAction>b__5(IAsyncResult asyncResult) +39
Also noticed that the Test variations counts are not showing in "Web" database's final layout and only visible in "master" database final layout.
We tried the following,
I have made sure that everything is published and available in web database.
Goals are deployed.
Workflow has been removed to create the test.
Made sure these three settings are enabled in Sitecore.config on the Content Delivery server: xDB.Enabled,xDB.Tracking.Enabled and ContentTesting.Enabled.
Made sure the test definition item, is located in the folder /sitecore/system/Marketing Control Panel/Test Lab, and have the workflow state Deployed and published to the Web database too.