Attempting to sync products, getting "An item with the same key has already been added"
I have 36 products I'm attempting to sync from our staging to production environment. All products have one image and one file attachment. When I grab all 36 and hit "Sync", I'm taken to a page that looks like it's successful, but no information about the sync is displayed (screenshot: http://i.imgur.com/n81uY0p.png).
I manually created the new product type and they match in both environments. If I attempt to sync one product at a time, it sort of works, but it shows as it failed and doesn't link it to the correct product type, but it creates a record in the Product list. It also doesn't pull in the image and PDF.
Here is the stack trace from the log:
Message: Syncing data failed.
System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Telerik.Sitefinity.Modules.Ecommerce.SiteSync.ProductsSiteSyncSnapIn.AddDependency(IProductContentLink dependencyItem, Dictionary`2 currentDependencyDataItems, String productId)
at Telerik.Sitefinity.Modules.Ecommerce.SiteSync.ProductsSiteSyncSnapIn.FindDependencyDataItems(IList`1 dataItems, Type realType, IEnumerable`1 groupItemIds)
at Telerik.Sitefinity.Modules.SiteSync.SiteSyncSnapInBase.CalculateDependentItemsInternal(String inputType, ISiteSyncExportContext exportContext, Func`4 findDependencyDataItems)
at Telerik.Sitefinity.Modules.Ecommerce.SiteSync.ProductsSiteSyncSnapIn.CalculateDependencies(String type, ISiteSyncExportContext exportContext)
at Telerik.Sitefinity.Modules.SiteSync.SyncingManager.LoadDependencyItems(ISiteSyncExportContext context)
at Telerik.Sitefinity.Modules.SiteSync.SyncingManager.Sync(SiteSyncExportContext context)
When looking at the code, it appears as if it's checking for a dependency ID to be added to a dictionary, but seems like it's checking for the wrong ID. Not sure if this is why, but this is where it's failing. I'm not sure if it's for a file and/or an image (screenshot: http://i.imgur.com/Nq0xXQI.png).
EDIT: When attempting to upload images and files in their new libraries, another error I see in the log is that it's failing to find, the library GUID that each of the files are in. Strange this is, the GUIDs would be different between environments, so I'm not sure why it's trying to look for the GUID of a staging library in production.
My version is 6.1.4600.0. Thanks.
Just to add some detail. If I create a product without images or files, it syncs without issue. When I add an image, it actually is now timing out and failing.
As you have opened a support ticket, once resolved you could share it the community.
Was this ever resolved? I'm getting the same thing. If I select more than 1 product to sync it throws this error. Each product has 1 image and possibly several documents assigned to them.
I didn't resolve it, as I never had the chance to sync products again. No idea if it was fixed in a more recent version. I'll keep this in mind for next time if I need to dig into it again. Sorry.