Copied to clipboard

Flag this post as spam?

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


  • David Sheiles 67 posts 337 karma points
    Nov 03, 2015 @ 03:46
    David Sheiles
    0

    7.3.0 -> 7.3.1 upgrade failed - A duplicate value cannot be inserted into a unique index

    Hi,

    I've just upgraded 7.3.0 to 7.3.1 using Nuget and during the upgrade wizard I get the following error (Using SQL CE):

    The database failed to upgrade. ERROR: The database configuration failed with the following message: A duplicate value cannot be inserted into a unique index. [ Table name = umbracoMigration,Constraint name = PK_umbracoMigration ]

    I've checked the umbracoMigration and there is a single row:

    id: 1, name: Umbraco, createDate: 21/10/2015, version:7.3.0

    Has anyone had the same issue?

    Here's the log file of the DB upgrade:

    2015-11-03 14:28:37,141 [P16016/D2/T11] INFO  Umbraco.Web.Install.Controllers.InstallApiController - Executing installation step: DatabaseInstall
     2015-11-03 14:28:37,143 [P16016/D2/T11] INFO  Umbraco.Core.DatabaseContext - Database configuration status: Started
     2015-11-03 14:28:37,144 [P16016/D2/T11] INFO  Umbraco.Core.DatabaseContext - Database requires upgrade
     2015-11-03 14:28:37,144 [P16016/D2/T11] INFO  Umbraco.Web.Install.Controllers.InstallApiController - Step completed (took 2ms)
     2015-11-03 14:28:37,160 [P16016/D2/T7] INFO  Umbraco.Web.Install.Controllers.InstallApiController - Executing installation step: DatabaseUpgrade
     2015-11-03 14:28:37,161 [P16016/D2/T7] INFO  Umbraco.Web.Install.InstallSteps.DatabaseUpgradeStep - Running 'Upgrade' service
     2015-11-03 14:28:37,164 [P16016/D2/T7] INFO  Umbraco.Core.DatabaseContext - Database upgrade started
     2015-11-03 14:28:37,179 [P16016/D2/T7] INFO  Umbraco.Core.Persistence.Migrations.MigrationRunner - Initializing database migrations
     2015-11-03 14:28:37,180 [P16016/D2/T7] INFO  Umbraco.Core.PluginManager - Starting resolution types of Umbraco.Core.Persistence.Migrations.IMigration
     2015-11-03 14:28:37,185 [P16016/D2/T7] INFO  Umbraco.Core.PluginManager - Completed resolution of types of Umbraco.Core.Persistence.Migrations.IMigration, found 0 (took 5ms)
     2015-11-03 14:28:37,206 [P16016/D2/T7] INFO  Umbraco.Core.Persistence.Migrations.MigrationRunner - Added UPGRADE migration 'UpdateUserLanguagesToIsoCode' to context
     2015-11-03 14:28:37,462 [P16016/D2/T7] INFO  Umbraco.Core.Persistence.UmbracoDatabase -    at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
       at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor)
       at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
       at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
       at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteNonQuery() in c:\Code\github\SamSaffron\MiniProfiler\StackExchange.Profiling\Data\ProfiledDbCommand.cs:line 279
       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.Insert(String tableName, String primaryKeyName, Boolean autoIncrement, Object poco)
     2015-11-03 14:28:37,465 [P16016/D2/T7] ERROR Umbraco.Core.DatabaseContext - Database configuration failed
    System.Data.SqlServerCe.SqlCeException (0x80004005): A duplicate value cannot be inserted into a unique index. [ Table name = umbracoMigration,Constraint name = PK_umbracoMigration ]
       at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
       at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor)
       at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
       at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
       at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteNonQuery() in c:\Code\github\SamSaffron\MiniProfiler\StackExchange.Profiling\Data\ProfiledDbCommand.cs:line 279
       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.Insert(String tableName, String primaryKeyName, Boolean autoIncrement, Object poco)
       at Umbraco.Core.Persistence.Database.Insert(Object poco)
       at Umbraco.Core.Persistence.Repositories.MigrationEntryRepository.PersistNewItem(IMigrationEntry entity)
       at Umbraco.Core.Persistence.Repositories.RepositoryBase`2.PersistNewItem(IEntity entity)
       at Umbraco.Core.Persistence.UnitOfWork.PetaPocoUnitOfWork.Commit(Action`1 transactionCompleting)
       at Umbraco.Core.Persistence.UnitOfWork.PetaPocoUnitOfWork.Commit()
       at Umbraco.Core.Services.MigrationEntryService.CreateEntry(String migrationName, SemVersion version)
       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)
     2015-11-03 14:28:37,469 [P16016/D2/T7] 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:
    icUrlTracker
    
    The following columns were found in the database, but are not in the current schema:
    icUrlTracker,Id,icUrlTracker,OldUrl,icUrlTracker,OldUrlQueryString,icUrlTracker,OldRegex,icUrlTracker,RedirectRootNodeId,icUrlTracker,RedirectNodeId,icUrlTracker,RedirectUrl,icUrlTracker,RedirectHttpCode,icUrlTracker,RedirectPassThroughQueryString,icUrlTracker,ForceRedirect,icUrlTracker,Notes,icUrlTracker,Is404,icUrlTracker,Referrer,icUrlTracker,Inserted
    
    
     2015-11-03 14:28:37,470 [P16016/D2/T7] 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: A duplicate value cannot be inserted into a unique index. [ Table name = umbracoMigration,Constraint name = PK_umbracoMigration ]
     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)
     2015-11-03 14:28:37,472 [P16016/D2/T7] INFO  Umbraco.Web.Install.Controllers.InstallApiController - Step completed (took 311ms)
     2015-11-03 14:28:37,472 [P16016/D2/T7] 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: A duplicate value cannot be inserted into a unique index. [ Table name = umbracoMigration,Constraint name = PK_umbracoMigration ]
     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)
    
  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Nov 03, 2015 @ 07:14
    Sebastiaan Janssen
    1

    Did you happen to remove the version number from web.config (umbracoConfigurationStatus) or remove the values in the connectionstring before you upgraded Umbraco?

  • David Sheiles 67 posts 337 karma points
    Nov 03, 2015 @ 07:50
    David Sheiles
    0

    Thanks Sebastiaan,

    I've just checked in case I accidentally overwrote them, but the umbracoConfigurationStatus is still at 7.3.0 and the umbracoDbDSN hasn't changed.

    I've just re-run the install process again and it's worked this time, so I'm all good, but would be interested to see if it's happening to anyone else.

  • Asbjørn 82 posts 195 karma points c-trib
    Nov 08, 2015 @ 13:06
    Asbjørn
    0

    Just had this exact issue as well.

    As with David, install worked fine the second time.

  • Martin Carlsén 5 posts 75 karma points
    Nov 15, 2015 @ 18:56
    Martin Carlsén
    0

    I got the same issue when upgrading from 7.3.0 to 7.3.1 and it worked fine the second time. But I´ve also got errors with the grid property editor: Error in the grid property editor

Please Sign in or register to post replies

Write your reply to:

Draft