Products missing in category page

Some products are missing in the category page. I suspect that this could be related to following error when building the search idex?

Error when running job consumer: One or more errors occurred.

System.AggregateException: One or more errors occurred. ---> System.Exception: Error mapping types.

Mapping types:
BaseProductEntity -> BaseProduct
Litium.Application.Products.Data.BaseProductEntity -> Litium.Products.BaseProduct

Type Map configuration:
BaseProductEntity -> BaseProduct
Litium.Application.Products.Data.BaseProductEntity -> Litium.Products.BaseProduct

Destination Member:
Item
 ---> AutoMapper.AutoMapperMappingException: Error mapping types.

Mapping types:
BaseProductEntity -> BaseProduct
Litium.Application.Products.Data.BaseProductEntity -> Litium.Products.BaseProduct

Type Map configuration:
BaseProductEntity -> BaseProduct
Litium.Application.Products.Data.BaseProductEntity -> Litium.Products.BaseProduct

Destination Member:
Item
 ---> Litium.FieldFramework.FieldFrameworkException: Field with name 'SupplierDetails' does not match any field definition in area 'ProductArea'.
   at Litium.Application.AutoMapper.ValueResolvers.FieldDataToFieldDataContainerItemValueReolver`4.Resolve(TDataEntity source, T destination, ICollection`1 sourceMember, FieldContainer destMember, ResolutionContext context)
   at lambda_method(Closure , BaseProductEntity , BaseProduct , ResolutionContext )
   --- End of inner exception stack trace ---
   at lambda_method(Closure , BaseProductEntity , BaseProduct , ResolutionContext )
   at lambda_method(Closure , Object , Object , ResolutionContext )
   at AutoMapper.Mapper.AutoMapper.IMapper.Map(Object source, Type sourceType, Type destinationType) in C:\projects\automapper\src\AutoMapper\Mapper.cs:line 304
   at Litium.Application.Caching.CacheLoader.<>c__DisplayClass4_1`3.<LoadByPrimaryKey>b__1(TValueEntity x)
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Litium.Application.Caching.CacheLoader.<>c__DisplayClass4_0`3.<LoadByPrimaryKey>b__0(LitiumDbContext db)
   at Litium.Application.Data.DbContextExtension.ExecuteInDbContext[T](IServiceProvider serviceProvider, Func`2 loaderFunc)
   at Litium.Application.Caching.EntityCacheImpl`2.Get(IEnumerable`1 keys)
   --- End of inner exception stack trace ---
   at Litium.Application.Caching.LoadableCacheItem.get_Item()
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Enumerable.<OfTypeIterator>d__95`1.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Linq.Parallel.PartitionedDataSource`1.ContiguousChunkLazyEnumerator.MoveNext(T& currentElement, Int32& currentKey)
   at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey)
   at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
   at System.Linq.Parallel.SpoolingTaskBase.Work()
   at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
   at System.Linq.Parallel.QueryTaskGroupState.QueryEnd(Boolean userInitiatedDispose)
   at System.Linq.Parallel.DefaultMergeHelper`2.System.Linq.Parallel.IMergeHelper<TInputOutput>.Execute()
   at System.Linq.Parallel.MergeExecutor`1.Execute[TKey](PartitionedStream`2 partitions, Boolean ignoreOutput, ParallelMergeOptions options, TaskScheduler taskScheduler, Boolean isOrdered, CancellationState cancellationState, Int32 queryId)
   at System.Linq.Parallel.PartitionedStreamMerger`1.Receive[TKey](PartitionedStream`2 partitionedStream)
   at System.Linq.Parallel.ForAllOperator`1.WrapPartitionedStream[TKey](PartitionedStream`2 inputStream, IPartitionedStreamRecipient`1 recipient, Boolean preferStriping, QuerySettings settings)
   at System.Linq.Parallel.UnaryQueryOperator`2.UnaryQueryOperatorResults.ChildResultsRecipient.Receive[TKey](PartitionedStream`2 inputStream)
   at System.Linq.Parallel.ScanQueryOperator`1.ScanEnumerableQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient`1 recipient)
   at System.Linq.Parallel.UnaryQueryOperator`2.UnaryQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient`1 recipient)
   at System.Linq.Parallel.QueryOperator`1.GetOpenedEnumerator(Nullable`1 mergeOptions, Boolean suppressOrder, Boolean forEffect, QuerySettings querySettings)
   at System.Linq.Parallel.ForAllOperator`1.RunSynchronously()
   at Litium.Foundation.Modules.ProductCatalog.Search.BaseProductIndexingService.ReIndex(IEnumerable`1 productSystemIds, Boolean rebuildFromScratch)
   at Litium.Foundation.Search.IndexJobConsumer.JobHolder.RunSafe(Action action)
---> (Inner Exception #0) System.Exception: Error mapping types.

Mapping types:
BaseProductEntity -> BaseProduct
Litium.Application.Products.Data.BaseProductEntity -> Litium.Products.BaseProduct

Type Map configuration:
BaseProductEntity -> BaseProduct
Litium.Application.Products.Data.BaseProductEntity -> Litium.Products.BaseProduct

Destination Member:
Item
 ---> AutoMapper.AutoMapperMappingException: Error mapping types.

Mapping types:
BaseProductEntity -> BaseProduct
Litium.Application.Products.Data.BaseProductEntity -> Litium.Products.BaseProduct

Type Map configuration:
BaseProductEntity -> BaseProduct
Litium.Application.Products.Data.BaseProductEntity -> Litium.Products.BaseProduct

Destination Member:
Item
 ---> Litium.FieldFramework.FieldFrameworkException: Field with name 'SupplierDetails' does not match any field definition in area 'ProductArea'.
   at Litium.Application.AutoMapper.ValueResolvers.FieldDataToFieldDataContainerItemValueReolver`4.Resolve(TDataEntity source, T destination, ICollection`1 sourceMember, FieldContainer destMember, ResolutionContext context)
   at lambda_method(Closure , BaseProductEntity , BaseProduct , ResolutionContext )
   --- End of inner exception stack trace ---
   at lambda_method(Closure , BaseProductEntity , BaseProduct , ResolutionContext )
   at lambda_method(Closure , Object , Object , ResolutionContext )
   at AutoMapper.Mapper.AutoMapper.IMapper.Map(Object source, Type sourceType, Type destinationType) in C:\projects\automapper\src\AutoMapper\Mapper.cs:line 304
   at Litium.Application.Caching.CacheLoader.<>c__DisplayClass4_1`3.<LoadByPrimaryKey>b__1(TValueEntity x)
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Litium.Application.Caching.CacheLoader.<>c__DisplayClass4_0`3.<LoadByPrimaryKey>b__0(LitiumDbContext db)
   at Litium.Application.Data.DbContextExtension.ExecuteInDbContext[T](IServiceProvider serviceProvider, Func`2 loaderFunc)
   at Litium.Application.Caching.EntityCacheImpl`2.Get(IEnumerable`1 keys)
   --- End of inner exception stack trace ---
   at Litium.Application.Caching.LoadableCacheItem.get_Item()
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Enumerable.<OfTypeIterator>d__95`1.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Linq.Parallel.PartitionedDataSource`1.ContiguousChunkLazyEnumerator.MoveNext(T& currentElement, Int32& currentKey)
   at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey)
   at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
   at System.Linq.Parallel.SpoolingTaskBase.Work()
   at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
   at System.Threading.Tasks.Task.Execute()<---

Litium version: 7.4

Sounds like you have a field called SupplierDetails on your product fieldtemplate that has no fielddefinition?

There’s data in the database for a field that no longer exists. If you know the type you can recreate the field with the same id. After that you can delete it so the API can clean the data out.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.