Skip to content

Fix unsatisfied dependency issue in leaderOnlyTokenCrawler#6230

Merged
san81 merged 1 commit into
opensearch-project:mainfrom
bbenner7635:bug/leader_only_token_crawler_wiring
Nov 3, 2025
Merged

Fix unsatisfied dependency issue in leaderOnlyTokenCrawler#6230
san81 merged 1 commit into
opensearch-project:mainfrom
bbenner7635:bug/leader_only_token_crawler_wiring

Conversation

@bbenner7635

@bbenner7635 bbenner7635 commented Nov 1, 2025

Copy link
Copy Markdown
Contributor

Description

Crawler plugins are failing to startup due to autowiring setup:

2025-11-01T18:08:01.350 [main] ERROR org.opensearch.dataprepper.core.validation.LoggingPluginErrorsHandler - 1. pipeline.source.microsoft_office365: caused by: Error creating bean with name 'leaderOnlyTokenCrawler' defined in URL [jar:file:/opt/amazon/lib/source-crawler-2.x.893.jar!/org/opensearch/dataprepper/plugins/source/source_crawler/base/LeaderOnlyTokenCrawler.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.opensearch.dataprepper.plugins.source.source_crawler.base.LeaderOnlyTokenCrawlerClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: 
{}
 caused by: No qualifying bean of type 'org.opensearch.dataprepper.plugins.source.source_crawler.base.LeaderOnlyTokenCrawlerClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: 
{}

CrawlerSourcePlugin uses the packagesToScan annotation which includes CrawlerApplicationContextMarker.class. This likely causes Spring to scan and try to autowire beans like LeaderOnlyTokenCrawlerClient from the source_crawler package even when there is no bean instantiated

Casting as LeaderOnlyTokenCrawlerClient will prevent Spring from autowiring LeaderOnlyTokenCrawlerClient as a dependency of crawler plugins which do not require it

Issues Resolved

N/A

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Brendan Benner <bbenner@amazon.com>
@san81 san81 merged commit 0db1608 into opensearch-project:main Nov 3, 2025
46 of 47 checks passed
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.

4 participants