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

aws sdk v2 2.17.216 - WebIdentityTokenFileCredentialsProvider() exception #4228

Closed
lsatyapal opened this issue Jul 26, 2023 · 6 comments
Closed
Assignees
Labels
bug This issue is a bug. p3 This is a minor priority issue

Comments

@lsatyapal
Copy link

Describe the bug

Hi,

We are using WebIdentityTokenFileCredentialsProvider() to authenticate to aws dynamodb and it is working fine with the below versions,
aws sdk v2 - 2.17.216
spring - 2.7.1

But the same code with aws sdk v2 - 2.17.216, spring - 3.1.0 throwing a below exception,

[software.amazon.awssdk.auth.credentials.AwsCredentialsProvider]: Factory method 'awsCredentialsProviderV2' threw exception with message: PROFILE_FILE_SUPPLIER","thread_name":"main","@timestamp":"2023-07-24T16:05:57.208+0000","level":"WARN","logger_name":"org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext","trace_id":"","span_id":"","trace_sampled":""}

In both the cases IAM role(dynamodb full permissions) is attached a EKS service account and the same service account is attached to a pod.

We have included the following dependencies in the pom.xml

software.amazon.awssdk
dynamodb
2.17.216
true


software.amazon.awssdk
sts
2.17.216


software.amazon.awssdk
sdk-core
2.17.216


com.amazonaws
aws-java-sdk-sts
1.12.421

Expected Behavior

i should not throw any exception and get the accesskey, secrekey and session token for aws resource authentication.

Current Behavior

exception is occured with WebIdentityTokenFileCredentialsProvider() authentication method

Reproduction Steps

na

Possible Solution

No response

Additional Information/Context

No response

AWS Java SDK version used

2.17.216

JDK version used

17,0.8

Operating System and version

linux, 5.10.184-175.731.amzn2.x86_64

@lsatyapal lsatyapal added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 26, 2023
@debora-ito
Copy link
Member

@lsatyapal can you provide a full stacktrace with the error?

@debora-ito debora-ito added p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Jul 26, 2023
@debora-ito debora-ito self-assigned this Jul 26, 2023
@lsatyapal
Copy link
Author

Below are the only traces that i can see,

Error creating bean with name 'io.XXX.com.aws.autoconfigure.dynamodb.AwsDynamoDbV2AutoConfiguration': Unsatisfied dependency expressed through constructor parameter 3: Error creating bean with name 'awsCredentialsProviderV2' defined in class path resource [io/XXX/com/aws/autoconfigure/XXX$AwsSdkV2Configuration.class]: Failed to instantiate [software.amazon.awssdk.auth.credentials.AwsCredentialsProvider]: Factory method 'awsCredentialsProviderV2' threw exception with message: PROFILE_FILE_SUPPLIER","thread_name":"main","@timestamp":"2023-07-25T09:38:16.056+0000","level":"WARN","logger_name":"org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext","trace_id":"","span_id":"","trace_sampled":""}

Note: some the specific names are masked with xxx.

@debora-ito
Copy link
Member

I'm sorry, but the one line of error doesn't help much.

My guess is that some classes are missing from the classpath, maybe there are still some dependencies from Spring 2.7.1 being used after you upgraded to Spring 3.1.0. You can search on Spring communities if other developers had the same issue.

If you find more stacktraces with Java SDK classes in the path we can take a look.

@debora-ito debora-ito added the closing-soon This issue will close in 4 days unless further comments are made. label Jul 27, 2023
@lsatyapal
Copy link
Author

Hi,

Thank you for the response !!

We would like to know any dependency of aws sdk based on the spring version?
What is the aws sdk version to be used with spring 3.1.0? we are using 2.17.216.

@github-actions github-actions bot removed the closing-soon This issue will close in 4 days unless further comments are made. label Jul 28, 2023
@debora-ito
Copy link
Member

There's no restrictions on the Java SDK version used with Spring.

If you are using an integration library, like Spring Cloud, those will have a dependency on the Java SDK that may conflict with the Java SDK modules you are using directly in your project. In this case, you'll need to resolve those version conflicts.

This is a question about "how dependency works", and it's not specific to the AWS SDK for Java, so it's out of scope of this support channel. You can search for articles on how to resolve maven dependency issues on the web.

@github-actions
Copy link

github-actions bot commented Aug 1, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

2 participants