You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When having two different member types I get an error when importing one of the member types to another environment.
"memberTypeHandler": Import Failed : "System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.cmsPropertyType' with unique index 'IX_cmsPropertyTypeUniqueID'. The duplicate key value is (e79dccfb-0000-0000-0000-000000000000). The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteScalar() at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteScalar() in C:\projects\dotnet\src\MiniProfiler.Shared\Data\ProfiledDbCommand.cs:line 334 at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.b__32_0() in D:\a\1\s\src\Umbraco.Core\Persistence\FaultHandling\RetryDbConnection.cs:line 214 at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.<>c__DisplayClass33_01.<Execute>b__0() in D:\a\1\s\src\Umbraco.Core\Persistence\FaultHandling\RetryDbConnection.cs:line 222 at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func1 func) in D:\a\1\s\src\Umbraco.Core\Persistence\FaultHandling\RetryPolicy.cs:line 172 at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.Execute[T](Func1 f) in D:\a\1\s\src\Umbraco.Core\Persistence\FaultHandling\RetryDbConnection.cs:line 219 at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.ExecuteScalar() in D:\a\1\s\src\Umbraco.Core\Persistence\FaultHandling\RetryDbConnection.cs:line 214 at NPoco.Database.ExecuteScalarHelper(DbCommand cmd) at NPoco.DatabaseTypes.SqlServerDatabaseType.ExecuteInsert[T](Database db, DbCommand cmd, String primaryKeyName, Boolean useOutputClause, T poco, Object[] args) at NPoco.Database.InsertImp[T](PocoData pocoData, String tableName, String primaryKeyName, Boolean autoIncrement, T poco) at NPoco.Database.Insert[T](String tableName, String primaryKeyName, Boolean autoIncrement, T poco) at NPoco.Database.Insert[T](T poco) at Umbraco.Core.Persistence.Repositories.Implement.ContentTypeRepositoryBase1.PersistNewBaseContentType(IContentTypeComposition entity) in D:\a\1\s\src\Umbraco.Core\Persistence\Repositories\Implement\ContentTypeRepositoryBase.cs:line 207 at Umbraco.Core.Persistence.Repositories.Implement.MemberTypeRepository.PersistNewItem(IMemberType entity) in D:\a\1\s\src\Umbraco.Core\Persistence\Repositories\Implement\MemberTypeRepository.cs:line 153 at Umbraco.Core.Cache.FullDataSetRepositoryCachePolicy2.Create(TEntity entity, Action1 persistNew) in D:\a\1\s\src\Umbraco.Core\Cache\FullDataSetRepositoryCachePolicy.cs:line 73 at Umbraco.Core.Persistence.Repositories.Implement.RepositoryBase2.Save(TEntity entity) in D:\a\1\s\src\Umbraco.Core\Persistence\Repositories\Implement\RepositoryBaseOfTIdTEntity.cs:line 138 at Umbraco.Core.Services.Implement.ContentTypeServiceBase3.Save(TItem item, Int32 userId) in D:\a\1\s\src\Umbraco.Core\Services\Implement\ContentTypeServiceBaseOfTRepositoryTItemTService.cs:line 423 at uSync8.Core.Serialization.Serializers.ContentTypeBaseSerializer1.SaveItem(TObject item) at uSync8.Core.Serialization.SyncSerializerRoot1.Deserialize(XElement node, SyncSerializerOptions options) at uSync8.BackOffice.SyncHandlers.SyncHandlerRoot2.DeserializeItem(XElement node, SyncSerializerOptions options) at uSync8.BackOffice.SyncHandlers.SyncHandlerRoot2.Import(String filePath, HandlerSettings config, SerializerFlags flags) ClientConnectionId:0b7f6797-b69a-4320-988d-c65c25c40ec4 Error Number:2601,State:1,Class:14"`
To Reproduce
Unfortunately I didn't manage to reproduce
Expected behavior
I do not expect an error.
Screenshots
Desktop (please complete the following information):
Umbraco Version: 8.6.4
uSync Version: 8.7.0.1
OS: Windows 10
Additional context
It works if I remove the default member properties from the member type config file.
The property that is colliding now is 'IsApproved'. But if removing that property from the config file, the next default member type property gets the same error.
The text was updated successfully, but these errors were encountered:
lindeberg
changed the title
MemberTypeHandler import fail error (default member property duplicate key)
MemberTypeHandler import fail error (default member property type duplicate key)
Oct 6, 2020
The issue is that for properties in member types the GUID doesn't really get used and as a result Umbraco makes it up when reporting it via the API (so it changes a lot) - uSync generates a pseudo GUID based on the property alias. but as you have discovered if the property alias is the same between member types (which it will be because well know properties are always there!) then you get a clash.
The workaround if you are stuck is to go into the company.config file for the company member type and add a digit to the guid. (for example change it from e79dccfb-0000-0000-0000-000000000000 to e79dccfb-0000-0000-0000-000000000001) - not ideal but your import will work.
fix will be in the Next patch release of uSync (v8.7.2)
Describe the bug
When having two different member types I get an error when importing one of the member types to another environment.
"memberTypeHandler": Import Failed : "System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.cmsPropertyType' with unique index 'IX_cmsPropertyTypeUniqueID'. The duplicate key value is (e79dccfb-0000-0000-0000-000000000000). The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action
1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource
1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteScalar() at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteScalar() in C:\projects\dotnet\src\MiniProfiler.Shared\Data\ProfiledDbCommand.cs:line 334 at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.b__32_0() in D:\a\1\s\src\Umbraco.Core\Persistence\FaultHandling\RetryDbConnection.cs:line 214 at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.<>c__DisplayClass33_01.<Execute>b__0() in D:\a\1\s\src\Umbraco.Core\Persistence\FaultHandling\RetryDbConnection.cs:line 222 at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func
1 func) in D:\a\1\s\src\Umbraco.Core\Persistence\FaultHandling\RetryPolicy.cs:line 172 at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.Execute[T](Func1 f) in D:\a\1\s\src\Umbraco.Core\Persistence\FaultHandling\RetryDbConnection.cs:line 219 at Umbraco.Core.Persistence.FaultHandling.FaultHandlingDbCommand.ExecuteScalar() in D:\a\1\s\src\Umbraco.Core\Persistence\FaultHandling\RetryDbConnection.cs:line 214 at NPoco.Database.ExecuteScalarHelper(DbCommand cmd) at NPoco.DatabaseTypes.SqlServerDatabaseType.ExecuteInsert[T](Database db, DbCommand cmd, String primaryKeyName, Boolean useOutputClause, T poco, Object[] args) at NPoco.Database.InsertImp[T](PocoData pocoData, String tableName, String primaryKeyName, Boolean autoIncrement, T poco) at NPoco.Database.Insert[T](String tableName, String primaryKeyName, Boolean autoIncrement, T poco) at NPoco.Database.Insert[T](T poco) at Umbraco.Core.Persistence.Repositories.Implement.ContentTypeRepositoryBase
1.PersistNewBaseContentType(IContentTypeComposition entity) in D:\a\1\s\src\Umbraco.Core\Persistence\Repositories\Implement\ContentTypeRepositoryBase.cs:line 207 at Umbraco.Core.Persistence.Repositories.Implement.MemberTypeRepository.PersistNewItem(IMemberType entity) in D:\a\1\s\src\Umbraco.Core\Persistence\Repositories\Implement\MemberTypeRepository.cs:line 153 at Umbraco.Core.Cache.FullDataSetRepositoryCachePolicy2.Create(TEntity entity, Action
1 persistNew) in D:\a\1\s\src\Umbraco.Core\Cache\FullDataSetRepositoryCachePolicy.cs:line 73 at Umbraco.Core.Persistence.Repositories.Implement.RepositoryBase2.Save(TEntity entity) in D:\a\1\s\src\Umbraco.Core\Persistence\Repositories\Implement\RepositoryBaseOfTIdTEntity.cs:line 138 at Umbraco.Core.Services.Implement.ContentTypeServiceBase
3.Save(TItem item, Int32 userId) in D:\a\1\s\src\Umbraco.Core\Services\Implement\ContentTypeServiceBaseOfTRepositoryTItemTService.cs:line 423 at uSync8.Core.Serialization.Serializers.ContentTypeBaseSerializer1.SaveItem(TObject item) at uSync8.Core.Serialization.SyncSerializerRoot
1.Deserialize(XElement node, SyncSerializerOptions options) at uSync8.BackOffice.SyncHandlers.SyncHandlerRoot2.DeserializeItem(XElement node, SyncSerializerOptions options) at uSync8.BackOffice.SyncHandlers.SyncHandlerRoot
2.Import(String filePath, HandlerSettings config, SerializerFlags flags) ClientConnectionId:0b7f6797-b69a-4320-988d-c65c25c40ec4 Error Number:2601,State:1,Class:14"`To Reproduce
Unfortunately I didn't manage to reproduce
Expected behavior
I do not expect an error.
Screenshots
Desktop (please complete the following information):
Additional context
It works if I remove the default member properties from the member type config file.
The property that is colliding now is 'IsApproved'. But if removing that property from the config file, the next default member type property gets the same error.
The text was updated successfully, but these errors were encountered: