Skip to content
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

Fix multiple s3clients in wave #554

Merged
merged 6 commits into from
Jul 8, 2024
Merged

Conversation

munishchouhan
Copy link
Member

This PR will fix the problem to use two s3clients one for cloudflare and another one for aws

@munishchouhan munishchouhan marked this pull request as draft July 8, 2024 14:07
@munishchouhan munishchouhan self-assigned this Jul 8, 2024
Signed-off-by: munishchouhan <[email protected]>
@munishchouhan
Copy link
Member Author

Tested log storing locally:

16:13:04.885 [io-executor-thread-1] INFO  i.s.w.s.b.ContainerBuildServiceImpl - == Build request 4cc551eaf9a4fd55_1 completed with status=0
16:13:04.890 [io-executor-thread-3] DEBUG i.s.w.s.logs.BuildLogServiceImpl - Storing logs for buildId: 4cc551eaf9a4fd55_1
16:13:04.893 [io-executor-thread-2] INFO  i.s.w.service.scan.KubeScanStrategy - Launching container scan for buildId: 4cc551eaf9a4fd55_1 with scanId 5b8e1ccbb200
16:13:09.912 [io-executor-thread-2] INFO  i.s.w.service.scan.KubeScanStrategy - Container scan completed for id: 5b8e1ccbb200

@munishchouhan
Copy link
Member Author

tested blob deletion in local and its working too

@munishchouhan
Copy link
Member Author

checked log in ui
Screenshot 2024-07-08 at 16 18 14

@munishchouhan munishchouhan marked this pull request as ready for review July 8, 2024 14:23
Signed-off-by: munishchouhan <[email protected]>
@pditommaso
Copy link
Collaborator

is there a failing test?

@munishchouhan
Copy link
Member Author

is there a failing test?

redis flaky test

Screenshot 2024-07-08 at 18 26 22

@munishchouhan munishchouhan merged commit 4568950 into master Jul 8, 2024
4 checks passed
@munishchouhan munishchouhan deleted the fix-multi-s3client-issue branch July 8, 2024 16:32
@pditommaso
Copy link
Collaborator

Same issue

Message: Multiple possible bean candidates found: [software.amazon.awssdk.services.s3.S3Client, software.amazon.awssdk.services.s3.S3Client, software.amazon.awssdk.services.s3.S3Client]
Path Taken: new AwsS3Operations(AwsS3Configuration configuration,S3Client s3Client,InputStreamMapper inputStreamMapper) --> new AwsS3Operations(AwsS3Configuration configuration,[S3Client s3Client],InputStreamMapper inputStreamMapper)
io.micronaut.context.exceptions.BeanInstantiationException: Bean definition [io.micronaut.objectstorage.aws.AwsS3Operations] could not be loaded: Failed to inject value for parameter [s3Client] of class: io.micronaut.objectstorage.aws.AwsS3Operations

Message: Multiple possible bean candidates found: [software.amazon.awssdk.services.s3.S3Client, software.amazon.awssdk.services.s3.S3Client, software.amazon.awssdk.services.s3.S3Client]
Path Taken: new AwsS3Operations(AwsS3Configuration configuration,S3Client s3Client,InputStreamMapper inputStreamMapper) --> new AwsS3Operations(AwsS3Configuration configuration,[S3Client s3Client],InputStreamMapper inputStreamMapper)
	at io.micronaut.context.DefaultBeanContext.initializeContext(DefaultBeanContext.java:1921)
	at io.micronaut.context.DefaultApplicationContext.initializeContext(DefaultApplicationContext.java:249)
	at io.micronaut.context.DefaultBeanContext.readAllBeanDefinitionClasses(DefaultBeanContext.java:3326)
	at io.micronaut.context.DefaultBeanContext.finalizeConfiguration(DefaultBeanContext.java:3684)
	at io.micronaut.context.DefaultBeanContext.start(DefaultBeanContext.java:341)
	at io.micronaut.context.DefaultApplicationContext.start(DefaultApplicationContext.java:194)
	at io.micronaut.runtime.Micronaut.start(Micronaut.java:75)
	at io.seqera.wave.Application.main(Application.groovy:41)
Caused by: io.micronaut.context.exceptions.DependencyInjectionException: Failed to inject value for parameter [s3Client] of class: io.micronaut.objectstorage.aws.AwsS3Operations

Message: Multiple possible bean candidates found: [software.amazon.awssdk.services.s3.S3Client, software.amazon.awssdk.services.s3.S3Client, software.amazon.awssdk.services.s3.S3Client]
Path Taken: new AwsS3Operations(AwsS3Configuration configuration,S3Client s3Client,InputStreamMapper inputStreamMapper) --> new AwsS3Operations(AwsS3Configuration configuration,[S3Client s3Client],InputStreamMapper inputStreamMapper)
	at io.micronaut.context.AbstractInitializableBeanDefinition.resolveBean(AbstractInitializableBeanDefinition.java:2087)
	at io.micronaut.context.AbstractInitializableBeanDefinition.getBeanForConstructorArgument(AbstractInitializableBeanDefinition.java:1297)
	at io.micronaut.objectstorage.aws.$AwsS3Operations$Definition.doBuild(Unknown Source)
	at io.micronaut.context.AbstractInitializableBeanDefinition.build(AbstractInitializableBeanDefinition.java:769)
	at io.micronaut.context.BeanDefinitionDelegate.build(BeanDefinitionDelegate.java:158)
	at io.micronaut.context.DefaultBeanContext.resolveByBeanFactory(DefaultBeanContext.java:2354)
	at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2305)
	at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2251)
	at io.micronaut.context.DefaultBeanContext.createRegistration(DefaultBeanContext.java:3016)
	at io.micronaut.context.SingletonScope.getOrCreate(SingletonScope.java:80)
	at io.micronaut.context.DefaultBeanContext.findOrCreateSingletonBeanRegistration(DefaultBeanContext.java:2918)
	at io.micronaut.context.DefaultBeanContext.loadContextScopeBean(DefaultBeanContext.java:2737)
	at io.micronaut.context.DefaultBeanContext.initializeContext(DefaultBeanContext.java:1915)
	... 7 common frames omitted
Caused by: io.micronaut.context.exceptions.NonUniqueBeanException: Multiple possible bean candidates found: [software.amazon.awssdk.services.s3.S3Client, software.amazon.awssdk.services.s3.S3Client, software.amazon.awssdk.services.s3.S3Client]
	at io.micronaut.context.DefaultBeanContext.findConcreteCandidate(DefaultBeanContext.java:2472)
	at io.micronaut.context.DefaultApplicationContext.findConcreteCandidate(DefaultApplicationContext.java:488)
	at io.micronaut.context.DefaultBeanContext.lastChanceResolve(DefaultBeanContext.java:3249)
	at io.micronaut.context.DefaultBeanContext.findConcreteCandidateNoCache(DefaultBeanContext.java:3140)
	at io.micronaut.context.DefaultBeanContext.findConcreteCandidate(DefaultBeanContext.java:3058)
	at io.micronaut.context.DefaultBeanContext.findBeanDefinition(DefaultBeanContext.java:788)
	at io.micronaut.context.DefaultBeanContext.resolveBeanRegistration(DefaultBeanContext.java:2790)
	at io.micronaut.context.DefaultBeanContext.getBean(DefaultBeanContext.java:1617)
	at io.micronaut.context.AbstractBeanResolutionContext.getBean(AbstractBeanResolutionContext.java:66)
	at io.micronaut.context.AbstractInitializableBeanDefinition.resolveBean(AbstractInitializableBeanDefinition.java:2065)

@munishchouhan
Copy link
Member Author

got the same error in dev, but not in local
I will work debugging it

@munishchouhan
Copy link
Member Author

Found the problem:
buildlogs-aws profile is making micronaut to create another AwsS3Operations, which is raising the error

@munishchouhan
Copy link
Member Author

@pditommaso either we can remove buildlogs-aws from envs or change the file as done in this PR
#558

@munishchouhan
Copy link
Member Author

after removing buildlogs-aws, working in dev now

@pditommaso
Copy link
Collaborator

I think it makes more sense to remove it at all at this point

@munishchouhan
Copy link
Member Author

ok sure, i will make the changes

@munishchouhan
Copy link
Member Author

removed in this PR

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.

2 participants