Error when create new culture version by copy from other culture of a tree node

GTEK IT DEV Team asked on July 24, 2018 05:22

Hi guys, i'm getting a problem.

When i'm copy a culture version of a node to other culture version. Like that: Image Text

But when i pressed the Create Page button the page is not created. It still display message "The page does not exist in the current culture. You can create a new culture version of the page.". And if i press the Create Page button again it display an error message like that. Image Text

And in Event Log Application. I found an error log:

Message: 
[DataConnection.HandleError]: 

Query: 
INSERT INTO CMS_Document ([DocumentName], [DocumentNamePath], [DocumentModifiedWhen], [DocumentModifiedByUserID], [DocumentForeignKeyValue], [DocumentCreatedByUserID], [DocumentCreatedWhen], [DocumentCheckedOutByUserID], [DocumentCheckedOutWhen], [DocumentCheckedOutVersionHistoryID], [DocumentPublishedVersionHistoryID], [DocumentWorkflowStepID], [DocumentPublishFrom], [DocumentPublishTo], [DocumentUrlPath], [DocumentCulture], [DocumentNodeID], [DocumentPageTitle], [DocumentPageKeyWords], [DocumentPageDescription], [DocumentShowInSiteMap], [DocumentMenuItemHideInNavigation], [DocumentMenuCaption], [DocumentMenuStyle], [DocumentMenuItemImage], [DocumentMenuItemLeftImage], [DocumentMenuItemRightImage], [DocumentPageTemplateID], [DocumentMenuJavascript], [DocumentMenuRedirectUrl], [DocumentUseNamePathForUrlPath], [DocumentStylesheetID], [DocumentContent], [DocumentMenuClass], [DocumentMenuStyleHighlighted], [DocumentMenuClassHighlighted], [DocumentMenuItemImageHighlighted], [DocumentMenuItemLeftImageHighlighted], [DocumentMenuItemRightImageHighlighted], [DocumentMenuItemInactive], [DocumentCustomData], [DocumentExtensions], [DocumentTags], [DocumentTagGroupID], [DocumentWildcardRule], [DocumentWebParts], [DocumentRatingValue], [DocumentRatings], [DocumentPriority], [DocumentType], [DocumentLastPublished], [DocumentUseCustomExtensions], [DocumentGroupWebParts], [DocumentCheckedOutAutomatically], [DocumentTrackConversionName], [DocumentConversionValue], [DocumentSearchExcluded], [DocumentLastVersionNumber], [DocumentIsArchived], [DocumentHash], [DocumentLogVisitActivity], [DocumentGUID], [DocumentWorkflowCycleGUID], [DocumentSitemapSettings], [DocumentIsWaitingForTranslation], [DocumentSKUName], [DocumentSKUDescription], [DocumentSKUShortDescription], [DocumentWorkflowActionStatus], [DocumentMenuRedirectToFirstChild], [DocumentCanBePublished], [DocumentInheritsStylesheet]) 
VALUES (@DocumentName, @DocumentNamePath, @DocumentModifiedWhen, @DocumentModifiedByUserID, @DocumentForeignKeyValue, @DocumentCreatedByUserID, @DocumentCreatedWhen, @DocumentCheckedOutByUserID, @DocumentCheckedOutWhen, @DocumentCheckedOutVersionHistoryID, @DocumentPublishedVersionHistoryID, @DocumentWorkflowStepID, @DocumentPublishFrom, @DocumentPublishTo, @DocumentUrlPath, @DocumentCulture, @DocumentNodeID, @DocumentPageTitle, @DocumentPageKeyWords, @DocumentPageDescription, @DocumentShowInSiteMap, @DocumentMenuItemHideInNavigation, @DocumentMenuCaption, @DocumentMenuStyle, @DocumentMenuItemImage, @DocumentMenuItemLeftImage, @DocumentMenuItemRightImage, @DocumentPageTemplateID, @DocumentMenuJavascript, @DocumentMenuRedirectUrl, @DocumentUseNamePathForUrlPath, @DocumentStylesheetID, @DocumentContent, @DocumentMenuClass, @DocumentMenuStyleHighlighted, @DocumentMenuClassHighlighted, @DocumentMenuItemImageHighlighted, @DocumentMenuItemLeftImageHighlighted, @DocumentMenuItemRightImageHighlighted, @DocumentMenuItemInactive, @DocumentCustomData, @DocumentExtensions, @DocumentTags, @DocumentTagGroupID, @DocumentWildcardRule, @DocumentWebParts, @DocumentRatingValue, @DocumentRatings, @DocumentPriority, @DocumentType, @DocumentLastPublished, @DocumentUseCustomExtensions, @DocumentGroupWebParts, @DocumentCheckedOutAutomatically, @DocumentTrackConversionName, @DocumentConversionValue, @DocumentSearchExcluded, @DocumentLastVersionNumber, @DocumentIsArchived, @DocumentHash, @DocumentLogVisitActivity, @DocumentGUID, @DocumentWorkflowCycleGUID, @DocumentSitemapSettings, @DocumentIsWaitingForTranslation, @DocumentSKUName, @DocumentSKUDescription, @DocumentSKUShortDescription, @DocumentWorkflowActionStatus, @DocumentMenuRedirectToFirstChild, @DocumentCanBePublished, @DocumentInheritsStylesheet);

SELECT SCOPE_IDENTITY() AS [ID]

Caused exception: 
Cannot insert duplicate key row in object 'dbo.View_CMS_Tree_Joined' with unique index 'IX_View_CMS_Tree_Joined_NodeSiteID_DocumentCulture_NodeID'. The duplicate key value is (2, es-ES, 1976).
The statement has been terminated.


Exception type: System.Exception
Stack trace: 
at CMS.DataEngine.AbstractDataConnection.HandleError(String queryText, Exception ex)
at CMS.DataEngine.AbstractDataConnection.ExecuteQuery(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction)
at CMS.DataEngine.AbstractDataConnection.CMS.DataEngine.IDataConnection.ExecuteQuery(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction)
at CMS.DataEngine.GeneralConnection.RunQuery(QueryParameters query)
at CMS.DataEngine.GeneralConnection.RunQueryWithRetry(QueryParameters query, Int32 retryCount)
at CMS.DataEngine.GeneralConnection.ExecuteQuery(QueryParameters query)
at CMS.DataEngine.GeneralConnection.ExecuteQuery(QueryParameters query, Int32& totalRecords)
at CMS.DataEngine.DataQueryBase`1.GetDataFromDBInternal()
at CMS.DataEngine.DataQueryBase`1.GetDataFromDB()
at CMS.DataEngine.DataQueryBase`1.GetData()
at CMS.DataEngine.SimpleDataClass.Insert(Boolean initId)
at CMS.DataEngine.AbstractInfoBase`1.InsertDataInternal()
at CMS.DataEngine.AbstractInfoBase`1.InsertData()
at CMS.DataEngine.AbstractInfoBase`1.GeneralizedInfoWrapper.InsertData()
at CMS.DataEngine.AbstractInfoProvider`3.SetInfo(TInfo info)
at CMS.DocumentEngine.Internal.DocumentCultureDataInfoProvider.SetInfo(DocumentCultureDataInfo info)
at CMS.DocumentEngine.Internal.DocumentCultureDataInfo.SetObject()
at CMS.DataEngine.BaseInfo.Insert()
at CMS.DocumentEngine.TreeNode.InsertCultureData()
at CMS.DocumentEngine.TreeNode.InsertAsNewCultureVersionInternal(String cultureCode)
at CMS.DocumentEngine.TreeNode.InsertAsNewCultureVersion(String cultureCode, Boolean useDocumentHelper)
at CMS.DocumentEngine.DocumentHelper.InsertNewCultureVersion(NewCultureDocumentSettings settings)
at CMSModules_Content_Controls_NewCultureVersion.btnCreateDocument_Click(Object sender, EventArgs e) in C:\inetpub\wwwroot\KenticoSites\CMSModules\Content\Controls\NewCultureVersion.ascx.cs:line 241

Message: Cannot insert duplicate key row in object 'dbo.View_CMS_Tree_Joined' with unique index 'IX_View_CMS_Tree_Joined_NodeSiteID_DocumentCulture_NodeID'. The duplicate key value is (2, es-ES, 1976).
The statement has been terminated.

Exception type: System.Data.SqlClient.SqlException
Stack trace: 
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 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)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, 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 asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at CMS.DataEngine.AbstractDataConnection.ExecuteQuery(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction)

How can i resolve this problem?

Thanks.

Recent Answers


Trevor Fayas answered on July 24, 2018 15:01

Sounds like a small UI issue.

Try:

  1. resigning your macros (System -> Macros -> Signatures and check the box and resign)
  2. clearing the cache and restarting the application.
  3. Then clear your browser cache, see if that resolves the issue.

Next step is to bring up a browser inspector and try again and see if there is some form of a javascript error or something, or if there is some custom event hook preventing a task from finishing. The SQL error means that the page should have been created as it has the document in es-es entry, however Tree Nodes consist of at least 3 tables (CMS_Tree, CMS_Document, and the table for the page type).

1 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on July 25, 2018 11:54

To add to what Trevor wrote, I would check the CMS_Document table and look for records WHERE DocumentNodeID = 1976 - what records are returned and what is the DocumentCulture for these records? It also sounds like there is some inconsistency in the DB and maybe some orphaned nodes or documents in the CMS_Tree and CMS_Document tables.

0 votesVote for this answer Mark as a Correct answer

Elmar Höfinghoff answered on July 30, 2018 13:02

Hi guys,

we get this error, too.

We upgraded Kentico 9 to Kentico 11. Maybe a reason of this? I asked our customer for more details on this error. Unfortunatelly I currently only have a screenshot but no detailed error log.

Kind regards, Elmar

0 votesVote for this answer Mark as a Correct answer

GTEK IT DEV Team answered on July 31, 2018 03:51

Hi Elmar Höfinghoff,

We resolved this problem. We just want to clear all browser data. And everything works find.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.