-
Notifications
You must be signed in to change notification settings - Fork 863
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
S3Client.builder() without credentials provider behaves differently than if set explicitly to DefaultCredentialsProvider.create() #5073
Comments
Hi @DocX, I tried using both Using S3Client builder with or without credentials provider, the program doesn't read the updated (corrected) credentials saved during the execution. Kindly let me know if I am missing anything here. Also, see if your mentioned scenario is related to this issue #1754. Regards, |
Hello @bhoradc Thank you for looking into this.
Ok I've retested it again with the latest SDK version
Perhaps the confusion was from me also testing it originally with the version we use in our actual service in production, which is
Yes that seems like actual duplicate in the version Duplicate of #1754 |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
Using
S3Client
builder without credentials provider, e.g.:instantiates internally
DefaultCredentialsProvider
with staticProfileFile
that results in the credentials not being reloaded when using credentials file viaAWS_SHARED_CREDENTIALS_FILE
.However passing own instance of
DefaultCredentialsProvider
:works as expected, refreshing the credentials used when the credentials file is updated on disk.
Expected Behavior
The default builder should not set static ProfileFile in the default credentials provider. The two examples above should behave the same.
Current Behavior
The client builder without setting the credentials provider creates client that is not refreshing credentials from the credential file when the file updates.
Reproduction Steps
Create credentials mock file
aws-sdk-bug/credentials
to make the program failing until file is updated:and set the environment variable to use the profile provider from the default provider chain:
run following java program:
while it is running, update the
aws-sdk-bug/credentials
file to contain valid credentials. The output should stop printing errors and start print the number of objects in the S3 bucket.Possible Solution
The client builder code should use DefaultCredentialsProvider with keeping it's
profileFile
valuenull
.Additional Information/Context
No response
AWS Java SDK version used
2.25.25
JDK version used
openjdk 18.0.1 2022-04-19
Operating System and version
macOS 13.4.1
The text was updated successfully, but these errors were encountered: