Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gordon Saxby 1120 posts 1242 karma points
    May 24, 2017 @ 08:14
    Gordon Saxby
    0

    An item with the same key has already been added

    I have enabled Member type processing and it seems to be causing an issue - I get this error:

    An item with the same key has already been added
    

    I set "DontThrowErrors" to true and the log only reports that there was a problem:

     2017-05-24 08:06:07,031 [P7992/D5/T1] INFO  Jumoo.uSync.BackOffice.Logging - Running Import: MemberType
     2017-05-24 08:06:07,097 [P7992/D5/T1] INFO  Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - No Throw errors is set, so uSync won't YSOD
     2017-05-24 08:06:07,098 [P7992/D5/T1] ERROR Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Error During Setup:
    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 Jumoo.uSync.Core.Serializers.ContentTypeBaseSerializer`1.DeserializeProperties(IContentTypeBase item, XElement node)
       at Jumoo.uSync.Core.Serializers.MemberTypeSerializer.DeserializeCore(XElement node)
       at Jumoo.uSync.Core.Serializers.SyncBaseSerializer`1.DeSerialize(XElement node, Boolean forceUpdate)
       at Jumoo.uSync.BackOffice.Handlers.MemberTypeHandler.Import(String filePath, Boolean force)
       at Jumoo.uSync.BackOffice.Handlers.uSyncBaseHandler`1.ImportFolder(String folder, Boolean force, Dictionary`2 updates)
       at Jumoo.uSync.BackOffice.Handlers.uSyncBaseHandler`1.ImportFolder(String folder, Boolean force, Dictionary`2 updates)
       at Jumoo.uSync.BackOffice.Handlers.uSyncBaseHandler`1.ImportAll(String folder, Boolean force)
       at Jumoo.uSync.BackOffice.uSyncBackOfficeContext.Import(IEnumerable`1 syncHandlers, String folder, Boolean checkConfig, Boolean force, String groupName)
       at Jumoo.uSync.BackOffice.uSyncBackOfficeContext.Import(String groupName, String folder, Boolean force)
       at Jumoo.uSync.BackOffice.uSyncBackOfficeContext.ImportAll(String folder, Boolean force)
       at Jumoo.uSync.BackOffice.uSyncApplicationEventHandler.Setup()
    

    I am not making a lot of changes to the Member type(s) but probably will need to do some more. Also I will need to transfer this site onto other servers.

    Any ideas what is going wrong?

  • Kevin Jump 985 posts 5475 karma points mvp c-trib
    May 24, 2017 @ 08:59
    Kevin Jump
    0

    Hi

    what version of umbraco and what version of usync are you using ?

    there where some issues with the keys in member types, but that was in older versions of umbraco, so if you have the version i can go check if it was that.

    Kevin

  • Gordon Saxby 1120 posts 1242 karma points
    May 24, 2017 @ 09:02
    Gordon Saxby
    0

    It is Umbraco v7.5.11, uSync.BackOffice v3.3.2.740 and uSync.Core v5.6.2.740

  • Kevin Jump 985 posts 5475 karma points mvp c-trib
    May 24, 2017 @ 09:58
    Kevin Jump
    0

    :( not its not that (at least its not in those versions).

    There was a point when setting the key (guid) in member types didn't stick, or where always returned as all zeros, but i don't think it is that.

    if you turn on debugging (in config/log4net.config add)

      <logger name="Jumoo.uSync">
        <level value="DEBUG" />
      </logger>
    

    then you will get some more logging that might help pinpoint the property that is causing the issue.

    Looking at the code i think it could be caused by either two properties having the same key or something weird with removing properties from tabs (they are the only two dictionary items in the process).

  • Gordon Saxby 1120 posts 1242 karma points
    May 24, 2017 @ 10:00
    Gordon Saxby
    0

    Hi Kevin,

    I will try and do that as soon as I can - however this is a site that is heading for staging very soon so I can't mess around with it right now!

  • Gordon Saxby 1120 posts 1242 karma points
    Jun 08, 2017 @ 15:00
    Gordon Saxby
    0

    Hi Kevin,

    I have just tried the member update option again and got this (and much more!):

    2017-06-08 14:54:11,387 [P6060/D3/T1] DEBUG Jumoo.uSync.Core.Events - Updating Property :Member umbracoMemberPasswordRetrievalQuestion
     2017-06-08 14:54:11,387 [P6060/D3/T1] DEBUG Jumoo.uSync.Core.Events - Setting Key :df013a93-e7fb-4282-b74d-13ab5203cb5f
     2017-06-08 14:54:11,387 [P6060/D3/T1] DEBUG Jumoo.uSync.Core.Events - Item Key    :df013a93-e7fb-4282-b74d-13ab5203cb5f
     2017-06-08 14:54:11,387 [P6060/D3/T1] DEBUG Jumoo.uSync.Core.Events - Setting Property Type : Umbraco.NoEdit
     2017-06-08 14:54:11,389 [P6060/D3/T1] WARN  Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Errors during Sync: An item with the same key has already been added. mscorlib
    

    I think that field was added automatically, along with an "answer" field?

Please Sign in or register to post replies

Write your reply to:

Draft