Copied to clipboard

Flag this post as spam?

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


  • Parthiban 3 posts 73 karma points
    Oct 13, 2021 @ 17:05
    Parthiban
    0

    When I try to update getting : Violation of PRIMARY KEY constraint 'PK_cmsContentNu'. message

    Hi,

    When I try to udpate a document a document type, getting below error message. Even I am not able to delete the Document Type also.

    Could you help me to solve this issue.

    {"@t":"2021-10-13T16:20:02.3971225Z","@mt":"Unhandled controller exception occurred for request '{RequestUrl}'","@l":"Error","@x":"System.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PKcmsContentNu'. Cannot insert duplicate key in object 'dbo.cmsContentNu'. The duplicate key value is (1423, 0).\r\nThe statement has been terminated.\r\n at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)\r\n at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)\r\n at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)\r\n at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)\r\n at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)\r\n at System.Data.SqlClient.SqlBulkCopy.RunParser(BulkCopySimpleResultSet bulkCopyHandler)\r\n at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinuedOnSuccess(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource1 source)\r\n at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinued(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource1 source)\r\n at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsync(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource1 source)\r\n at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestContinuedAsync(BulkCopySimpleResultSet internalResults, CancellationToken cts, TaskCompletionSource1 source)\r\n at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestAsync(CancellationToken cts, TaskCompletionSource1 source)\r\n at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalAsync(CancellationToken ctoken)\r\n at System.Data.SqlClient.SqlBulkCopy.WriteRowSourceToServerAsync(Int32 columnCount, CancellationToken ctoken)\r\n at System.Data.SqlClient.SqlBulkCopy.WriteToServer(IDataReader reader)\r\n at Umbraco.Core.Persistence.NPocoDatabaseExtensions.BulkInsertRecordsSqlServer[T](IUmbracoDatabase database, PocoData pocoData, IEnumerable1 records) in D:\a\1\s\src\Umbraco.Core\Persistence\NPocoDatabaseExtensions-Bulk.cs:line 285\r\n at Umbraco.Core.Persistence.NPocoDatabaseExtensions.BulkInsertRecords[T](IUmbracoDatabase database, IEnumerable1 records, Boolean useNativeBulkInsert) in D:\\a\\1\\s\\src\\Umbraco.Core\\Persistence\\NPocoDatabaseExtensions-Bulk.cs:line 89\r\n at Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService.RebuildContentDbCacheLocked(IContentCacheDataSerializer serializer, IScope scope, Int32 groupSize, IEnumerable1 contentTypeIds) in D:\a\1\s\src\Umbraco.Web\PublishedCache\NuCache\PublishedSnapshotService.cs:line 1608\r\n at Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService.RebuildContentDbCache(Int32 groupSize, IEnumerable1 contentTypeIds) in D:\\a\\1\\s\\src\\Umbraco.Web\\PublishedCache\\NuCache\\PublishedSnapshotService.cs:line 1546\r\n at Umbraco.Web.PublishedCache.NuCache.PublishedSnapshotService.OnContentTypeRefreshedEntity(IContentTypeService sender, EventArgs args) in D:\\a\\1\\s\\src\\Umbraco.Web\\PublishedCache\\NuCache\\PublishedSnapshotService.cs:line 1379\r\n at Umbraco.Core.Events.EventExtensions.RaiseEvent[TSender,TArgs](TypedEventHandler2 eventHandler, TArgs args, TSender sender) in D:\a\1\s\src\Umbraco.Core\Events\EventExtensions.cs:line 43\r\n at Umbraco.Core.Services.Implement.ContentTypeServiceBase2.OnUowRefreshedEntity(EventArgs args) in D:\\a\\1\\s\\src\\Umbraco.Core\\Services\\Implement\\ContentTypeServiceBaseOfTItemTService.cs:line 51\r\n at Umbraco.Core.Services.Implement.ContentTypeServiceBase3.Save(TItem item, Int32 userId) in D:\a\1\s\src\Umbraco.Core\Services\Implement\ContentTypeServiceBaseOfTRepositoryTItemTService.cs:line 429\r\n at Umbraco.Web.Editors.ContentTypeController.1(IContentType type) in D:\a\1\s\src\Umbraco.Web\Editors\ContentTypeController.cs:line 301\r\n at Umbraco.Web.Editors.ContentTypeControllerBase1.PerformPostSave[TContentTypeDisplay,TContentTypeSave,TPropertyType](TContentTypeSave contentTypeSave, Func2 getContentType, Action1 saveContentType, Action1 beforeCreateNew) in D:\a\1\s\src\Umbraco.Web\Editors\ContentTypeControllerBase.cs:line 295\r\n at Umbraco.Web.Editors.ContentTypeController.PostSave(DocumentTypeSave contentTypeSave) in D:\a\1\s\src\Umbraco.Web\Editors\ContentTypeController.cs:line 298\r\n at lambdamethod(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>cDisplayClass62.

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft