Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

"An item with the same key has already been added" in contentLoader.GetChildren(contentLink)

$
0
0

Epi version: 11.11.3.0
Commerce version: 12.17.2.0

We have some catalog categories that are throwing "An item with the same key has already been added" exceptions when we attempt to GetChildren on the category's contentLink. The categories in question work for the en-us culture, but the en-ca versions are blowing up. The <T> in question is our product interface. Our categories can have subcategories and the retrieval of those children works, but the product children causes that Epi call to fail.

Clearly, something is corrupt/misconfigured about those products, but I'm trying to figure out what it is (which will hopefully help me track down how it happened and prevent it in the future). Even if I could just know what key is duplicated, it might be helpful.

Partial stack trace (for some reason, the full one won't submit):

[ArgumentException: An item with the same key has already been added.]
   System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) +56
   System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +12948432
   System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) +16
   Mediachase.MetaDataPlus.Configurator.MetaObjectDB.LoadBatchOfMetaObjectData(MetaDataContext context, CatalogMetaObjectLoadSet loadSet) +1269
   Mediachase.MetaDataPlus.Internal.<DoLoadFromDb>d__14.MoveNext() +294
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +186
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +54
   Mediachase.MetaDataPlus.Internal.<DoLoad>d__11.MoveNext() +703
   System.Linq.Enumerable.ToDictionary(IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer) +157
   EPiServer.Commerce.Catalog.Provider.Construction.MetaDataContentBuilder.GetMetaObjects(IDictionary`2 metaObjectIdsByClassId, String language) +334
   EPiServer.Commerce.Catalog.Provider.Construction.EntryBuilder.GetMetaObjects(IEnumerable`1 entryRows, String language) +317
   EPiServer.Commerce.Catalog.Provider.Construction.EntryBuilder.ConstructEntries(CatalogEntryDto entryDto, IDictionary`2 versionsForUnpublishedContent, IList`1 entryNodeRelations, String language) +509
   EPiServer.Commerce.Catalog.Provider.Construction.EntryBuilder.Create(IList`1 contentLinks, String language) +638
   EPiServer.Commerce.Catalog.Provider.<>c__DisplayClass10_0.<LoadSpecificContentInstances>b__0(ICatalogContentBuilder builder, IList`1 links) +16
   EPiServer.Commerce.Catalog.Provider.CatalogContentLoader.ConstructContent(IList`1 contentLinks, Func`3 createContentFunc) +339
   EPiServer.Commerce.Catalog.Provider.CatalogContentLoader.LoadSpecificContentInstances(IList`1 contentLinks, String language) +453
   EPiServer.Commerce.Catalog.Provider.<>c__DisplayClass29_0.<LoadContents>b__1(IList`1 refs) +22
   EPiServer.Commerce.Catalog.Provider.CatalogContentProvider.BatchLoad(IList`1 contentLinks, Func`2 dbLoader) +141
   EPiServer.Commerce.Catalog.Provider.CatalogContentProvider.LoadContents(IList`1 contentReferences, ILanguageSelector selector) +490
   EPiServer.Core.ContentProvider.GetContentBatch(IList`1 batch, ILanguageSelector selector, List`1& contents, Dictionary`2& contentMap) +85
   EPiServer.Core.ContentProvider.GetScatteredContents(IEnumerable`1 contentLinks, ILanguageSelector selector) +676
   EPiServer.Core.ContentProvider.LoadBatched(IList`1 contentReferences, ILanguageSelector selector) +61
   EPiServer.Core.Internal.ProviderPipelineImplementation.GetItems(ContentProvider provider, IList`1 contentLinks, LoaderOptions loaderOptions) +225
   EPiServer.Core.Internal.DefaultContentLoader.GetChildren(ContentReference contentLink, LoaderOptions loaderOptions, Int32 startIndex, Int32 maxRows) +1170
   EPiServer.Core.Internal.DefaultContentLoader.GetChildren(ContentReference contentLink, LoaderOptions loaderOptions) +67
   EPiServer.Core.Internal.DefaultContentLoader.GetChildren(ContentReference contentLink) +69
   EPiServer.Core.ContentReferenceExtension.GetChildren(ContentReference contentLink) in C:\dev\pixcms\src\Polaris.CMS.Common\Extensions\ContentReferenceExtension.cs:157

                       

Viewing all articles
Browse latest Browse all 9076

Trending Articles