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
MemberAuthor

@blueorangutan package

@weizhouapacheweizhouapache 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

codecovBot commented May 19, 2026

Copy link
Copy Markdown

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 10 commits behind head on 4.22.

Files with missing linesPatch %Lines
...ack/framework/config/dao/ConfigurationDaoImpl.java0.00%8 Missing ⚠️
...udstack/framework/config/impl/ConfigurationVO.java0.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 
FlagCoverage Δ
uitests3.69% <ø> (ø)
unittests18.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
MemberAuthor

@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

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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.

FileDescription
framework/config/src/main/java/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.javaAdds error logging around exceptions when retrieving/decrypting a global config value.
framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.javaSwitches global config retrieval to _configDao.getValue(...) to centralize logging/behavior.
framework/config/src/test/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImplTest.javaUpdates 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.javaMinor 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:

TestResultTime (s)Test File
test_vm_backup_create_vm_from_backupFailure607.90test_backup_recovery_nas.py
test_vm_backup_lifecycleError1.13test_backup_recovery_nas.py
ContextSuite context=TestSharedFSLifecycle>:setupError0.00test_sharedfs_lifecycle.py
test_10_attachAndDetach_isoFailure607.24test_vm_life_cycle.py
test_01_create_vm_snapshotsFailure606.76test_vm_snapshots.py
test_02_revert_vm_snapshotsFailure600.66test_vm_snapshots.py
test_03_delete_vm_snapshotsFailure0.02test_vm_snapshots.py
test_01_create_volumeFailure613.05test_volumes.py
test_01_root_volume_encryptionFailure690.02test_volumes.py
test_02_data_volume_encryptionFailure638.63test_volumes.py
test_03_root_and_data_volume_encryptionFailure657.53test_volumes.py
test_02_attach_volumeFailure1271.20test_volumes.py
test_02_attach_volumeFailure1271.21test_volumes.py
test_03_download_attached_volumeFailure662.30test_volumes.py
test_04_delete_attached_volumeFailure664.26test_volumes.py
test_05_detach_volumeFailure751.55test_volumes.py
test_06_download_detached_volumeFailure849.77test_volumes.py
test_07_resize_failFailure659.20test_volumes.py
test_08_resize_volumeFailure664.62test_volumes.py
test_09_delete_detached_volumeFailure665.65test_volumes.py
test_10_list_volumesFailure659.17test_volumes.py
test_11_attach_volume_with_unstarted_vmFailure758.12test_volumes.py
test_12_resize_volume_with_only_size_parameterFailure667.79test_volumes.py
test_13_migrate_volume_and_change_offeringFailure799.47test_volumes.py
test_14_delete_volume_delete_protectionFailure662.95test_volumes.py

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Management server hangs when js.interpretation.enabled=true

5 participants

@weizhouapache@blueorangutan@vladimirpetrov@winterhazel