Description
Upcoming End-of-Support
- I acknowledge the upcoming end-of-support for AWS SDK for Java v1 was announced, and migration to AWS SDK for Java v2 is recommended.
Describe the bug
If an error occurs when fetching secrets from the secretsmanager during Spring startup, no logs are available as described in awspring/spring-cloud-aws#165 . The only information that is available to diagnose what went wrong with DefaultCredentialsProvider is the exception stacktrace/message generated on https://github.com/aws/aws-sdk-java/blob/df2ce8afe8f1c1ecebc110b9c451de4c904250fc/aws-java-sdk-core/src/main/java/com/amazonaws/auth/AWSCredentialsProviderChain.java#L142C38-L142C100
In my situation, ContainerCredentialsProvider provided message "Failed to load credentials from metadata service.", but the original (proxy/network/etc related) cause Exception was not visible in the logs, as
The workaround was to replace DefaultCredentialsProvider with ContainerCredentialsProvider to see the cause Exception and fix the issue.
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
I would want to see the exceptions that caused each provider to fail in the stacktrace of the
Current Behavior
only messages from the exceptions that caused each provider to fail are part of the exception generated on
Reproduction Steps
this is only reproducible if your app is fetching secrets via spring.config.import: aws-secretsmanager . Failures during this boostrap stage do not have any logs printed.
Possible Solution
Chain causes of failures of all providers and set as the cause for the exception thrown on line 142 ?
Additional Information/Context
No response
AWS Java SDK version used
2.28.28
JDK version used
21.0.1
Operating System and version
unix