Repository navigation
CloudStack 4.22.1: cloudstack-setup-databases --schema-only initializes database only up to schema version 4.6.1, causing Management Server startup failure #13548
Replies: 4 comments 3 replies
|
Can we use Managed DB service (MySQL from OCI) as database with management server ?? |
|
It sounds like the database initialization stopped before completing the schema upgrade. Verify the database version, check the cloudstack-setup-databases output for any skipped migration scripts, and review the Management Server logs for schema-related errors before restarting the service. Milena | AccuWeb.Cloud |
|
@anirudh09041, have you investigated this further, in the logs of the starting management server? I read OCI needs log_bin_trust_function_creators=1 for this to work. Have you found that as well by now? I am curious to hear if you made this work. |
|
Thank you for sharing the detailed information. Based on the logs, the issue appears to be related to an incomplete database schema upgrade. The --schema-only option initializes the base database schema. CloudStack normally performs the remaining schema upgrades automatically during the first Management Server startup. No separate manual upgrade is required. I suggest performing the following checks:
grep -Ei 'DatabaseUpgrade|upgrade|denied|exception' /var/log/cloudstack/management/management-server.log | tail -n 100
SHOW GRANTS;
Although CloudStack supports MySQL 8.4 and the --schema-only option is officially documented, OCI managed MySQL may impose additional restrictions that prevent the automatic schema upgrade. We cannot yet confirm whether this is a known OCI-specific compatibility issue. I do not recommend manually adding the missing columns or modifying the database version table. Please share the output of the above commands so I can identify the exact cause and suggest the appropriate solution. Regards, |
Uh oh!
There was an error while loading. Please reload this page.
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
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:@
--deploy-as=root:
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.
Executed manually:
CREATE DATABASE cloud;
CREATE DATABASE cloud_usage;
CREATE USER 'cloud'@'localhost' IDENTIFIED BY '';
CREATE USER 'cloud'@'%' IDENTIFIED BY '';
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:@
--schema-only
-i
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://: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!
All reactions