Skip to content

config: add error logging when fail to decrypt a encrypted global configuration#13190

Draft
weizhouapache wants to merge 1 commit into
apache:4.22from
weizhouapache:4.22-improve-logging-fail-to-decrypt-value
Draft

config: add error logging when fail to decrypt a encrypted global configuration#13190
weizhouapache wants to merge 1 commit into
apache:4.22from
weizhouapache:4.22-improve-logging-fail-to-decrypt-value

Conversation

@weizhouapache
Copy link
Copy Markdown
Member

Description

This PR addresses #12523 by improving the logging

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@weizhouapache
Copy link
Copy Markdown
Member Author

@blueorangutan package

@weizhouapache weizhouapache linked an issue May 19, 2026 that may be closed by this pull request
@blueorangutan
Copy link
Copy Markdown

@weizhouapache 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.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

❌ Patch coverage is 10.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.67%. Comparing base (4a49ffa) to head (043482e).
⚠️ Report is 1 commits behind head on 4.22.

Files with missing lines Patch % Lines
...ack/framework/config/dao/ConfigurationDaoImpl.java 0.00% 8 Missing ⚠️
...udstack/framework/config/impl/ConfigurationVO.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #13190      +/-   ##
============================================
- Coverage     17.67%   17.67%   -0.01%     
+ Complexity    15788    15787       -1     
============================================
  Files          5922     5922              
  Lines        533123   533127       +4     
  Branches      65201    65200       -1     
============================================
- Hits          94242    94237       -5     
- Misses       428237   428245       +8     
- Partials      10644    10645       +1     
Flag Coverage Δ
uitests 3.69% <ø> (ø)
unittests 18.75% <10.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17910

@weizhouapache
Copy link
Copy Markdown
Member Author

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves observability around global configuration retrieval by adding explicit error logging when an encrypted configuration value cannot be decrypted (e.g., wrong/missing management server encryption key), and aligns config retrieval to use the DAO’s getValue(...) path.

Changes:

  • Add error logging in ConfigurationDaoImpl.getValue(...) when ConfigurationVO.getValue() throws during decryption.
  • Update ConfigDepotImpl to use _configDao.getValue(key) for global-scope string retrieval.
  • Adjust ConfigDepotImplTest mocks/verifications to match the new DAO method usage.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
framework/config/src/main/java/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java Adds error logging around exceptions when retrieving/decrypting a global config value.
framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java Switches global config retrieval to _configDao.getValue(...) to centralize logging/behavior.
framework/config/src/test/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImplTest.java Updates unit tests to mock/verify _configDao.getValue(...) instead of findById(...) for global retrieval.
framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigurationVO.java Minor formatting change in getValue() conditional.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +183 to +185
logger.error("Unable to get global configuration {}: {}. " +
"We expect the value of setting to be encrypted in the database with the Management Server's key, " +
"but we were unable to decrypt it using this key", name, ex.getMessage());
@blueorangutan
Copy link
Copy Markdown

[SF] Trillian test result (tid-16109)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 77689 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13190-t16109-kvm-ol8.zip
Smoke tests completed. 144 look OK, 5 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_vm_backup_create_vm_from_backup Failure 607.90 test_backup_recovery_nas.py
test_vm_backup_lifecycle Error 1.13 test_backup_recovery_nas.py
ContextSuite context=TestSharedFSLifecycle>:setup Error 0.00 test_sharedfs_lifecycle.py
test_10_attachAndDetach_iso Failure 607.24 test_vm_life_cycle.py
test_01_create_vm_snapshots Failure 606.76 test_vm_snapshots.py
test_02_revert_vm_snapshots Failure 600.66 test_vm_snapshots.py
test_03_delete_vm_snapshots Failure 0.02 test_vm_snapshots.py
test_01_create_volume Failure 613.05 test_volumes.py
test_01_root_volume_encryption Failure 690.02 test_volumes.py
test_02_data_volume_encryption Failure 638.63 test_volumes.py
test_03_root_and_data_volume_encryption Failure 657.53 test_volumes.py
test_02_attach_volume Failure 1271.20 test_volumes.py
test_02_attach_volume Failure 1271.21 test_volumes.py
test_03_download_attached_volume Failure 662.30 test_volumes.py
test_04_delete_attached_volume Failure 664.26 test_volumes.py
test_05_detach_volume Failure 751.55 test_volumes.py
test_06_download_detached_volume Failure 849.77 test_volumes.py
test_07_resize_fail Failure 659.20 test_volumes.py
test_08_resize_volume Failure 664.62 test_volumes.py
test_09_delete_detached_volume Failure 665.65 test_volumes.py
test_10_list_volumes Failure 659.17 test_volumes.py
test_11_attach_volume_with_unstarted_vm Failure 758.12 test_volumes.py
test_12_resize_volume_with_only_size_parameter Failure 667.79 test_volumes.py
test_13_migrate_volume_and_change_offering Failure 799.47 test_volumes.py
test_14_delete_volume_delete_protection Failure 662.95 test_volumes.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Management server hangs when js.interpretation.enabled=true

3 participants