Hi Alessandro, as you compiled yourself, can you check if the offending column is in the code twice? and at which upgrade file? If I recall correctly this column is added in an operational table and if you shutdown at a quiet moment you should find no values in the column and you can delete it before upgrade (backups required!) I never heard of this particular issue yet, but we seen upgrades failing for instance due to backported features and nowadays a practice to add columns in a idem potent way is in place. You can look in newer upgrade schema files for the definitions of stored procedure that will aid with that.
On Thu, Sep 22, 2022 at 2:34 PM Alessandro Caviglione < c.alessan...@gmail.com> wrote: > Hi, > we compiled ACS 4.16.2 with nonoss plugins and installed the > cloudstack-common, cloudstack-management, cloudsta-usage RPMs on a ACS4.15 > server. > Upgrade finished without errors but after we start the > cloudstack-management service I saw this log in the management-server.log: > > 2022-09-22 13:47:42,067 INFO [c.c.u.DatabaseUpgradeChecker] (main:null) > (logid:) DB version = 4.16.0.0 Code Version = 4.16.2.0 > 2022-09-22 13:47:42,068 INFO [c.c.u.DatabaseUpgradeChecker] (main:null) > (logid:) Database upgrade must be performed from 4.16.0.0 to 4.16.2.0 > 2022-09-22 13:47:42,095 DEBUG [c.c.u.DatabaseUpgradeChecker] (main:null) > (logid:) Running upgrade Upgrade41600to41610 to upgrade from > 4.16.0.0-4.16.1.0 to 4.16.1.0 > ... > ... > 2022-09-22 13:47:42,101 DEBUG [c.c.u.d.ScriptRunner] (main:null) (logid:) > ALTER TABLE `cloud`.`vm_work_job` ADD COLUMN `secondary_object` char(100) > COMMENT 'any additional item that must be checked during queueing' AFTER > `vm_instance_id` > 2022-09-22 13:47:42,117 ERROR [c.c.u.d.ScriptRunner] (main:null) (logid:) > Error executing: ALTER TABLE `cloud`.`vm_work_job` ADD COLUMN > `secondary_object` char(100) COMMENT 'any additional item that must be > checked during queueing' AFTER `vm_instance_id` > 2022-09-22 13:47:42,118 ERROR [c.c.u.d.ScriptRunner] (main:null) (logid:) > java.sql.SQLSyntaxErrorException: Duplicate column name 'secondary_object' > 2022-09-22 13:47:42,119 ERROR [c.c.u.DatabaseUpgradeChecker] (main:null) > (logid:) Unable to execute upgrade script > java.sql.SQLSyntaxErrorException: Duplicate column name 'secondary_object' > 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:213) > at > > com.cloud.upgrade.DatabaseUpgradeChecker.upgrade(DatabaseUpgradeChecker.java:297) > at > > com.cloud.upgrade.DatabaseUpgradeChecker.check(DatabaseUpgradeChecker.java:387) > .... > ... > 2022-09-22 13:47:42,123 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:219) > at > > com.cloud.upgrade.DatabaseUpgradeChecker.upgrade(DatabaseUpgradeChecker.java:297) > at > > com.cloud.upgrade.DatabaseUpgradeChecker.check(DatabaseUpgradeChecker.java:387) > ... > ... > Caused by: java.sql.SQLSyntaxErrorException: Duplicate column name > 'secondary_object' > 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:213) > ... 52 more > 2022-09-22 13:47:42,134 DEBUG [c.c.u.d.T.Transaction] (main:null) (logid:) > Rolling back the transaction: Time = 29 Name = Upgrade; called by > > -TransactionLegacy.rollback:888-TransactionLegacy.removeUpTo:831-TransactionLegacy.close:655-DatabaseUpgradeChecker.upgrade:312-DatabaseUpgradeChecker.check:387-CloudStackExtendedLifeCycle.checkIntegrity:64-CloudStackExtendedLifeCycle.start:54-DefaultLifecycleProcessor.doStart:178-DefaultLifecycleProcessor.access$200:54-DefaultLifecycleProcessor$LifecycleGroup.start:356-Iterable.forEach:75-DefaultLifecycleProcessor.startBeans:155 > > Trying to browse the webpage this is the error: > > HTTP ERROR 503 Service Unavailable > URI: /client/ > STATUS: 503 > MESSAGE: Service Unavailable > SERVLET: - > -- Daan