Skip to content

Add KMSWrappedKeyDao as a dependency for the Usage server#13535

Open
winterhazel wants to merge 1 commit into
apache:mainfrom
winterhazel:fix-usage-server
Open

Add KMSWrappedKeyDao as a dependency for the Usage server#13535
winterhazel wants to merge 1 commit into
apache:mainfrom
winterhazel:fix-usage-server

Conversation

@winterhazel

Copy link
Copy Markdown
Member

Description

PR #12711 injected KMSWrappedKeyDao in com.cloud.storage.dao.VolumeDao, which is used by the Usage server. However, KMSWrappedKeyDao was not added as dependency for the Usage server. Due to this, the Usage server fails to start in the latest commit.

Logs
2026-07-05 21:21:42,389 ERROR [utils.component.ComponentContext] (main:[]) (logid:) Could not load bean due to: [Error creating bean with name 'volumeDaoImpl': Unsatisfied dependency expressed through field 'kmsWrappedKeyDao'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.cloudstack.kms.dao.KMSWrappedKeyDao' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.inject.Inject()}]. The service will be stopped. Please investigate the cause of the error or contact your support team. org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'volumeDaoImpl': Unsatisfied dependency expressed through field 'kmsWrappedKeyDao'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.cloudstack.kms.dao.KMSWrappedKeyDao' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.inject.Inject()}
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:660)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.configureBean(AbstractAutowireCapableBeanFactory.java:364)
	at com.cloud.utils.component.ComponentContext.initComponentsLifeCycle(ComponentContext.java:80)
	at com.cloud.usage.UsageServer.start(UsageServer.java:55)
	at com.cloud.usage.UsageServer.main(UsageServer.java:42)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.cloudstack.kms.dao.KMSWrappedKeyDao' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.inject.Inject()}
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1801)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1357)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657)
	... 8 more

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)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

I built packages for this patch, installed them, and validated that the Usage server started successfully.

Logs
2026-07-05 21:49:01,539 INFO  [cloud.usage.UsageManagerImpl_EnhancerByCloudStack_c4597d1] (main:[]) (logid:) Starting Usage Manager
2026-07-05 21:49:01,618 INFO  [utils.component.ComponentContext] (main:[]) (logid:) Starting org.apache.cloudstack.quota.QuotaStatementImpl_EnhancerByCloudStack_9ed9c05c
2026-07-05 21:49:01,619 INFO  [cloudstack.quota.QuotaStatementImpl_EnhancerByCloudStack_9ed9c05c] (main:[]) (logid:) Starting Statement Manager
2026-07-05 21:49:01,619 INFO  [utils.component.ComponentContext] (main:[]) (logid:) Starting org.apache.cloudstack.quota.QuotaAlertManagerImpl_EnhancerByCloudStack_39561c98
2026-07-05 21:49:01,619 INFO  [cloudstack.quota.QuotaAlertManagerImpl_EnhancerByCloudStack_39561c98] (main:[]) (logid:) Starting Alert Manager
2026-07-05 21:49:01,619 INFO  [utils.component.ComponentContext] (main:[]) (logid:) Starting org.apache.cloudstack.quota.QuotaManagerImpl_EnhancerByCloudStack_7bfd14ca
2026-07-05 21:49:01,620 INFO  [cloudstack.quota.QuotaManagerImpl_EnhancerByCloudStack_7bfd14ca] (main:[]) (logid:) Starting Quota Manager
2026-07-05 21:49:01,620 INFO  [utils.component.ComponentContext] (main:[]) (logid:) Starting com.cloud.usage.UsageAlertManagerImpl_EnhancerByCloudStack_2cd965f1
2026-07-05 21:49:01,621 INFO  [cloud.usage.UsageServer] (main:[]) (logid:) UsageServer ready...

@winterhazel

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@winterhazel a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 18.93%. Comparing base (7e84850) to head (a2c1c0b).

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #13535   +/-   ##
=========================================
  Coverage     18.93%   18.93%           
+ Complexity    18476    18474    -2     
=========================================
  Files          6221     6221           
  Lines        560073   560073           
  Branches      68286    68286           
=========================================
+ Hits         106068   106070    +2     
+ Misses       442379   442375    -4     
- Partials      11626    11628    +2     
Flag Coverage Δ
uitests 3.50% <ø> (ø)
unittests 20.14% <ø> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@winterhazel winterhazel added this to the 4.23.0 milestone Jul 2, 2026
@blueorangutan

Copy link
Copy Markdown

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

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

code lgtm

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

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

clgtm, not sure if smoke test suffice to prove the validity of this fix though. Needs assessment.

Sign up for free to 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.

4 participants