-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix ConfigurationVO load exception after schema change #10485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #10485 +/- ##
============================================
- Coverage 16.57% 16.57% -0.01%
Complexity 13988 13988
============================================
Files 5745 5746 +1
Lines 510847 510862 +15
Branches 62140 62142 +2
============================================
- Hits 84696 84695 -1
- Misses 416677 416692 +15
- Partials 9474 9475 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@blueorangutan package |
|
@abh1sar a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 12634 |
|
@blueorangutan package |
|
@abh1sar a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12636 |
|
@blueorangutan test |
|
@abh1sar a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian Build Failed (tid-12539) |
|
@blueorangutan test |
|
@rohityadavcloud a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian Build Failed (tid-12546) |
|
@blueorangutan package |
|
@abh1sar a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
[SF] Trillian Build Failed (tid-12553) |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12648 |
|
[SF] Trillian Build Failed (tid-12555) |
|
Instead of changing how we get the value, shouldn't we normalize the database data so that it works with the current way of getting the values? Otherwise, if someone in the future creates a method to get the value the old way and only tests on a new install, it might introduce a bug for people running old installs. |
|
@JoaoJandre We identified the issue with how BackupDaoImpl class caches the columns of the table. Even though both configurations table and ConfigurationVO code has the new schema, the ConfigurationsDao._allColumns field still had the older schema from before upgrade. That's why after management server restart ConfigurationsDaoImpl_allColumns was getting regenerated with the correct fields. |
|
@blueorangutan package |
|
@abh1sar a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13470 |
|
@blueorangutan test |
|
@abh1sar a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-13371)
|
|
@abh1sar @sureshanaparti I think we should try to get this in 4.21 @blueorangutan package |
|
@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14115 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-13737)
|
|
@abh1sar et al, please advice on testing. It seems to me an upgrade test is needed at least. |
|
@DaanHoogland Upgrade should also be tested for any regressions, and logs reviewed after the upgrade to check that the exceptions are not there. |
sureshanaparti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
rosi-shapeblue
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - CloudStack Configuration Loading Fix Verified
Test Cases Executed
-
TC1: Database Recreation Test - Fresh database setup after cloudstack-setup-databases
- Status: Pass
-
TC2: Management Server Startup - Monitor for configuration loading errors during startup
- Status: Pass
-
TC3: Configuration Access Verification - Verify configuration values are accessible
- Status: Pass
-
TC4: Service Restart Behavior - Verify clean restart without configuration errors
- Status: Pass
-
TC5: Error Pattern Detection - Confirm absence of "Cannot determine value type" errors
- Status: Pass
Test Execution Sequence
Step 1: Environment Preparation
# Create backup directory
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 ~]# mkdir -p /root/test-backup-$(date +%Y%m%d-%H%M%S)
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 ~]# cd test-backup-20250811-150656/
# Backup database
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# mysqldump -u root -p cloud > cloud_backup.sql
Enter password:
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# ls -la cloud_backup.sql
-rw-r--r--. 1 root root 2847913 Aug 11 15:07 cloud_backup.sql
# Backup configuration files
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# cp -r /etc/cloudstack cloudstack_config_backup
# Backup current logs for comparison
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# cp /var/log/cloudstack/management/management-server.log management-server.log.backup
# Save backup location for potential restore
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# pwd > /tmp/backup_location.txt
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# echo "Backup created in: $(pwd)"
Backup created in: /root/test-backup-20250811-150656
# Verify backup contents
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# ls -la
total 2784
drwxr-xr-x. 3 root root 85 Aug 11 15:07 .
dr-xr-x---. 18 root root 4096 Aug 11 15:06 ..
-rw-r--r--. 1 root root 2847913 Aug 11 15:07 cloud_backup.sql
drwxr-xr-x. 4 root root 33 Aug 11 15:07 cloudstack_config_backup
-rw-r--r--. 1 root root 10234 Aug 11 15:07 management-server.log.backup
Step 2: Stop Management Server
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# systemctl stop cloudstack-management
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# systemctl status cloudstack-management
● cloudstack-management.service - CloudStack Management Server
Loaded: loaded (/usr/lib/systemd/system/cloudstack-management.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2025-08-11 15:11:24 UTC; 2s ago
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# echo "Management server stopped at: $(date)"
Management server stopped at: Mon Aug 11 15:11:32 UTC 2025
Step 3: Add Test Marker
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# echo "=== TEST START MARKER - $(date) ===" >> /var/log/cloudstack/management/management-server.log
Step 4: Database Recreation
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# cloudstack-setup-databases cloud:cloud@localhost --deploy-as=root:P@ssword123
Mysql user name:cloud [ OK ]
Mysql user password:****** [ OK ]
Mysql server ip:localhost [ OK ]
Mysql server port:3306 [ OK ]
Mysql root user name:root [ OK ]
Mysql root user password:****** [ OK ]
Checking Cloud database files ... [ OK ]
Checking local machine hostname ... [ OK ]
Checking SELinux setup ... [ OK ]
Detected local IP address as 10.0.33.190, will use as cluster management server node IP[ OK ]
Preparing /etc/cloudstack/management/db.properties [ OK ]
Applying /usr/share/cloudstack-management/setup/create-database.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/create-schema.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/create-database-premium.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/create-schema-premium.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/server-setup.sql [ OK ]
Applying /usr/share/cloudstack-management/setup/templates.sql [ OK ]
Processing encryption ... [ OK ]
Finalizing setup ... [ OK ]
CloudStack has successfully initialized database, you can check your database configuration in /etc/cloudstack/management/db.properties
Step 5: Start Management Server
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# systemctl start cloudstack-management
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# systemctl status cloudstack-management
● cloudstack-management.service - CloudStack Management Server
Loaded: loaded (/usr/lib/systemd/system/cloudstack-management.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2025-08-11 15:12:50 UTC; 11s ago
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# echo "Management server started at: $(date)"
Management server started at: Mon Aug 11 15:13:05 UTC 2025
Monitoring Results
NO ERRORS DETECTED - logs monitoring showed no configuration loading errors during startup.
Step 6: Restart Test (Verifying Fix Behavior)
Result: Restart completed successfully with no configuration errors.
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# echo "=== RESTART TEST - $(date) ===" >> /var/log/cloudstack/management/management-server.log
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# systemctl restart cloudstack-management
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# systemctl status cloudstack-management
● cloudstack-management.service - CloudStack Management Server
Loaded: loaded (/usr/lib/systemd/system/cloudstack-management.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2025-08-11 15:17:33 UTC; 1s ago
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# echo "Management server restarted at: $(date)"
Management server restarted at: Mon Aug 11 15:17:42 UTC 2025
Verification Tests
Error Count Verification
Result: Zero configuration loading errors found.
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# grep -c "Cannot determine value type from string" /var/log/cloudstack/management/management-server.log
0
Configuration Access Test
Result: Configuration values accessible and correct.
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 ~]# mysql -u root -p -e "USE cloud; SELECT name, value FROM configuration WHERE name IN ('drs.plan.expire.interval', 'job.cancel.threshold.minutes');"
Enter password:
+------------------------------+-------+
| name | value |
+------------------------------+-------+
| drs.plan.expire.interval | 30 |
| job.cancel.threshold.minutes | 60 |
+------------------------------+-------+
Final Pass/Fail Test
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# [ $(grep -c "Cannot determine value type from string" /var/log/cloudstack/management/management-server.log) -eq 0 ] && echo "FINAL RESULT: TEST PASSED" || echo "FINAL RESULT: TEST FAILED"
FINAL RESULT: TEST PASSED
Service Status Verification
Result: Management server running and listening on all expected ports.
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 ~]# systemctl status cloudstack-management
● cloudstack-management.service - CloudStack Management Server
Loaded: loaded (/usr/lib/systemd/system/cloudstack-management.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2025-08-11 15:17:33 UTC; 5min ago
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 ~]# ss -tulpn | grep java
tcp LISTEN 0 50 *:8080 *:* users:(("java",pid=25213,fd=36))
tcp LISTEN 0 50 *:8250 *:* users:(("java",pid=25213,fd=33))
tcp LISTEN 0 50 [::ffff:10.0.33.190]:9090 *:* users:(("java",pid=25213,fd=34))
API Response Verification
Result: API responding correctly with CloudStack 4.21.0.0-SNAPSHOT. HTTP 401 is expected without authentication.
[root@ref-trl-9216-k-Mol8-rositsa-kyuchukova-mgmt1 test-backup-20250811-150656]# curl -v http://localhost:8080/client/api?command=listCapabilities
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8080 (#0)
> GET /client/api?command=listCapabilities HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.61.1
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Content-Type: text/xml;charset=utf-8
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1;mode=block
< content-security-policy: 1
< content-security-policy: default-src=none
< content-security-policy: script-src=self
< content-security-policy: connect-src=self
< content-security-policy: img-src=self
< content-security-policy: style-src=self
< Content-Length: 238
<
* Connection #0 to host localhost left intact
<?xml version="1.0" encoding="UTF-8"?><listcapabilitiesresponse cloud-stack-version="4.21.0.0-SNAPSHOT"><errorcode>401</errorcode><errortext>unable to verify user credentials and/or request signature</errortext></listcapabilitiesresponse>
Description
This PR fixes #10480
The configuration table schema was changed in PR #10300
But it causes problem if the ConfigurationVO class structure was cached with the old fields.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?