Copied to clipboard

Flag this post as spam?

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


  • andy_rose 91 posts 117 karma points
    Nov 18, 2013 @ 13:31
    andy_rose
    2

    Database error during upgrade to v7

    To give some full context, this site went live as v4.7.2. We upgraded a while back to v4.11.4 and I am now attempting an upgrade spike to v7RC just to see the feasibility of carrying this out on the production site. As per a recommendation I have first upgraded to v6 before the v7 upgrade. This went ok but when I attempt the v7 upgrade I am getting a Sql error during the database upgrade show below:

    Database configuration failed with the following error and stack trace: 'DF_cmsMacroProperty_macroPropertyHidden' is not a constraint.

    Could not drop constraint. See previous errors.

    I've had a look at the database and it seems the constraint on the cmsMacroProperty table is called DF_macroProperty_macroPropertyHidden and not DF_cmsMacroProperty_macroPropertyHidden. Would this be an error from a previous upgrade and could anyone suggest a way to  repair this?

     

  • Gionata Aladino Canova 21 posts 42 karma points
    Nov 20, 2013 @ 11:37
    Gionata Aladino Canova
    0

    Same problem. I tried to upgrade from 4.11.3 to 7RC and update database failed with error:

    The database configuration failed with the following message: 'DF_cmsMacroProperty_macroPropertyHidden' non è un vincolo. Impossibile eliminare il vincolo. Vedere gli errori precedenti. Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt')

    This is last part of log:

       in Umbraco.Core.DatabaseContext.CreateDatabaseSchemaAndDataOrUpgrade()
    2013-11-20 11:32:33,876 [34] INFO  Umbraco.Core.DatabaseContext - [Thread 33] The database schema validation produced the following summary:
    The following tables were found in the database, but are not in the current schema:
    umbracoApp,cmsMacroPropertyType,cmsTab,umbracoAppTree,cmsPropertyTypeGroup,cmsContentType2ContentType,umbracoServer
     
    The following columns were found in the database, but are not in the current schema:
    umbracoApp,sortOrder,umbracoApp,appAlias,umbracoApp,appIcon,umbracoApp,appName,umbracoApp,appInitWithTreeAlias,cmsContentType,masterContentType,cmsMacroPropertyType,id,cmsMacroPropertyType,macroPropertyTypeAlias,cmsMacroPropertyType,macroPropertyTypeRenderAssembly,cmsMacroPropertyType,macroPropertyTypeRenderType,cmsMacroPropertyType,macroPropertyTypeBaseType,cmsTab,id,cmsTab,contenttypeNodeId,cmsTab,text,cmsTab,sortorder,umbracoUser,userDefaultPermissions,umbracoUser,defaultToLiveEditing,cmsPropertyType,tabId,cmsMacroProperty,macroPropertyHidden,cmsMacroProperty,macroPropertyType,umbracoAppTree,treeSilent,umbracoAppTree,treeInitialize,umbracoAppTree,treeSortOrder,umbracoAppTree,appAlias,umbracoAppTree,treeAlias,umbracoAppTree,treeTitle,umbracoAppTree,treeIconClosed,umbracoAppTree,treeIconOpen,umbracoAppTree,treeHandlerAssembly,umbracoAppTree,treeHandlerType,umbracoAppTree,action,cmsDataType,controlId,cmsTags,parentId
     
    The following constraints (Primary Keys, Foreign Keys and Indexes) were found in the database, but are not in the current schema:
    FK_cmsContent_umbracoNode,FK_cmsContentType_umbracoNode,FK_cmsContentVersion_cmsContent,FK_cmsContentXml_cmsContent,FK_cmsDataType_umbracoNode,FK_cmsDataTypePreValues_cmsDataType,FK_cmsDocument_cmsContent,FK_cmsDocument_cmsTemplate,FK_cmsDocument_umbracoNode,FK_cmsDocumentType_cmsContentType,FK_cmsDocumentType_cmsTemplate,FK_cmsDocumentType_umbracoNode,FK_cmsLanguageText_cmsDictionary,FK_cmsMacroProperty_cmsMacro,FK_cmsMember_cmsContent,FK_cmsMember_umbracoNode,FK_cmsMember2MemberGroup_cmsMember,FK_cmsMember2MemberGroup_umbracoNode,FK_cmsMemberType_cmsContentType,FK_cmsMemberType_umbracoNode,FK_cmsPreviewXml_cmsContent,FK_cmsPreviewXml_cmsContentVersion,FK_cmsPropertyData_cmsPropertyType,FK_cmsPropertyData_umbracoNode,FK_cmsPropertyType_cmsContentType,FK_cmsPropertyType_cmsDataType,FK_cmsPropertyType_cmsTab,FK_cmsStylesheet_umbracoNode,FK_cmsStylesheetProperty_umbracoNode,FK_cmsTab_cmsContentType,FK_cmsTask_cmsTaskType,FK_cmsTask_umbracoNode,FK_umbracoDomains_umbracoNode,FK_umbracoMacroProperty_umbracoMacroPropertyType,FK_umbracoNode_umbracoNode,FK_umbracoRelation_umbracoRelationType,FK_umbracoUser2app_umbracoUser,FK_umbracoUser2NodeNotify_umbracoNode,FK_umbracoUser2NodeNotify_umbracoUser,FK_umbracoUser2NodePermission_umbracoNode,FK_umbracoUser2NodePermission_umbracoUser,FK_user_userType,PK__cmsContentVersio__398D8EEE,PK_cmsContentPreviewXml,PK_cmsTab,PK_domains,PK_language,PK_macro,PK_macroProperty,PK_macroPropertyType,PK_templates,PK_umbracoApp,PK_umbracoAppTree,PK_userType,IX_cmsContentVersion,IX_cmsDataType,IX_cmsDictionary,IX_cmsTaskType,IX_cmsTemplate,IX_umbracoLanguage,IX_umbracoUser
     
    The following unknown constraints (Primary Keys, Foreign Keys and Indexes) were found in the database, but are not in the current schema:
    cmsTags_cmsTagRelationship,umbracoNode_cmsTagRelationship
     

  • martin griffiths 753 posts 1138 karma points
    Nov 21, 2013 @ 16:45
    martin griffiths
    0

    I can confirm the same problem going from 4.11.9 to 7.0.0

    I guess I was hopeful it would....just work!

    Oh well....sigh!

    Can anyone shed any light?

    Martin

  • Thanetos 3 posts 31 karma points
    Nov 24, 2013 @ 00:59
    Thanetos
    1

    The database configuration failed with the following message: 'DFcmsMacroPropertymacroPropertyHidden' is not a constraint. Could not drop constraint. See previous errors. Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt')

    I had the same problem and fix it by executing the following sql:

    use [<your-database-name>]
    go
    
    ALTER TABLE [dbo].[cmsMacroProperty] drop CONSTRAINT [DF_macroProperty_macroPropertyHidden]
    go
    
    ALTER TABLE [dbo].[cmsMacroProperty] ADD  CONSTRAINT [DF_cmsMacroProperty_macroPropertyHidden] DEFAULT ('0') FOR [macroPropertyHidden]
    GO
    
  • andy_rose 91 posts 117 karma points
    Nov 25, 2013 @ 10:30
    andy_rose
    0

    I've done some investigation into this and it appears the Constraint was renamed from v6.0.0.0 onwards however any upgrade from a v4.* doesn't appear to rename this. As far as I have tested this issue doesn't seem to affect v6 but it appears that something breaks in v7. I think I'll raise this in the issue tracker and see if I can some input from the Core team.

  • andy_rose 91 posts 117 karma points
    Nov 25, 2013 @ 10:38
    andy_rose
    0

    Looks like this has already been raised, go and up vote this if you are being affected by it.

    http://issues.umbraco.org/issue/U4-3616

  • Gionata Aladino Canova 21 posts 42 karma points
    Nov 25, 2013 @ 11:31
    Gionata Aladino Canova
    0

    After launching suggested query, the database update fails with this error message:

    The database configuration failed with the following message: 'FK_cmsMacroProperty_cmsMacroPropertyType_id' non è un vincolo. Impossibile eliminare il vincolo. Vedere gli errori precedenti. Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt')

    Umbraco developers, where are you? :)

  • martin griffiths 753 posts 1138 karma points
    Nov 25, 2013 @ 17:47
    martin griffiths
    0

    I tried running the SQL and it didnt help, I still have the same error. Upgrading from 4.11.9 to 6.1.6 is fine, but as soon as I go from 6 to 7 bammm!

  • martin griffiths 753 posts 1138 karma points
    Nov 26, 2013 @ 10:22
    martin griffiths
    0

    I've added this comment to the bug in the tracker....

    The SQL upgrade scripts from 4.11.x -> 6.x either don't exist or were poorly written and not tested enough. I went from 6.1.6 to 7.0 attempting to fix foreign key names manually then eventually hit this road block...

    The database configuration failed with the following message: There are no primary or candidate keys in the referenced table 'cmsContent' that match the referencing column list in the foreign key 'FK_cmsTagRelationship_cmsContent'. Could not create constraint. See previous errors. Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt')

  • Thanetos 3 posts 31 karma points
    Nov 27, 2013 @ 16:08
    Thanetos
    7

    Ok guys, maybe this help. But make sure that you make a backup!!!!

    first run this

    --- fix error no. 1
    /**
    The database configuration failed with the following message: 'DF_cmsMacroProperty_macroPropertyHidden' is not a constraint. Could not drop constraint. See previous errors. Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt')
     */
    ALTER TABLE [dbo].[cmsMacroProperty] drop CONSTRAINT [DF_macroProperty_macroPropertyHidden]
    go
    
    ALTER TABLE [dbo].[cmsMacroProperty] ADD  CONSTRAINT [DF_cmsMacroProperty_macroPropertyHidden]  DEFAULT ('0') FOR [macroPropertyHidden]
    GO
    

    Then you will have 2 additional upgrade error, that's why you need to run this

    --- fix error no. 2
    ALTER TABLE [dbo].[cmsMacroProperty]  WITH CHECK ADD  CONSTRAINT [FK_cmsMacroProperty_cmsMacroPropertyType_id] FOREIGN KEY([macroPropertyType])
    REFERENCES [dbo].[cmsMacroPropertyType] ([id])
    GO
    ALTER TABLE [dbo].[cmsMacroProperty] CHECK CONSTRAINT [FK_cmsMacroProperty_cmsMacroPropertyType_id]
    GO
    
    --- Error no. 3
    ALTER TABLE [dbo].[cmsMacroProperty] DROP CONSTRAINT [FK_umbracoMacroProperty_umbracoMacroPropertyType]
    GO
    

    At last, you need to run this one to fix the 4. error

    --- fix error no. 4
    /*
    The database configuration failed with the following message: 'FK_cmsTagRelationship_umbracoNode_id' is not a constraint. Could not drop constraint. See previous errors. Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt')
    */
    ALTER TABLE [dbo].[cmsTagRelationship]  WITH CHECK ADD  CONSTRAINT [FK_cmsTagRelationship_umbracoNode_id] FOREIGN KEY([nodeId])
    REFERENCES [dbo].[umbracoNode] ([id])
    GO
    
    ALTER TABLE [dbo].[cmsTagRelationship] CHECK CONSTRAINT [FK_cmsTagRelationship_umbracoNode_id]
    GO
    

    It's not possible to run all 4 script at once. This will result in an error!

  • martin griffiths 753 posts 1138 karma points
    Nov 27, 2013 @ 16:14
    martin griffiths
    0

    Hi Thanetos

    I got that far as posted and now I get this....any ideas....?

    The database configuration failed with the following message: There are no primary or candidate keys in the referenced table 'cmsContent' that match the referencing column list in the foreign key 'FK_cmsTagRelationship_cmsContent'. Could not create constraint. See previous errors. Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt')

  • Thanetos 3 posts 31 karma points
    Nov 27, 2013 @ 16:28
    Thanetos
    0

    I am not sure because I don't have this problem when updating my site. I can't find this foreign key in my database. From which Umbraco version do you upgrade?

    HHHhhhmmm... maybe you can just drop the foreign key?

    ALTER TABLE [dbo].[cmsTagRelationship] DROP CONSTRAINT [PK_cmsTagRelationship]
    GO
    
  • andy_rose 91 posts 117 karma points
    Nov 28, 2013 @ 11:06
    andy_rose
    0

    Good stuff Thanetos, I have managed to get a bit further with the upgrade using your scripts although not all the way there yet, still using the RC though so might try with a more recent v7 release. The Database upgrade progress bar just stayed at 5% although the log file implied that the database upgrade had finished. I manually added the new version number to the appsettings and can now access the back office.

  • martin griffiths 753 posts 1138 karma points
    Nov 28, 2013 @ 11:10
    martin griffiths
    0

    I found this post http://our.umbraco.org/forum/getting-started/installing-umbraco/46494-Upgrading-to-Umbraco-700-database-error?p=0#comment166700

    It's pretty obvious the upgrade script(s) from 4.x (mine is 4.11.9) to 6 and then to 7 hasn't been tested thoroughly enough I'm really quite annoyed! It's very sloppy!

  • Gionata Aladino Canova 21 posts 42 karma points
    Dec 09, 2013 @ 10:13
    Gionata Aladino Canova
    0

    I have noticed that in 7.01 version are notes about these bugs. Why?

  • martin griffiths 753 posts 1138 karma points
    Dec 09, 2013 @ 13:58
    martin griffiths
    0

    Hi Gionata

    I'm not entirely sure what you mean? Can you provide a link to what you've seen?

    M.

  • Jonas Eriksson 929 posts 1818 karma points
    Dec 18, 2013 @ 21:26
    Jonas Eriksson
    0

    Thanks for this thread. It helped me through my upgrade from 6 to 7.01. I ran in to these errors, and a few more - but I could not solve them by running the tsqls exactly. Instead I added fake constraints - as the upgrader removes them anyway for each error "missing" + but more strangely I had to add a few primary keys (to cmsTags, cmsContent, . I bet I should have used the nightly. Anyways, after about 8 errors I got the site up and running. And since this is for experimentation I will not dive deeper just now.

  • Jonas Eriksson 929 posts 1818 karma points
    Dec 19, 2013 @ 11:07
    Jonas Eriksson
    0

    Ok with the help of a Schema compare & Upgrade tool my upgraded site seems to work now, which is very cool. I compared my upgraded db with a db from a vanilla u7.01 install.

    I prepared to use Redgate for this, but found and used MS own (new since july) http://t.co/3uf1U8vRxM - integrated in VS, a nice experience.

  • Martin 1 post 29 karma points
    Jan 27, 2014 @ 08:20
    Martin
    8

    Good Tip, thank you, didn't know the VS compare tool!

    Here's what i used to update my DB, based on the scripts i found here. I can also post a 600+ line file where i made the v4 schema identical to a v7 schema (with VS compare tool).

    USE [dbname]

     

    IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = '[user]')

    CREATE USER [user] FOR LOGIN [user]

    EXEC sp_addrolemember 'db_datawriter', [user]

    EXEC sp_addrolemember 'db_datareader', [user]

    EXEC sp_addrolemember 'db_owner', [user]

    GO

     

    --- fix error no. 1

    /**

    The database configuration failed with the following message: 'DF_cmsMacroProperty_macroPropertyHidden' is not a constraint. Could not drop constraint. See previous errors. Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt')

     */

    ALTER TABLE [dbo].[cmsMacroProperty] drop CONSTRAINT [DF_macroProperty_macroPropertyHidden]

    go

     

    ALTER TABLE [dbo].[cmsMacroProperty] ADD  CONSTRAINT [DF_cmsMacroProperty_macroPropertyHidden]  DEFAULT ('0') FOR [macroPropertyHidden]

    GO

     

    --- fix error no. 2

    ALTER TABLE [dbo].[cmsMacroProperty]  WITH CHECK ADD  CONSTRAINT [FK_cmsMacroProperty_cmsMacroPropertyType_id] FOREIGN KEY([macroPropertyType])

    REFERENCES [dbo].[cmsMacroPropertyType] ([id])

    GO

    ALTER TABLE [dbo].[cmsMacroProperty] CHECK CONSTRAINT [FK_cmsMacroProperty_cmsMacroPropertyType_id]

    GO

     

    --- Error no. 3

    ALTER TABLE [dbo].[cmsMacroProperty] DROP CONSTRAINT [FK_umbracoMacroProperty_umbracoMacroPropertyType]

    GO

     

    --- fix error no. 4

    /*

    The database configuration failed with the following message: 'FK_cmsTagRelationship_umbracoNode_id' is not a constraint. Could not drop constraint. See previous errors. Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt')

    */

    ALTER TABLE [dbo].[cmsTagRelationship]  WITH CHECK ADD CONSTRAINT [FK_cmsTagRelationship_umbracoNode_id] FOREIGN KEY([nodeId])

    REFERENCES [dbo].[umbracoNode] ([id])

    GO

     

    ALTER TABLE [dbo].[cmsTagRelationship] CHECK CONSTRAINT [FK_cmsTagRelationship_umbracoNode_id]

    GO

     

    --- fix error no. 5

    /*

     There are no primary or candidate keys in the referenced table 'cmsContent' that match the referencing column list in the foreign key 'FK_cmsTagRelationship_cmsContent'.

     */

    CREATE UNIQUE NONCLUSTERED INDEX [IX_cmsContent]

        ON [dbo].[cmsContent]([nodeId] ASC);

    GO

  • Pavel Gurecki 55 posts 158 karma points
    Jul 04, 2014 @ 12:22
    Pavel Gurecki
    0

    Hi guys,

    I am struggling with v6.2.1 upgrade to v7.1.4 - I've managed to do it on dev servers but in production environment I've got db error when running install script:

    2014-07-03 16:46:45,332 [14] ERROR Umbraco.Web.Install.Controllers.InstallApiController - [Thread 10] 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: Exception has been thrown by the target of an invocation.
     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)

     

    This is a real show stopper for me, can't figure out where the problem lies, especially when there is no usefull information in exception message.

    Any ideas how to solve this or where to look?

  • martin griffiths 753 posts 1138 karma points
    Jul 04, 2014 @ 12:24
    martin griffiths
    0

    Anything useful in the tracelog?

    /App_Data/Logs/UmbracoTraceLog.txt
  • Pavel Gurecki 55 posts 158 karma points
    Jul 04, 2014 @ 12:45
    Pavel Gurecki
    0

    Not really.

    More detailed log file content:

    2014-07-03 16:46:42,832 [14] INFO  Umbraco.Web.Strategies.Migrations.ClearMediaXmlCacheForDeletedItemsAfterUpgrade - [Thread 10] Cleared 0 items from the media xml cache that were trashed and not meant to be there
    2014-07-03 16:46:42,863 [14] INFO  Umbraco.Core.PluginManager - [Thread 10] Starting resolution types of Umbraco.Core.Persistence.Mappers.BaseMapper
    2014-07-03 16:46:42,863 [14] INFO  Umbraco.Core.PluginManager - [Thread 10] Completed resolution of types of Umbraco.Core.Persistence.Mappers.BaseMapper, found 22 (took 12ms)
    2014-07-03 16:46:45,332 [14] INFO  Umbraco.Core.Persistence.UmbracoDatabase - [Thread 10]    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.UnsafeInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.Delegate.DynamicInvokeImpl(Object[] args)
       at Umbraco.Core.Persistence.Database.MultiPocoFactory.CallDelegate(Int32 index, IDataReader reader)
       at Umbraco.Core.Persistence.Database.MultiPocoFactory.CallCallback[TRet](Delegate callback, IDataReader dr, Int32 count)
       at Umbraco.Core.Persistence.Database.<>c__DisplayClass1a`1.<CreateMultiPocoFactory>b__19(IDataReader reader, Delegate arg3)
       at Umbraco.Core.Persistence.Database.<Query>d__1c`1.MoveNext()
    2014-07-03 16:46:45,332 [14] ERROR Umbraco.Core.DatabaseContext - [Thread 10] Database configuration failed
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.String'.
       at System.Data.SqlClient.SqlBuffer.get_String()
       at System.Data.SqlClient.SqlDataReader.GetString(Int32 i)
       at petapoco_factory_0(IDataReader )
       --- 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.UnsafeInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.Delegate.DynamicInvokeImpl(Object[] args)
       at Umbraco.Core.Persistence.Database.MultiPocoFactory.CallDelegate(Int32 index, IDataReader reader)
       at Umbraco.Core.Persistence.Database.MultiPocoFactory.CallCallback[TRet](Delegate callback, IDataReader dr, Int32 count)
       at Umbraco.Core.Persistence.Database.<>c__DisplayClass1a`1.<CreateMultiPocoFactory>b__19(IDataReader reader, Delegate arg3)
       at Umbraco.Core.Persistence.Database.<Query>d__1c`1.MoveNext()
       at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
       at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
       at Umbraco.Core.Persistence.Database.Fetch[T1,T2,TRet](Func`3 cb, Sql sql)
       at Umbraco.Core.Persistence.Repositories.UserRepository.PerformGet(Int32 id)
       at Umbraco.Core.Persistence.Repositories.RepositoryBase`2.Get(TId id)
       at Umbraco.Core.Services.UserService.GetUserById(Int32 id)
       at Umbraco.Core.Services.UserService.GetProfileById(Int32 id)
       at Umbraco.Core.Models.ContentExtensions.GetCreatorProfile(IMedia media)
       at Umbraco.Core.Services.EntityXmlSerializer.Serialize(IMediaService mediaService, IDataTypeService dataTypeService, IMedia media, Boolean deep)
       at Umbraco.Core.Services.MediaService.RebuildXmlStructures(Int32[] contentTypeIds)
       at Umbraco.Web.Strategies.Migrations.RebuildMediaXmlCacheAfterUpgrade.MigrationRunner_Migrated(MigrationRunner sender, MigrationEventArgs e)
       at Umbraco.Core.Events.TypedEventHandler`2.Invoke(TSender sender, TEventArgs e)
       at Umbraco.Core.Events.EventExtensions.RaiseEvent[TSender,TArgs](TypedEventHandler`2 eventHandler, TArgs args, TSender sender)
       at Umbraco.Core.Persistence.Migrations.MigrationRunner.Execute(Database database, DatabaseProviders databaseProvider, Boolean isUpgrade)
       at Umbraco.Core.DatabaseContext.UpgradeSchemaAndData()
    2014-07-03 16:46:45,332 [14] INFO  Umbraco.Core.DatabaseContext - [Thread 10] The database schema validation produced the following summary: 
    The following tables were found in the database, but are not in the current schema:
    icUrlTracker,cmsMacroPropertyType
    
    The following columns were found in the database, but are not in the current schema:
    cmsDataType,controlId,icUrlTracker,Id,icUrlTracker,OldUrl,icUrlTracker,OldUrlQueryString,icUrlTracker,OldRegex,icUrlTracker,RedirectRootNodeId,icUrlTracker,RedirectNodeId,icUrlTracker,RedirectUrl,icUrlTracker,RedirectHttpCode,icUrlTracker,RedirectPassThroughQueryString,icUrlTracker,Notes,icUrlTracker,Is404,icUrlTracker,Referrer,icUrlTracker,Inserted,icUrlTracker,ForceRedirect,cmsMacroPropertyType,id,cmsMacroPropertyType,macroPropertyTypeAlias,cmsMacroPropertyType,macroPropertyTypeRenderAssembly,cmsMacroPropertyType,macroPropertyTypeRenderType,cmsMacroPropertyType,macroPropertyTypeBaseType,cmsMacroProperty,macroPropertyHidden,cmsMacroProperty,macroPropertyType,umbracoUser,userDefaultPermissions,umbracoUser,defaultToLiveEditing,cmsDataType,propertyEditorAlias,cmsMacroProperty,editorAlias,cmsTagRelationship,propertyTypeId
    
    The following constraints (Primary Keys, Foreign Keys and Indexes) were found in the database, but are not in the current schema:
    FK_cmsMacroProperty_cmsMacroPropertyType_id,FK_cmsTagRelationship_umbracoNode_id,FK_cmsTags_cmsTags,FK_cmsTagRelationship_cmsContent,FK_cmsTagRelationship_cmsPropertyType,PK_cmsMacroPropertyType,PK_cmsPreviewXml,PK_icUrlTracker,PK_cmsContentPreviewXml,IX_umbracoNodeTrashed,IX_umbracoNodeParentId,IX_umbracoNodeObjectType,IX_cmsTemplate_nodeId,IX_cmsContent,IX_cmsContentVersion_ContentId,IX_cmsContentVersion_VersionId,IX_cmsDocument,IX_cmsDocument_published,IX_cmsDocument_newest,IX_cmsContentType,IX_cmsContentType_icon,IX_cmsDataType_nodeId,IX_cmsDictionary_id,IX_umbracoLanguage_languageISOCode,IX_umbracoLog,IX_cmsMacroPropertyAlias,IX_cmsMacroProperty_Alias,IX_cmsPropertyData,IX_cmsPropertyData_1,IX_cmsPropertyData_2,IX_cmsPropertyData_3,IX_cmsTags,IX_umbracoUserLogins_Index,IX_umbracoUser_userLogin,IX_cmsTaskType_alias,IX_computerName,IX_umbracoServer_isActive
    
    The following indexes were found in the database, but are not in the current schema:
    IX_icUrlTracker,IX_cmsMacroPropertyAlias,IX_cmsMacroProperty_Alias,IX_cmsTags
    
    
    2014-07-03 16:46:45,332 [14] ERROR Umbraco.Web.Install.Controllers.InstallApiController - [Thread 10] 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: Exception has been thrown by the target of an invocation.
     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)
    
    This line shows more details, some type casting problem in "Umbraco.Core.DatabaseContext.UpgradeSchemaAndData()" :
    2014-07-03 16:46:45,332 [14] ERROR Umbraco.Core.DatabaseContext - [Thread 10] Database configuration failed
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.String'.

     

  • martin griffiths 753 posts 1138 karma points
    Jul 04, 2014 @ 12:49
    martin griffiths
    0

    Hi Pavel

    Thats looks very much like the problem this post was setup for, you'll note you have foreign key constraint issues.

    Is this error being produced trying to upgrade or is it post upgrade (ie. the upgrade was successful)?

    Martin.

  • Pavel Gurecki 55 posts 158 karma points
    Jul 04, 2014 @ 13:37
    Pavel Gurecki
    0

    Hi Martin,

    this error appears when runing umbraco v7 installer (UI), installation fails with it. 

    Interesting case was first time I tried to install - unninstalled most of the packages, deployed files afterwards and then running umbraco install script I've got another DB error:

    The database configuration failed with the following message: Invalid column name 'controlId'

    Unfortunately I've lost UmbracoLog (rollback was done), and couldn't reproduce this.

    Now I get only  "The database configuration failed with the following message: Exception has been thrown by the target of an invocation." .

     

  • martin griffiths 753 posts 1138 karma points
    Jul 04, 2014 @ 13:42
    martin griffiths
    1

    Hi Pavel

    Ok, well you need to get your build in a state where you have reasonable confidence that it's just the database upgrade scripts giving you trouble and not other things like packages (which are pain from major version to major version).

    To solve your upgrade problem, download the microsoft database tools project for VS to compare the differences between your current build database (v6) and a clean, fresh install of v7. From there you can clean up the foreign keys constraints that the upgrade script is screwing up on.

    I hope this helps.

    Martin

  • Pavel Gurecki 55 posts 158 karma points
    Jul 07, 2014 @ 13:58
    Pavel Gurecki
    1

    Found simple solution (workaround) for "The database configuration failed with the following message: Exception has been thrown by the target of an invocation." error:  recycle your application pool after you get this error and then try to run install script - it should be successfull. 

    Don't have an idea what is causing this, but app pool recycle worked for me :)

     

     

  • Laurence Gillian 593 posts 1207 karma points
    Feb 16, 2018 @ 17:01
    Laurence Gillian
    0

    This really helped me, thank-you!

  • Kristian Ravnevand 86 posts 203 karma points
    Sep 04, 2014 @ 10:20
    Kristian Ravnevand
    2

    Hi, thanks for upgradehelp. I ended up with the same error has Pavel. The database configuration failed with the following message: Invalid column name 'controlId'.

    My steps was this:

    • Before starting the website: Ran the scripts from Thanetos described on page 1 (fix error 1-4)
    • Started the website
    • Went thru the upgrade walktrough
    • Got the "The database configuration failed with the following message: Invalid column name 'controlId'" error
    • Closed the website
    • Manually changed the key to 7.1.5
    • Started the website successfully

    Didn't figure out what exactly the error is, but the site seems to work...

  • BJ Patel 59 posts 153 karma points
    Apr 05, 2017 @ 08:04
    BJ Patel
    0

    Thanks, Kristian,

    for listing out the steps, As I also ended up with the same error failed with the following message: Invalid column name 'controlId'.

    As you mention

    "Manually changed the key to 7.1.5"

    Sorry but, can you please elaborate bit more, where I am supposed to make a change, Is DB-Table, any config key or so.

    Thanks

    BJ

  • Thor Madsen-Holm 82 posts 212 karma points
    Oct 11, 2014 @ 21:49
    Thor Madsen-Holm
    0

    Just followed the steps Kristian described an got my site working. Thanks Kristian!

     

    /Thor

  • Mohammad Khan 23 posts 81 karma points
    Nov 05, 2014 @ 23:07
    Mohammad Khan
    0

    Hey Guys,

    So I just finished upgrading from version 4.7.1 to 7 and I also encountered the 'controlId' and changing the key from 6.0.0 to 7.1.2 (I know its not the latest) did let me get through but what about the database upgrade ? Am I going to encounter other problems down the line ? Did anyone come across any problems ?

    I also got this error in the log Umbraco Courier but it did not show up on UI in the upgrade:

    ERROR Umbraco.Core.PluginManager - [Thread 1] Error creating type Umbraco.Courier.Cachehandler.V4.CacheHandler
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Umbraco.Courier.Core.ProviderException: No provider with id 'e23432432-e23d-11ek-2343-09230493234c9a67' found
       at Umbraco.Courier.Core.ProviderCollection`1.GetProvider(Guid id)
       at Umbraco.Courier.Core.ProviderModel.RepositoryProviderCollection.get_Default()
       at Umbraco.Courier.Cachehandler.V4.CacheHandler..ctor() in c:\Program Files (x86)\teamcity\buildAgent\work\b6e7862632b3bd64\Contrib\Providers\Umbraco.Courier.CacheHandler.V4\Cachehandlers\CacheHandler.cs:line 19
       --- End of inner exception stack trace ---
       at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
       at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
       at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
       at System.Activator.CreateInstance(Type type, Boolean nonPublic)
       at System.Activator.CreateInstance(Type type)
       at Umbraco.Core.PluginManager.CreateInstances[T](IEnumerable`1 types, Boolean throwException)
  • Kristian Ravnevand 86 posts 203 karma points
    Nov 06, 2014 @ 08:38
    Kristian Ravnevand
    0

    Hi Mohammad, after I followed the steps I described 4.sept my site has been up and running and upgraded to 7.1.8 without any trouble. So it seems to work without any other issues. About the Courier problem; I don't think Courier is upgraded to umbraco 7 yet (ref http://our.umbraco.org/projects/umbraco-pro/umbraco-courier-2)

    Regards, Kristian

  • Mohammad Khan 23 posts 81 karma points
    Nov 06, 2014 @ 16:27
    Mohammad Khan
    0

    Hey Kristian,

    Thanks for the update.

    Mohammad.

  • Ben Norman 161 posts 255 karma points
    Nov 25, 2014 @ 20:35
    Ben Norman
    0

    I am upgrading from v6.1.6 to v7.1.8. None of the above fully worked for me.

    I have managed to get it all to go through using the following:

    Backup site and then Run the nuget Update-Package and refactor any code that is broken and get the config files sorted. Then run the site to start the upgrade. Wait for it fail and update the database with the following

    IF EXISTS (SELECT * FROM sys.foreignkeys WHERE objectid = OBJECTID(N'[dbo].[cmsMacroPropertyFKcmsMacroPropertycmsMacroPropertyTypeid]') AND parentobjectid = OBJECTID(N'[dbo].[cmsMacroProperty]')) ALTER TABLE [dbo].[cmsMacroProperty] DROP CONSTRAINT [cmsMacroPropertyFKcmsMacroPropertycmsMacroPropertyTypeid] GO

    IF NOT EXISTS (SELECT * FROM sys.foreignkeys WHERE objectid = OBJECTID(N'[dbo].[FKcmsMacroPropertycmsMacroPropertyTypeid]') AND parentobjectid = OBJECTID(N'[dbo].[cmsMacroProperty]')) ALTER TABLE [dbo].[cmsMacroProperty] WITH CHECK ADD CONSTRAINT [FKcmsMacroPropertycmsMacroPropertyTypeid] FOREIGN KEY([macroPropertyType]) REFERENCES [dbo].[cmsMacroPropertyType] ([id]) GO

    IF EXISTS (SELECT * FROM sys.foreignkeys WHERE objectid = OBJECTID(N'[dbo].[FKcmsMacroPropertycmsMacroPropertyTypeid]') AND parentobjectid = OBJECTID(N'[dbo].[cmsMacroProperty]')) ALTER TABLE [dbo].[cmsMacroProperty] CHECK CONSTRAINT [FKcmsMacroPropertycmsMacroPropertyTypeid] GO

    Click the Go Back button in website Click the Upgrade button and Wait for it to fail and run the following:

    IF EXISTS (SELECT * FROM sys.foreignkeys WHERE objectid = OBJECTID(N'[dbo].[cmsTagRelationshipFKcmsTagRelationshipumbracoNodeid]') AND parentobjectid = OBJECTID(N'[dbo].[cmsTagRelationship]')) ALTER TABLE [dbo].[cmsTagRelationship] DROP CONSTRAINT [cmsTagRelationshipFKcmsTagRelationshipumbracoNodeid] GO

    IF NOT EXISTS (SELECT * FROM sys.foreignkeys WHERE objectid = OBJECTID(N'[dbo].[FKcmsTagRelationshipumbracoNodeid]') AND parentobjectid = OBJECTID(N'[dbo].[cmsTagRelationship]')) ALTER TABLE [dbo].[cmsTagRelationship] WITH CHECK ADD CONSTRAINT [FKcmsTagRelationshipumbracoNodeid] FOREIGN KEY([nodeId]) REFERENCES [dbo].[umbracoNode] ([id]) GO

    IF EXISTS (SELECT * FROM sys.foreignkeys WHERE objectid = OBJECTID(N'[dbo].[FKcmsTagRelationshipumbracoNodeid]') AND parentobjectid = OBJECTID(N'[dbo].[cmsTagRelationship]')) ALTER TABLE [dbo].[cmsTagRelationship] CHECK CONSTRAINT [FKcmsTagRelationshipumbracoNodeid] GO

    Click the GO Back button again in the website Click the Upgrade button again and wait for it to fail and run the following:

    IF EXISTS (SELECT * FROM sys.indexes WHERE objectid = OBJECTID(N'[dbo].[cmsTagRelationship]') AND name = N'cmsTagRelationshipPKcmsTagRelationship') ALTER TABLE [dbo].[cmsTagRelationship] DROP CONSTRAINT [cmsTagRelationshipPKcmsTagRelationship] GO

    IF NOT EXISTS (SELECT * FROM sys.indexes WHERE objectid = OBJECTID(N'[dbo].[cmsTagRelationship]') AND name = N'PKcmsTagRelationship') ALTER TABLE [dbo].[cmsTagRelationship] ADD CONSTRAINT [PKcmsTagRelationship] PRIMARY KEY CLUSTERED ( [nodeId] ASC, [tagId] ASC )WITH (PADINDEX = OFF, STATISTICSNORECOMPUTE = OFF, SORTINTEMPDB = OFF, IGNOREDUPKEY = OFF, ONLINE = OFF, ALLOWROWLOCKS = ON, ALLOWPAGELOCKS = ON) ON [PRIMARY] GO

  • Nigel 23 posts 77 karma points
    May 20, 2015 @ 13:06
    Nigel
    0

    In my case all the keys needed renaming for the update to work 6.25 > 7.25 - For some reason the keys on the right had been prefixed. Also the umbracoUser table had a different key.

  • Wade 39 posts 155 karma points
    Mar 09, 2016 @ 00:02
    Wade
    0

    Did anyone find out an answer to this error?

    The database configuration failed with the following message: The referenced table must have a primary or candidate key. [ FK Name = FKcmsTagRelationshipcmsContent ] Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt')

    I can't get the update finished without this fix.

    Cheers, Wade.

Please Sign in or register to post replies

Write your reply to:

Draft