Hi Evigeni, Looks like a DB upgrade was attempted and it failed (forgot to register 4.15 systemvmtemplate for example) and the upgrade was retried, if you've DB dumps you can restore it back to 4.14 and retry upgrade. The other solution is to look at the SQL error on case by case basis, manually fix it and try the upgrade (stop+start mgmt server process) again.
Regards. ________________________________ From: Wei ZHOU <ustcweiz...@gmail.com> Sent: Monday, January 18, 2021 00:46 To: dev@cloudstack.apache.org <dev@cloudstack.apache.org> Subject: Re: Update Problem from 4.14 to 4.15 Hi, Is this the first time you try to upgrade cloudstack from 4.14 to 4.15? Is there failed attempt prior to this upgrade? -Wei On Sunday, 17 January 2021, Info Manager <i...@activecloud.co.il> wrote: > Hi all > > Have anyone such problems while updating? > > ---------------------- > > 2021-01-17 01:42:47,466 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) > ALTER TABLE `cloud`.`project_account` ADD COLUMN `user_id` bigint unsigned > COMMENT 'ID of user to be added to the project' AFTER `account_id`, ADD > CONSTRAINT `fk_project_account__user_id` FOREIGN KEY > `fk_project_account__user_id`(`user_id`) REFERENCES `user`(`id`) ON DELETE > CASCADE, ADD COLUMN `project_role_id` bigint unsigned COMMENT 'Project > role id' AFTER `project_account_id`, ADD CONSTRAINT > `fk_project_account__project_role_id` FOREIGN KEY (`project_role_id`) > REFERENCES `project_role` (`id`) ON DELETE SET NULL, DROP FOREIGN KEY > `fk_project_account__account_id`, DROP INDEX `account_id` > 2021-01-17 01:42:47,480 ERROR [c.c.u.d.ScriptRunner] (main:null) (logid:) > Error executing: ALTER TABLE `cloud`.`project_account` ADD COLUMN > `user_id` bigint unsigned COMMENT 'ID of user to be added to the project' > AFTER `account_id`, ADD CONSTRAINT `fk_project_account__user_id` FOREIGN > KEY `fk_project_account__user_id`(`user_id`) REFERENCES `user`(`id`) ON > DELETE CASCADE, ADD COLUMN `project_role_id` bigint unsigned COMMENT > 'Project role id' AFTER `project_account_id`, ADD CONSTRAINT > `fk_project_account__project_role_id` FOREIGN KEY (`project_role_id`) > REFERENCES `project_role` (`id`) ON DELETE SET NULL, DROP FOREIGN KEY > `fk_project_account__account_id`, DROP INDEX `account_id` > 2021-01-17 01:42:47,480 ERROR [c.c.u.d.ScriptRunner] (main:null) (logid:) > java.sql.SQLSyntaxErrorException: Can't DROP 'fk_project_account__account_ > id'; > check that column/key exists > 2021-01-17 01:42:47,483 ERROR [c.c.u.DatabaseUpgradeChecker] (main:null) > (logid:) Unable to execute upgrade script > java.sql.SQLSyntaxErrorException: Can't DROP 'fk_project_account__account_ > id'; > check that column/key exists > at com.cloud.utils.db.ScriptRunner.runScript( > ScriptRunner.java:185) > at com.cloud.utils.db.ScriptRunner.runScript(ScriptRunner.java:87) > at com.cloud.upgrade.DatabaseUpgradeChecker.runScript( > DatabaseUpgradeChecker.java:203) > at com.cloud.upgrade.DatabaseUpgradeChecker.upgrade( > DatabaseUpgradeChecker.java:258) > at com.cloud.upgrade.DatabaseUpgradeChecker.check( > DatabaseUpgradeChecker.java:342) > at org.apache.cloudstack.spring.lifecycle. > CloudStackExtendedLifeCycle.checkIntegrity(CloudStackExtendedLifeCycle. > java:64) > at org.apache.cloudstack.spring.lifecycle. > CloudStackExtendedLifeCycle.start(CloudStackExtendedLifeCycle.java:54) > at org.springframework.context.support.DefaultLifecycleProcessor. > doStart(DefaultLifecycleProcessor.java:182) > at org.springframework.context.support.DefaultLifecycleProcessor. > access$200(DefaultLifecycleProcessor.java:53) > at org.springframework.context.support.DefaultLifecycleProcessor$ > LifecycleGroup.start(DefaultLifecycleProcessor.java:360) > at org.springframework.context.support.DefaultLifecycleProcessor. > startBeans(DefaultLifecycleProcessor.java:158) > at org.springframework.context.support.DefaultLifecycleProcessor. > onRefresh(DefaultLifecycleProcessor.java:122) > at org.springframework.context.support.AbstractApplicationContext. > finishRefresh(AbstractApplicationContext.java:894) > at org.springframework.context.support.AbstractApplicationContext. > refresh(AbstractApplicationContext.java:553) > at org.apache.cloudstack.spring.module.model.impl. > DefaultModuleDefinitionSet.loadContext(DefaultModuleDefinitionSet. > java:144) > at org.apache.cloudstack.spring.module.model.impl. > DefaultModuleDefinitionSet$2.with(DefaultModuleDefinitionSet.java:121) > at org.apache.cloudstack.spring.module.model.impl. > DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:244) > at org.apache.cloudstack.spring.module.model.impl. > DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:249) > at org.apache.cloudstack.spring.module.model.impl. > DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:232) > at org.apache.cloudstack.spring.module.model.impl. > DefaultModuleDefinitionSet.loadContexts(DefaultModuleDefinitionSet. > java:116) > at org.apache.cloudstack.spring.module.model.impl. > DefaultModuleDefinitionSet.load(DefaultModuleDefinitionSet.java:78) > at org.apache.cloudstack.spring.module.factory. > ModuleBasedContextFactory.loadModules(ModuleBasedContextFactory.java:37) > at org.apache.cloudstack.spring.module.factory. > CloudStackSpringContext.init(CloudStackSpringContext.java:70) > at org.apache.cloudstack.spring.module.factory. > CloudStackSpringContext.<init>(CloudStackSpringContext.java:57) > at org.apache.cloudstack.spring.module.factory. > CloudStackSpringContext.<init>(CloudStackSpringContext.java:61) > at org.apache.cloudstack.spring.module.web. > CloudStackContextLoaderListener.contextInitialized( > CloudStackContextLoaderListener.java:51) > at org.eclipse.jetty.server.handler.ContextHandler. > callContextInitialized(ContextHandler.java:933) > at org.eclipse.jetty.servlet.ServletContextHandler. > callContextInitialized(ServletContextHandler.java:553) > at org.eclipse.jetty.server.handler.ContextHandler. > startContext(ContextHandler.java:892) > at org.eclipse.jetty.servlet.ServletContextHandler.startContext( > ServletContextHandler.java:356) > at org.eclipse.jetty.webapp.WebAppContext.startWebapp( > WebAppContext.java:1445) > at org.eclipse.jetty.webapp.WebAppContext.startContext( > WebAppContext.java:1409) > at org.eclipse.jetty.server.handler.ContextHandler. > doStart(ContextHandler.java:825) > at org.eclipse.jetty.servlet.ServletContextHandler.doStart( > ServletContextHandler.java:275) > at org.eclipse.jetty.webapp.WebAppContext.doStart( > WebAppContext.java:524) > at org.eclipse.jetty.util.component.AbstractLifeCycle. > start(AbstractLifeCycle.java:72) > at org.eclipse.jetty.util.component.ContainerLifeCycle. > start(ContainerLifeCycle.java:169) > at org.eclipse.jetty.util.component.ContainerLifeCycle. > doStart(ContainerLifeCycle.java:110) > at org.eclipse.jetty.server.handler.AbstractHandler. > doStart(AbstractHandler.java:97) > at org.eclipse.jetty.server.handler.gzip.GzipHandler. > doStart(GzipHandler.java:425) > at org.eclipse.jetty.util.component.AbstractLifeCycle. > start(AbstractLifeCycle.java:72) > at org.eclipse.jetty.util.component.ContainerLifeCycle. > start(ContainerLifeCycle.java:169) > at org.eclipse.jetty.util.component.ContainerLifeCycle. > doStart(ContainerLifeCycle.java:117) > at org.eclipse.jetty.server.handler.AbstractHandler. > doStart(AbstractHandler.java:97) > at org.eclipse.jetty.util.component.AbstractLifeCycle. > start(AbstractLifeCycle.java:72) > at org.eclipse.jetty.util.component.ContainerLifeCycle. > start(ContainerLifeCycle.java:169) > at org.eclipse.jetty.server.Server.start(Server.java:407) > at org.eclipse.jetty.util.component.ContainerLifeCycle. > doStart(ContainerLifeCycle.java:110) > at org.eclipse.jetty.server.handler.AbstractHandler. > doStart(AbstractHandler.java:97) > at org.eclipse.jetty.server.Server.doStart(Server.java:371) > at org.eclipse.jetty.util.component.AbstractLifeCycle. > start(AbstractLifeCycle.java:72) > at org.apache.cloudstack.ServerDaemon.start(ServerDaemon.java:188) > at org.apache.cloudstack.ServerDaemon.main(ServerDaemon.java:104) > 2021-01-17 01:42:47,485 ERROR [c.c.u.DatabaseUpgradeChecker] (main:null) > (logid:) Unable to upgrade the database > com.cloud.utils.exception.CloudRuntimeException: Unable to execute upgrade > script > at com.cloud.upgrade.DatabaseUpgradeChecker.runScript( > DatabaseUpgradeChecker.java:209) > at com.cloud.upgrade.DatabaseUpgradeChecker.upgrade( > DatabaseUpgradeChecker.java:258) > at com.cloud.upgrade.DatabaseUpgradeChecker.check( > DatabaseUpgradeChecker.java:342) > at org.apache.cloudstack.spring.lifecycle. > CloudStackExtendedLifeCycle.checkIntegrity(CloudStackExtendedLifeCycle. > java:64) > at org.apache.cloudstack.spring.lifecycle. > CloudStackExtendedLifeCycle.start(CloudStackExtendedLifeCycle.java:54) > at org.springframework.context.support.DefaultLifecycleProcessor. > doStart(DefaultLifecycleProcessor.java:182) > at org.springframework.context.support.DefaultLifecycleProcessor. > access$200(DefaultLifecycleProcessor.java:53) > at org.springframework.context.support.DefaultLifecycleProcessor$ > LifecycleGroup.start(DefaultLifecycleProcessor.java:360) > at org.springframework.context.support.DefaultLifecycleProcessor. > startBeans(DefaultLifecycleProcessor.java:158) > at org.springframework.context.support.DefaultLifecycleProcessor. > onRefresh(DefaultLifecycleProcessor.java:122) > at org.springframework.context.support.AbstractApplicationContext. > finishRefresh(AbstractApplicationContext.java:894) > at org.springframework.context.support.AbstractApplicationContext. > refresh(AbstractApplicationContext.java:553) > at org.apache.cloudstack.spring.module.model.impl. > DefaultModuleDefinitionSet.loadContext(DefaultModuleDefinitionSet. > java:144) > at org.apache.cloudstack.spring.module.model.impl. > DefaultModuleDefinitionSet$2.with(DefaultModuleDefinitionSet.java:121) > at org.apache.cloudstack.spring.module.model.impl. > DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:244) > at org.apache.cloudstack.spring.module.model.impl. > DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:249) > at org.apache.cloudstack.spring.module.model.impl. > DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:232) > at org.apache.cloudstack.spring.module.model.impl. > DefaultModuleDefinitionSet.loadContexts(DefaultModuleDefinitionSet. > java:116) > at org.apache.cloudstack.spring.module.model.impl. > DefaultModuleDefinitionSet.load(DefaultModuleDefinitionSet.java:78) > at org.apache.cloudstack.spring.module.factory. > ModuleBasedContextFactory.loadModules(ModuleBasedContextFactory.java:37) > at org.apache.cloudstack.spring.module.factory. > CloudStackSpringContext.init(CloudStackSpringContext.java:70) > at org.apache.cloudstack.spring.module.factory. > CloudStackSpringContext.<init>(CloudStackSpringContext.java:57) > at org.apache.cloudstack.spring.module.factory. > CloudStackSpringContext.<init>(CloudStackSpringContext.java:61) > at org.apache.cloudstack.spring.module.web. > CloudStackContextLoaderListener.contextInitialized( > CloudStackContextLoaderListener.java:51) > at org.eclipse.jetty.server.handler.ContextHandler. > callContextInitialized(ContextHandler.java:933) > at org.eclipse.jetty.servlet.ServletContextHandler. > callContextInitialized(ServletContextHandler.java:553) > at org.eclipse.jetty.server.handler.ContextHandler. > startContext(ContextHandler.java:892) > at org.eclipse.jetty.servlet.ServletContextHandler.startContext( > ServletContextHandler.java:356) > at org.eclipse.jetty.webapp.WebAppContext.startWebapp( > WebAppContext.java:1445) > at org.eclipse.jetty.webapp.WebAppContext.startContext( > WebAppContext.java:1409) > at org.eclipse.jetty.server.handler.ContextHandler. > doStart(ContextHandler.java:825) > at org.eclipse.jetty.servlet.ServletContextHandler.doStart( > ServletContextHandler.java:275) > at org.eclipse.jetty.webapp.WebAppContext.doStart( > WebAppContext.java:524) > at org.eclipse.jetty.util.component.AbstractLifeCycle. > start(AbstractLifeCycle.java:72) > at org.eclipse.jetty.util.component.ContainerLifeCycle. > start(ContainerLifeCycle.java:169) > at org.eclipse.jetty.util.component.ContainerLifeCycle. > doStart(ContainerLifeCycle.java:110) > at org.eclipse.jetty.server.handler.AbstractHandler. > doStart(AbstractHandler.java:97) > at org.eclipse.jetty.server.handler.gzip.GzipHandler. > doStart(GzipHandler.java:425) > at org.eclipse.jetty.util.component.AbstractLifeCycle. > start(AbstractLifeCycle.java:72) > at org.eclipse.jetty.util.component.ContainerLifeCycle. > start(ContainerLifeCycle.java:169) > at org.eclipse.jetty.util.component.ContainerLifeCycle. > doStart(ContainerLifeCycle.java:117) > at org.eclipse.jetty.server.handler.AbstractHandler. > doStart(AbstractHandler.java:97) > at org.eclipse.jetty.util.component.AbstractLifeCycle. > start(AbstractLifeCycle.java:72) > at org.eclipse.jetty.util.component.ContainerLifeCycle. > start(ContainerLifeCycle.java:169) > at org.eclipse.jetty.server.Server.start(Server.java:407) > at org.eclipse.jetty.util.component.ContainerLifeCycle. > doStart(ContainerLifeCycle.java:110) > at org.eclipse.jetty.server.handler.AbstractHandler. > doStart(AbstractHandler.java:97) > at org.eclipse.jetty.server.Server.doStart(Server.java:371) > at org.eclipse.jetty.util.component.AbstractLifeCycle. > start(AbstractLifeCycle.java:72) > at org.apache.cloudstack.ServerDaemon.start(ServerDaemon.java:188) > at org.apache.cloudstack.ServerDaemon.main(ServerDaemon.java:104) > Caused by: java.sql.SQLSyntaxErrorException: Can't DROP > 'fk_project_account__account_id'; check that column/key exists > at com.cloud.utils.db.ScriptRunner.runScript( > ScriptRunner.java:185) > at com.cloud.utils.db.ScriptRunner.runScript(ScriptRunner.java:87) > at com.cloud.upgrade.DatabaseUpgradeChecker.runScript( > DatabaseUpgradeChecker.java:203) > ... 50 more > 2021-01-17 01:42:47,498 DEBUG [c.c.u.d.T.Transaction] (main:null) (logid:) > Rolling back the transaction: Time = 27 Name = Upgrade; called by > -TransactionLegacy.rollback:888-TransactionLegacy.removeUpTo:831- > TransactionLegacy.close:655-DatabaseUpgradeChecker.upgrade:273- > DatabaseUpgradeChecker.check:342-CloudStackExtendedLifeCycle. > checkIntegrity:64-CloudStackExtendedLifeCycle.start:54- > DefaultLifecycleProcessor.doStart:182-DefaultLifecycleProcessor. > access$200:53-DefaultLifecycleProcessor$LifecycleGroup.start:360- > DefaultLifecycleProcessor.startBeans:158-DefaultLifecycleProcessor. > onRefresh:122 > ---------------------- > > THank's > rohit.ya...@shapeblue.comĀ www.shapeblue.com 3 London Bridge Street, 3rd floor, News Building, London SE1 9SGUK @shapeblue