Github user borisstoyanov commented on the issue:

    https://github.com/apache/cloudstack/pull/1983
  
    @rhtyd I've tried the upgrade from 4.5 and ended up with failing at the 
point when upgrading templates ids:
    
    ```
    2017-03-06 08:53:17,365 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) 
-- Alter view image_store_view
    2017-03-06 08:53:17,365 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) 
CREATE OR REPLACE VIEW `image_store_view` AS     SELECT         
`image_store`.`id` AS `id`,         `image_store`.`uuid` AS `uuid`,         
`image_store`.`name` AS `name`,         `image_store`.`image_provider_name` AS 
`image_provider_name`,         `image_store`.`protocol` AS `protocol`,         
`image_store`.`url` AS `url`,         `image_store`.`scope` AS `scope`,         
`image_store`.`role` AS `role`,         `image_store`.`removed` AS `removed`,   
      `data_center`.`id` AS `data_center_id`,         `data_center`.`uuid` AS 
`data_center_uuid`,         `data_center`.`name` AS `data_center_name`     FROM 
        (`image_store`         LEFT JOIN `data_center` ON 
((`image_store`.`data_center_id` = `data_center`.`id`)))
    2017-03-06 08:53:17,374 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) 
-- Add service_offering_id column to vm_snapshots table
    2017-03-06 08:53:17,374 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) 
ALTER TABLE `cloud`.`vm_snapshots` ADD COLUMN `service_offering_id` BIGINT(20) 
UNSIGNED NOT NULL COMMENT '' AFTER `domain_id`
    2017-03-06 08:53:17,440 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) 
UPDATE `cloud`.`vm_snapshots` s JOIN `cloud`.`vm_instance` v ON v.id = s.vm_id 
SET s.service_offering_id = v.service_offering_id
    2017-03-06 08:53:17,440 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) 
ALTER TABLE `cloud`.`vm_snapshots` ADD CONSTRAINT 
`fk_vm_snapshots_service_offering_id` FOREIGN KEY (`service_offering_id`) 
REFERENCES `cloud`.`service_offering` (`id`) ON DELETE NO ACTION ON UPDATE NO 
ACTION
    2017-03-06 08:53:17,523 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) 
-- Update vm snapshot details for instances with custom service offerings
    2017-03-06 08:53:17,523 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) 
INSERT INTO `cloud`.`vm_snapshot_details` (vm_snapshot_id, name, value) SELECT 
s.id, d.name, d.value FROM `cloud`.`user_vm_details` d JOIN 
`cloud`.`vm_instance` v ON (d.vm_id = v.id) JOIN `cloud`.`service_offering` o 
ON (v.service_offering_id = o.id)  JOIN `cloud`.`vm_snapshots` s ON 
(s.service_offering_id = o.id AND s.vm_id = v.id) WHERE (o.cpu is null AND 
o.speed IS NULL AND o.ram_size IS NULL) AND (d.name = 'cpuNumber' OR d.name = 
'cpuSpeed' OR d.name = 'memory')
    2017-03-06 08:53:17,524 DEBUG [c.c.u.d.Upgrade4920to41000] (main:null) 
(logid:) Updating System Vm template IDs
    2017-03-06 08:53:17,526 ERROR [c.c.u.d.Upgrade4920to41000] (main:null) 
(logid:) updateSystemVmTemplates:Exception while getting hypervisor types from 
clusters: Before start of result set
    2017-03-06 08:53:17,528 ERROR [c.c.u.DatabaseUpgradeChecker] (main:null) 
(logid:) Unable to upgrade the database
    com.cloud.utils.exception.CloudRuntimeException: 
updateSystemVmTemplates:Exception while getting hypervisor types from clusters
        at 
com.cloud.upgrade.dao.Upgrade4920to41000.updateSystemVmTemplates(Upgrade4920to41000.java:99)
        at 
com.cloud.upgrade.dao.Upgrade4920to41000.performDataMigration(Upgrade4920to41000.java:73)
        at 
com.cloud.upgrade.DatabaseUpgradeChecker.upgrade(DatabaseUpgradeChecker.java:426)
        at 
com.cloud.upgrade.DatabaseUpgradeChecker.check(DatabaseUpgradeChecker.java:507)
        at 
org.apache.cloudstack.spring.lifecycle.CloudStackExtendedLifeCycle.checkIntegrity(CloudStackExtendedLifeCycle.java:65)
        at 
org.apache.cloudstack.spring.lifecycle.CloudStackExtendedLifeCycle.start(CloudStackExtendedLifeCycle.java:55)
        at 
org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:173)
        at 
org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:51)
        at 
org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:346)
        at 
org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:149)
        at 
org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:112)
        at 
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:879)
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545)
        at 
org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.loadContext(DefaultModuleDefinitionSet.java:145)
        at 
org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet$2.with(DefaultModuleDefinitionSet.java:122)
        at 
org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:245)
        at 
org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:250)
        at 
org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.withModule(DefaultModuleDefinitionSet.java:233)
        at 
org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.loadContexts(DefaultModuleDefinitionSet.java:117)
        at 
org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet.load(DefaultModuleDefinitionSet.java:79)
        at 
org.apache.cloudstack.spring.module.factory.ModuleBasedContextFactory.loadModules(ModuleBasedContextFactory.java:37)
        at 
org.apache.cloudstack.spring.module.factory.CloudStackSpringContext.init(CloudStackSpringContext.java:71)
        at 
org.apache.cloudstack.spring.module.factory.CloudStackSpringContext.<init>(CloudStackSpringContext.java:58)
        at 
org.apache.cloudstack.spring.module.factory.CloudStackSpringContext.<init>(CloudStackSpringContext.java:62)
        at 
org.apache.cloudstack.spring.module.web.CloudStackContextLoaderListener.contextInitialized(CloudStackContextLoaderListener.java:52)
        at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4244)
        at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4743)
        at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
        at 
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)
        at 
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)
        at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
        at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
        at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at 
org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:593)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
    Caused by: java.sql.SQLException: Before start of result set
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
        ... 55 more
    2017-03-06 08:53:17,529 DEBUG [c.c.u.d.T.Transaction] (main:null) (logid:) 
Rolling back the transaction: Time = 520 Name =  Upgrade; called by 
-TransactionLegacy.rollback:889-TransactionLegacy.removeUpTo:832-TransactionLegacy.close:656-DatabaseUpgradeChecker.upgrade:437-DatabaseUpgradeChecker.check:507-CloudStackExtendedLifeCycle.checkIntegrity:65-CloudStackExtendedLifeCycle.start:55-DefaultLifecycleProcessor.doStart:173-DefaultLifecycleProcessor.access$200:51-DefaultLifecycleProcessor$LifecycleGroup.start:346-DefaultLifecycleProcessor.startBeans:149-DefaultLifecycleProcessor.onRefresh:112
    2017-03-06 08:53:17,531 WARN  [o.a.c.s.m.c.ResourceApplicationContext] 
(main:null) (logid:) Exception encountered during context initialization - 
cancelling refresh attempt: 
org.springframework.context.ApplicationContextException: Failed to start bean 
'cloudStackLifeCycle'; nested exception is 
com.cloud.utils.exception.CloudRuntimeException: Unable to upgrade the database
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to