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.
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.
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).
So ideally you would want to also update those values across content too.
Having said that uSync should let you change the property value and it will attempt to fail back the languages in the content when you do it.
So it might be worth you turning on the debugging and see if there is anything specific that is causing the key issue, because that shouldn't happen when you change this value - its just that it does kick off a lot internal umbraco stuff and maybe its tripling up on some other bit of data somewhere.
Not much I can read from that message I get in debugging:
System.ArgumentException: An item with the same key has already been added. at
enter code here`System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at
System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer) at
Umbraco.Core.Persistence.Repositories.Implement.ContentTypeRepositoryBase`1.RenormalizeDocumentEditedFlags(IReadOnlyCollection`1 propertyTypeIds, IReadOnlyCollection`1 contentTypeIds) in
D:\a\1\s\src\Umbraco.Core\Persistence\Repositories\Implement\ContentTypeRepositoryBase.cs:line 1099 at
Umbraco.Core.Persistence.Repositories.Implement.ContentTypeRepositoryBase`1.MovePropertyTypeVariantData(IDictionary`2 propertyTypeChanges, IEnumerable`1 impacted) in
D:\a\1\s\src\Umbraco.Core\Persistence\Repositories\Implement\ContentTypeRepositoryBase.cs:line 685 at
Umbraco.Core.Persistence.Repositories.Implement.ContentTypeRepositoryBase`1.PersistUpdatedBaseContentType(IContentTypeComposition entity) in
D:\a\1\s\src\Umbraco.Core\Persistence\Repositories\Implement\ContentTypeRepositoryBase.cs:line 500 at
...
Could this be a conflict between two pages that already have data in different language versions? So Umbraco tries to merge data from all language versions, but the content "collides" and can´t be merged?
In that case I probably need to remove content from all languages that are not EN and it should work ok.
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:
I set "DontThrowErrors" to true and the log only reports that there was a problem:
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?
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
It is Umbraco v7.5.11, uSync.BackOffice v3.3.2.740 and uSync.Core v5.6.2.740
:( 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)
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).
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!
Hi Kevin,
I have just tried the member update option again and got this (and much more!):
I think that field was added automatically, along with an "answer" field?
Gordon,
I too have a same problem, how did you resolve the issue based on the log ?
I have a similar issue - I want to change an element from
to
I tried it in the Umbraco UI and also through uSync by manually manipulating the config file. In both cases I get the error:
I don´t think it´s related to uSync but how can I change this, without having to recreate all content for that element, which is quite a lot!
Best, Gerhard
Hi Gerhard,
yeah that type of change - will do quite a lot internally within Umbraco.
not only would you need to change that value in the element you would also need to change how the properties are stored within the content elements.
so for example a vary by culture property may look like this in content
while the non-variant method is
So ideally you would want to also update those values across content too.
Having said that uSync should let you change the property value and it will attempt to fail back the languages in the content when you do it.
So it might be worth you turning on the debugging and see if there is anything specific that is causing the key issue, because that shouldn't happen when you change this value - its just that it does kick off a lot internal umbraco stuff and maybe its tripling up on some other bit of data somewhere.
Hi Gordon,
Thanks for the reply!
The element in question is a multinode-treepicker, not sure if that has some effect there. I´ll go into debugging and checking the details here.
Not much I can read from that message I get in debugging:
...
Could this be a conflict between two pages that already have data in different language versions? So Umbraco tries to merge data from all language versions, but the content "collides" and can´t be merged?
In that case I probably need to remove content from all languages that are not EN and it should work ok.
Gordon put me on the track here, I ended up removing the content for all the languages except EN, and then it all worked out nicely!
https://our.umbraco.com/forum/using-umbraco-and-getting-started/106364-can-t-change-varybyculture-on-an-already-created-documenttype
is working on a reply...