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
I'm trying to restore from an Umbraco Cloud environment into my Development environment and get the following error.
"An error occurred when saving the relateDocumentOnCopy relation."
Reproduction
Bug summary
Unable to transfer content from Live to Development environments due to a SQL error related to a relationship between documents.
Specifics
This was whilst doing a partial restore with specified content including items below. The target environment is empty, so this is a fresh restore.
Steps to reproduce
Unsure, but given the error I imagine having an environment with documents that are related to each other and trying to restore them produces this error.
Expected result
The transfer should succeed, and relations should be copied successfully.
Actual result
Exception as follows.
Umbraco.Deploy.Core.Exceptions.EnvironmentException: An error occured when saving the relateDocumentOnCopy relation between parent node ID 2035 (umb://document/b50dadc2d6ed45b19f40b3dc439d89d1) and child node ID 2015 (umb://document/a42ee2f0b94f4f8e93763ed4a7c42bbf).
---> Microsoft.Data.SqlClient.SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "FK_umbracoRelation_umbracoNode1". The conflict occurred in database "akg1tuweqgu", table "dbo.umbracoNode", column 'id'.
The statement has been terminated.
at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)
at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at Microsoft.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at Microsoft.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean isAsync, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String method)
at Microsoft.Data.SqlClient.SqlCommand.ExecuteScalar()
at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
at NPoco.Database.ExecuteScalarHelper(DbCommand cmd)
at NPoco.Database.InsertAsyncImp[T](PocoData pocoData, String tableName, String primaryKeyName, Boolean autoIncrement, T poco, Boolean sync)
at NPoco.Database.Insert[T](String tableName, String primaryKeyName, Boolean autoIncrement, T poco)
at NPoco.Database.Insert[T](T poco)
at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.RelationRepository.PersistNewItem(IRelation entity)
at Umbraco.Cms.Core.Cache.NoCacheRepositoryCachePolicy`2.Create(TEntity entity, Action`1 persistNew)
at Umbraco.Cms.Core.Services.RelationService.Save(IRelation relation)
at Umbraco.Deploy.Infrastructure.Core.ArtifactRelator.ProcessRelations(IEnumerable`1 artifacts, IEnumerable`1 relations, CancellationToken token)
ClientConnectionId:82728dc0-d64e-4b9b-bd4a-f90530746666
Error Number:547,State:0,Class:16
ClientConnectionId before routing:787eab2c-3304-4bd0-8ec9-e92881390520
Routing Destination:ce6be563ef3a.tr8899.uksouth1-a.worker.database.windows.net,11063
--- End of inner exception stack trace ---
at Umbraco.Deploy.Infrastructure.Core.ArtifactRelator.ProcessRelations(IEnumerable`1 artifacts, IEnumerable`1 relations, CancellationToken token)
at Umbraco.Deploy.Infrastructure.Environments.CurrentEnvironment.ProcessPackageAsync(Guid sessionId, Package package, CancellationToken cancellationToken)
at Umbraco.Deploy.Infrastructure.Work.WorkItems.DeployRestoreWorkItemBase.ProcessPackage(Package package, Nullable`1 batchIndex, Nullable`1 numberOfBatches)
at Umbraco.Deploy.Infrastructure.Work.WorkItems.TargetPartialRestoreWorkItem.Proceed()
at Umbraco.Deploy.Infrastructure.Work.WorkItems.TargetPartialRestoreWorkItem.ExecuteAsyncSub(IWorkContext context, List`1 resume, CancellationToken token)
at Umbraco.Deploy.Infrastructure.Work.WorkItems.TargetPartialRestoreWorkItem.ExecuteAsyncSub(IWorkContext context, List`1 resume, CancellationToken token)
The text was updated successfully, but these errors were encountered:
I'm trying to restore from an Umbraco Cloud environment into my Development environment and get the following error.
"An error occurred when saving the relateDocumentOnCopy relation."
Reproduction
Bug summary
Unable to transfer content from Live to Development environments due to a SQL error related to a relationship between documents.
Specifics
This was whilst doing a partial restore with specified content including items below. The target environment is empty, so this is a fresh restore.
Steps to reproduce
Unsure, but given the error I imagine having an environment with documents that are related to each other and trying to restore them produces this error.
Expected result
The transfer should succeed, and relations should be copied successfully.
Actual result
Exception as follows.
The text was updated successfully, but these errors were encountered: