+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Attempting to sync products, getting "An item with the same key has already been added"

Attempting to sync products, getting "An item with the same key has already been added"

5 posts, 0 answered
  1. Ryan
    Ryan avatar
    57 posts
    Registered:
    07 May 2013
    05 May 2014
    Link to this post

    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.
    Error details:
    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.

  2. Ryan
    Ryan avatar
    57 posts
    Registered:
    07 May 2013
    05 May 2014
    Link to this post

    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. 

  3. Vassil Vassilev
     Vassil Vassilev avatar
    308 posts
    Registered:
    21 Jan 2015
    08 May 2014
    Link to this post
    Hello Ryan,

    As you have opened a support ticket, once resolved you could share it the community.

    Regards,
    Vassil Vassilev
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  4. Anthony
    Anthony avatar
    2 posts
    Registered:
    03 Apr 2013
    15 May 2015
    Link to this post
    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.
  5. Ryan
    Ryan avatar
    57 posts
    Registered:
    07 May 2013
    15 May 2015 in reply to Anthony
    Link to this post
    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. 
5 posts, 0 answered