Experiencing YSODs when visiting some of the category pages, but only on the litium test-environment.
After restoring the production database to the test-environment (litium hosted) we started seeing YSODs cropping up when browsing the category page on the test-environment.
The error doesn’t crop up on prod so I figured I’d restore the test-db locally to trouble-shoot the problem but, as it turns out, the error doesn’t turn up locally either.
So the error is reproduceable on test-env but not on prod or locally.
Does anybody has an incling of what could make the category page fail on test but not on local or prod?
I have re-build and re-updated the search indices in case the search was the culprit but that doesn’t seem to help.
The error is:
[NullReferenceException: Object reference not set to an instance of an object.]
Litium.Accelerator.Search.<>c__DisplayClass12_0.<CreateProductModel>b__0(Variant x) in C:\Code\Prosupport\Src\Litium.Accelerator\Search\ProductSearchService.cs:185
System.Linq.WhereEnumerableIterator`1.MoveNext() +197
System.Linq.Buffer`1..ctor(IEnumerable`1 source) +280
System.Linq.<GetEnumerator>d__1.MoveNext() +115
System.Linq.Enumerable.Count(IEnumerable`1 source) +258
Litium.Accelerator.Search.ProductSearchService.CreateProductModel(SearchQuery searchQuery, IEnumerable`1 variants) in C:\Code\Prosupport\Src\Litium.Accelerator\Search\ProductSearchService.cs:214
Litium.Accelerator.Search.ProductSearchService.CreateProductModels(Collection`1 hits, SearchQuery searchQuery) in C:\Code\Prosupport\Src\Litium.Accelerator\Search\ProductSearchService.cs:278
Litium.Accelerator.Search.ProductSearchService.TransformSearchResult(Int32 pageSize, SearchQuery searchQuery, SearchResponse searchResponse) in C:\Code\Prosupport\Src\Litium.Accelerator\Search\ProductSearchService.cs:347
System.Lazy`1.CreateValue() +708
System.Lazy`1.LazyInitValue() +184
Litium.Accelerator.Builders.Product.ProductListViewModelBuilder.Build() in C:\Code\Prosupport\Src\Litium.Accelerator\Builders\Product\ProductListViewModelBuilder.cs:45
lambda_method(Closure , ControllerBase , Object[] ) +91
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35
System.Web.Mvc.Async.<>c.<BeginInvokeSynchronousActionMethod>b__9_0(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +39
System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +70
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.<>c__DisplayClass11_0.<InvokeActionMethodFilterAsynchronouslyRecursive>b__0() +80
System.Web.Mvc.Async.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2() +387
System.Web.Mvc.Async.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2() +387
System.Web.Mvc.Async.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2() +387
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.<>c__DisplayClass3_6.<BeginInvokeAction>b__4() +50
System.Web.Mvc.Async.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult) +188
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
System.Web.Mvc.<>c.<BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState) +26
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +68
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +39
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
System.Web.Mvc.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState) +40
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +68
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +648
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +213
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +131
**Row 185:**
variants = variants
.Where(x => x.ChannelLinks.Any(z => z.ChannelSystemId == _requestModelAccessor.RequestModel.ChannelModel.Channel.SystemId))
.OrderBy(x => x.SortIndex);
As far as I know, no changes has been made to ProductSearchService.cs in the accelerator.
So what can make variants be null on row 185 on test-env but not locally and prod when using the same db?
Litium version: [7.1]