Copied to clipboard

Flag this post as spam?

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


  • Gijs Maris 1 post 71 karma points
    Oct 16, 2017 @ 10:35
    Gijs Maris
    0

    Upgrading to Umbraco 7.6.0 or later results in an error

    Greetings,

    We are upgrading Umbraco from 7.2.8 to 7.7.2, but it results in the following error:

    Cannot insert duplicate key row in object 'dbo.umbracoNode' with unique index 'IXumbracoNodeuniqueID'. The duplicate key value is (11bfc5e9-3a80-3b29-9d48-27c3157941a2). The statement has been terminated.

    I've looked in the database and noticed there wasn't a IXumbracoNodeuniqueID but a IX_umbracoNodeUniqueID instead. Comparing it to a 7.7 database we have running, it decided to rename the index. This resulted in the following error when trying to upgrade again:

    The index 'IXumbracoNodeuniqueID' is dependent on column 'uniqueID'. ALTER TABLE ALTER COLUMN uniqueID failed because one or more objects access this column.

    After searching through Google and here, I've stumbled upon this page: http://issues.umbraco.org/issue/U4-9993 Scrolling through the thread I learned that I had to remove the index to run the following command and recreate the index:

    ALTER TABLE [umbracoNode] ALTER COLUMN [uniqueID] UniqueIdentifier NOT NULL

    After running that command I tried to upgrade (again), but it resulted in this error:

    The operation failed because an index or statistics with name 'IXumbracoNodeuniqueID' already exists on table 'umbracoNode'.

    Understanding this, I removed the index again and let Umbraco create the index, hoping to resolve previous error. Too bad, that didn't solve my issue because of the following error:

    Cannot insert duplicate key row in object 'dbo.umbracoNode' with unique index 'IXumbracoNodeuniqueID'. The duplicate key value is (11bfc5e9-3a80-3b29-9d48-27c3157941a2). The statement has been terminated.

    The last error is the same as the first error I ran into, basically a non-existing IXumbracoNodeuniqueID.

    Did anyone else had this problem, and if so, what did you do to resolve this?

    This is basically keeping me from upgrading to 7.7.2 and keeping me at 7.5.14.

  • Aleksander 45 posts 205 karma points
    Mar 23, 2018 @ 14:13
    Aleksander
    0

    Anyone with this error ? I'm getting it right now aswel....

    this is the last output of the log:

       2018-03-23 15:19:35,712 [P23724/D3/T18] INFO  Umbraco.Core.Persistence.Migrations.MigrationRunner - Executing sql statement 82: CREATE UNIQUE NONCLUSTERED INDEX [IX_cmsMacroProperty_UniquePropertyId] ON [cmsMacroProperty] ([uniquePropertyId])
    
     2018-03-23 15:19:35,814 [P23724/D3/T18] ERROR Umbraco.Core.Persistence.UmbracoDatabase - Exception (870f79a6).
    System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.umbracoNode' with unique index 'IX_umbracoNode_uniqueID'. The duplicate key value is (a9620a0c-fbb3-270f-b2dd-4492cc9db47e).
    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, 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.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)
       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.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteNonQuery() in c:\Code\github\SamSaffron\MiniProfiler\StackExchange.Profiling\Data\ProfiledDbCommand.cs:line 266
       at Umbraco.Core.Persistence.PetaPocoCommandExtensions.<>c__DisplayClass1.<ExecuteNonQueryWithRetry>b__0()
       at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
       at Umbraco.Core.Persistence.PetaPocoCommandExtensions.ExecuteNonQueryWithRetry(IDbCommand command, RetryPolicy cmdRetryPolicy, RetryPolicy conRetryPolicy)
       at Umbraco.Core.Persistence.PetaPocoCommandExtensions.ExecuteNonQueryWithRetry(IDbCommand command, RetryPolicy retryPolicy)
       at Umbraco.Core.Persistence.PetaPocoCommandExtensions.ExecuteNonQueryWithRetry(IDbCommand command)
       at Umbraco.Core.Persistence.Database.Execute(String sql, Object[] args)
    ClientConnectionId:2a27c0ad-297d-43f3-9076-7cd2bc1853ef
    Error Number:2601,State:1,Class:14
     2018-03-23 15:19:35,869 [P23724/D3/T18] ERROR Umbraco.Core.DatabaseContext - Database configuration failed
    System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.umbracoNode' with unique index 'IX_umbracoNode_uniqueID'. The duplicate key value is (a9620a0c-fbb3-270f-b2dd-4492cc9db47e).
    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, 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.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)
       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.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteNonQuery() in c:\Code\github\SamSaffron\MiniProfiler\StackExchange.Profiling\Data\ProfiledDbCommand.cs:line 266
       at Umbraco.Core.Persistence.PetaPocoCommandExtensions.<>c__DisplayClass1.<ExecuteNonQueryWithRetry>b__0()
       at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
       at Umbraco.Core.Persistence.PetaPocoCommandExtensions.ExecuteNonQueryWithRetry(IDbCommand command, RetryPolicy cmdRetryPolicy, RetryPolicy conRetryPolicy)
       at Umbraco.Core.Persistence.PetaPocoCommandExtensions.ExecuteNonQueryWithRetry(IDbCommand command, RetryPolicy retryPolicy)
       at Umbraco.Core.Persistence.PetaPocoCommandExtensions.ExecuteNonQueryWithRetry(IDbCommand command)
       at Umbraco.Core.Persistence.Database.Execute(String sql, Object[] args)
       at Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSixZero.NormalizeTemplateGuids.UpdateTemplateGuids(Database database)
       at Umbraco.Core.Persistence.Migrations.Syntax.Execute.Expressions.ExecuteCodeStatementExpression.Process(Database database)
       at Umbraco.Core.Persistence.Migrations.MigrationRunner.ExecuteMigrations(IMigrationContext context, Database database)
       at Umbraco.Core.Persistence.Migrations.MigrationRunner.Execute(Database database, DatabaseProviders databaseProvider, Boolean isUpgrade)
       at Umbraco.Core.Persistence.Migrations.MigrationRunner.Execute(Database database, Boolean isUpgrade)
       at Umbraco.Core.DatabaseContext.UpgradeSchemaAndData(IMigrationEntryService migrationEntryService)
    ClientConnectionId:2a27c0ad-297d-43f3-9076-7cd2bc1853ef
    Error Number:2601,State:1,Class:14
     2018-03-23 15:19:35,891 [P23724/D3/T18] INFO  Umbraco.Core.DatabaseContext - The database schema validation produced the following summary: 
    The following tables were found in the database, but are not in the current schema:
    umbracoDeployChecksum,umbracoDeployDependency,UFRecords,UFRecordFields,UFRecordDataString,UFRecordDataLongString,UFRecordDataInteger,UFRecordDataBit,UFRecordDataDateTime,UFUserSecurity,UFUserFormSecurity,appstractQuestionPoll,umbracoLock
    
    The following columns were found in the database, but are not in the current schema:
    umbracoDeployChecksum,id,umbracoDeployChecksum,entityType,umbracoDeployChecksum,entityGuid,umbracoDeployChecksum,entityPath,umbracoDeployChecksum,localChecksum,umbracoDeployChecksum,compositeChecksum,umbracoDeployDependency,sourceId,umbracoDeployDependency,targetId,umbracoDeployDependency,mode,UFRecords,Id,UFRecords,Form,UFRecords,Created,UFRecords,Updated,UFRecords,CurrentPage,UFRecords,UmbracoPageId,UFRecords,IP,UFRecords,MemberKey,UFRecords,UniqueId,UFRecords,State,UFRecords,RecordData,UFRecordFields,Key,UFRecordFields,FieldId,UFRecordFields,Record,UFRecordFields,Alias,UFRecordFields,DataType,UFRecordDataString,Id,UFRecordDataString,Key,UFRecordDataString,Value,UFRecordDataLongString,Id,UFRecordDataLongString,Key,UFRecordDataLongString,Value,UFRecordDataInteger,Id,UFRecordDataInteger,Key,UFRecordDataInteger,Value,UFRecordDataBit,Id,UFRecordDataBit,Key,UFRecordDataBit,Value,UFRecordDataDateTime,Id,UFRecordDataDateTime,Key,UFRecordDataDateTime,Value,UFUserSecurity,User,UFUserSecurity,ManageDataSources,UFUserSecurity,ManagePreValueSources,UFUserSecurity,ManageWorkflows,UFUserSecurity,ManageForms,UFUserFormSecurity,Id,UFUserFormSecurity,User,UFUserFormSecurity,Form,UFUserFormSecurity,HasAccess,UFUserFormSecurity,AllowInEditor,UFUserFormSecurity,SecurityType,appstractQuestionPoll,question_id,appstractQuestionPoll,answer_text,appstractQuestionPoll,count,cmsMacro,uniqueId,cmsMacroProperty,uniquePropertyId,umbracoRelationType,typeUniqueId,umbracoLock,id,umbracoLock,value,umbracoLock,name
    
    The following constraints (Primary Keys, Foreign Keys and Indexes) were found in the database, but are not in the current schema:
    FK_cmsTagRelationship_umbracoNode_id,FK_UFRecordDataBit_UFRecordFields_Key,FK_UFRecordDataDateTime_UFRecordFields_Key,FK_UFRecordDataInteger_UFRecordFields_Key,FK_UFRecordDataLongString_UFRecordFields_Key,FK_UFRecordDataString_UFRecordFields_Key,FK_umbracoDeployDependency_umbracoDeployChecksum_id1,FK_umbracoDeployDependency_umbracoDeployChecksum_id2,FK_umbracoExternalLogin_umbracoUser_id,FK_umbracoRedirectUrl,FK_umbracoRedirectUrl_umbracoNode_uniqueID,PK_appstractQuestionPoll,PK_UFRecordDataBit,PK_UFRecordDataDateTime,PK_UFRecordDataInteger,PK_UFRecordDataLongString,PK_UFRecordDataString,PK_UFRecordFields,PK_UFRecords,PK_umbracoDeployChecksum,PK_umbracoDeployDependency,PK_umbracoMigrations,PK_umbracoMigration,PK_umbracoLock,IX_umbracoNodeTrashed,IX_umbracoNodeParentId,IX_umbracoNodePath,IX_umbracoNodeUniqueID,IX_umbracoNodeObjectType,IX_cmsContentType,IX_cmsContentType_icon,IX_cmsTemplate_nodeId,IX_cmsContent,IX_cmsContentVersion_ContentId,IX_cmsContentVersion_VersionId,IX_cmsDocument,IX_cmsDocument_published,IX_cmsDocument_newest,IX_cmsDataType_nodeId,IX_cmsDictionary_id,IX_umbracoLanguage_languageISOCode,IX_umbracoLog,IX_cmsMacro_UniqueId,IX_cmsMacroPropertyAlias,IX_cmsMacroProperty_UniquePropertyId,IX_cmsMacroProperty_Alias,IX_cmsMember_LoginName,IX_cmsPropertyTypeGroupUniqueID,IX_cmsPropertyTypeUniqueID,IX_cmsPropertyData_1,IX_cmsPropertyData_2,IX_cmsPropertyData_3,IX_umbracoRelationType_UniqueId,IX_umbracoRelationType_name,IX_umbracoRelationType_alias,IX_umbracoRelation_parentChildType,IX_cmsTags,IX_umbracoUser_userLogin,IX_cmsTaskType_alias,IX_umbracoUser2NodePermission_nodeId,IX_computerName,IX_umbracoServer_isActive,IX_umbracoAccess_nodeId,IX_umbracoAccessRule,IX_umbracoMigration,IX_umbracoRedirectUrl
    
    The following indexes were found in the database, but are not in the current schema:
    IX_cmsPropertyData,IX_databit_recordfield,IX_datadatetime_recordfield,IX_datainteger_recordfield,IX_datalongstring_recordfield,IX_datastring_recordfield,Id,IX_umbracoDeployChecksum,IX_umbracoNode_uniqueID,IX_umbracoNodePath,IX_umbracoNodeUniqueID,IX_cmsMacro_UniqueId,IX_cmsMacroProperty_UniquePropertyId,IX_cmsMember_LoginName,IX_umbracoRelationType_UniqueId,IX_umbracoRelationType_name,IX_umbracoRelationType_alias,IX_umbracoRelation_parentChildType,IX_umbracoUser2NodePermission_nodeId
    
    The following unknown constraints (Primary Keys, Foreign Keys and Indexes) were found in the database, but are not in the current schema:
    Id
    
    
     2018-03-23 15:19:35,899 [P23724/D3/T18] ERROR Umbraco.Web.Install.Controllers.InstallApiController - Installation step DatabaseUpgrade failed.
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Umbraco.Web.Install.InstallException: The database failed to upgrade. ERROR: The database configuration failed with the following message: Cannot insert duplicate key row in object 'dbo.umbracoNode' with unique index 'IX_umbracoNode_uniqueID'. The duplicate key value is (a9620a0c-fbb3-270f-b2dd-4492cc9db47e).
    The statement has been terminated.
     Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt')
       at Umbraco.Web.Install.InstallSteps.DatabaseUpgradeStep.Execute(Object model)
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at Umbraco.Web.Install.Controllers.InstallApiController.ExecuteStep(InstallSetupStep step, JToken instruction)
     2018-03-23 15:19:35,905 [P23724/D3/T18] INFO  Umbraco.Web.Install.Controllers.InstallApiController - Step completed (took 2911ms)
     2018-03-23 15:19:35,906 [P23724/D3/T18] ERROR Umbraco.Web.Install.Controllers.InstallApiController - An error occurred during installation step DatabaseUpgrade
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Umbraco.Web.Install.InstallException: The database failed to upgrade. ERROR: The database configuration failed with the following message: Cannot insert duplicate key row in object 'dbo.umbracoNode' with unique index 'IX_umbracoNode_uniqueID'. The duplicate key value is (a9620a0c-fbb3-270f-b2dd-4492cc9db47e).
    The statement has been terminated.
     Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt')
       at Umbraco.Web.Install.InstallSteps.DatabaseUpgradeStep.Execute(Object model)
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at Umbraco.Web.Install.Controllers.InstallApiController.ExecuteStep(InstallSetupStep step, JToken instruction)
       at Umbraco.Web.Install.Controllers.InstallApiController.PostPerformInstall(InstallInstructions installModel)
     2018-03-23 15:19:41,312 [P23724/D2/T11] INFO  Umbraco.Core.UmbracoApplicationBase - Application shutdown. Details: ConfigurationChange
    
    _shutDownMessage=CONFIG change
    HostingEnvironment initiated shutdown
    CONFIG change
    CONFIG change
    HostingEnvironment caused shutdown
    
    _shutDownStack=   at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
       at System.Environment.get_StackTrace()
       at System.Web.Hosting.HostingEnvironment.InitiateShutdownInternal()
       at System.Web.Hosting.HostingEnvironment.InitiateShutdownWithoutDemand()
       at System.Web.HttpRuntime.ShutdownAppDomain(String stackTrace)
       at System.Web.Configuration.HttpConfigurationSystem.OnConfigurationChanged(Object sender, InternalConfigEventArgs e)
       at System.Configuration.Internal.InternalConfigRoot.OnConfigChanged(InternalConfigEventArgs e)
       at System.Configuration.BaseConfigurationRecord.OnStreamChanged(String streamname)
       at System.Web.Configuration.WebConfigurationHostFileChange.OnFileChanged(Object sender, FileChangeEvent e)
       at System.Web.DirectoryMonitor.FireNotifications()
       at System.Web.Util.WorkItem.CallCallbackWithAssert(WorkItemCallback callback)
       at System.Web.Util.WorkItem.OnQueueUserWorkItemCompletion(Object state)
       at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
       at System.Threading.ThreadPoolWorkQueue.Dispatch()
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
    
Please Sign in or register to post replies

Write your reply to:

Draft