GitHub user anirudh09041 created a discussion: CloudStack 4.22.1: cloudstack-setup-databases --schema-only initializes database only up to schema version 4.6.1, causing Management Server startup failure
Description Hi Team, I'm deploying a fresh Apache CloudStack 4.22.1 environment using an external managed MySQL database (Oracle Cloud Infrastructure MySQL Database Service). Since OCI MySQL restricts modifications to the mysql system schema, the standard --deploy-as workflow fails. Following the documentation, I switched to the --schema-only workflow by manually creating the databases, user, and privileges. Although cloudstack-setup-databases --schema-only completes successfully, the initialized schema only reaches version 4.6.1 instead of the expected 4.22.x schema. As a result, the Management Server starts but the UI returns HTTP 503 and the logs show missing database columns expected by CloudStack 4.22.1. Environment CloudStack Version: 4.22.1 OS: RHEL 9.6 Java: OpenJDK 17 Database: Oracle Cloud Infrastructure MySQL Database Service MySQL Version: 8.4.9-cloud MySQL Enterprise Database is external (not locally installed) Packages Installed cloudstack-common-4.22.1.0-1.noarch cloudstack-management-4.22.1.0-1.noarch Steps Performed 1. Installed CloudStack Management Server Installed: cloudstack-common cloudstack-management 2. OCI MySQL Connected successfully to OCI MySQL. Verified: log_bin = ON binlog_format = ROW max_connections = 5000 3. --deploy-as fails Running: cloudstack-setup-databases \ cloud:<password>@<mysql-ip> \ --deploy-as=root:<password> fails with: ERROR 1370 (42000): alter routine command denied to user 'root'@'%' for routine 'mysql.cloud_drop_user_if_exists' This appears to be because OCI MySQL does not allow creation/modification of stored procedures in the mysql system schema. 4. Manual database creation Executed manually: CREATE DATABASE cloud; CREATE DATABASE cloud_usage; CREATE USER 'cloud'@'localhost' IDENTIFIED BY '<password>'; CREATE USER 'cloud'@'%' IDENTIFIED BY '<password>'; GRANT ALL ON cloud.* TO 'cloud'@'localhost'; GRANT ALL ON cloud.* TO 'cloud'@'%'; GRANT ALL ON cloud_usage.* TO 'cloud'@'localhost'; GRANT ALL ON cloud_usage.* TO 'cloud'@'%'; GRANT PROCESS ON *.* TO 'cloud'@'localhost'; GRANT PROCESS ON *.* TO 'cloud'@'%'; FLUSH PRIVILEGES; 5. Schema initialization Ran: cloudstack-setup-databases \ cloud:<password>@<mysql-ip> \ --schema-only \ -i <management-server-ip> Output: Applying create-schema.sql [ OK ] Applying create-schema-premium.sql [ OK ] Applying server-setup.sql [ OK ] Applying templates.sql [ OK ] Processing encryption ... [ OK ] Finalizing setup ... [ OK ] CloudStack has successfully initialized database 6. Management setup Executed: cloudstack-setup-management Completed successfully. Problem Management server service starts successfully: systemctl status cloudstack-management Active: active (running) However, http://<management-server>:8080/client returns HTTP 503 Service Unavailable Log Output Management server log shows: java.sql.SQLSyntaxErrorException: Unknown column 'configuration.group_id' in 'field list' Example: SELECT configuration.instance, configuration.component, configuration.name, configuration.value, configuration.default_value, configuration.description, configuration.category, configuration.is_dynamic, configuration.scope, configuration.updated, configuration.group_id, configuration.subgroup_id, configuration.parent, configuration.display_text, configuration.kind, configuration.options FROM configuration Database Version Query: SELECT * FROM version; returns: 4.0.0 4.1.0 4.2.0 4.2.1 4.3.0 4.4.0 4.4.1 4.4.2 4.5.0 4.4.4 4.5.1 4.5.2 4.5.3 4.6.0 4.6.1 No later versions exist. Configuration Table SHOW COLUMNS FROM configuration; does not contain: group_id subgroup_id which the 4.22.1 Management Server expects. **Questions** Is cloudstack-setup-databases --schema-only expected to fully initialize a fresh 4.22.1 database? Is there any additional upgrade step required after running --schema-only? Is the current behavior a known issue when using managed MySQL services (such as OCI MySQL Database Service)? Is --schema-only officially supported for fresh CloudStack 4.22.1 deployments using managed MySQL? Any guidance would be appreciated. Thanks! GitHub link: https://github.com/apache/cloudstack/discussions/13548 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected]
