-
Notifications
You must be signed in to change notification settings - Fork 596
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
Regression in service/s3/v1.48.1
with use of CredentialsProviderFunc
(panic)
#2473
Comments
Hi @brandur , Thanks for reaching out. I'm able to reproduce the behavior. Will have someone look at it with priority. All the best, |
The removal of that asymmetric wrapper was correct but it's exposed the potential to fail on that comparison as you've observed. This should only be affecting S3, this check is a customization for S3Express and shouldn't occur anywhere else to my knowledge. The correct way forward here will be to correct that comparison in A workaround until this is fixed would be to switch to a using a comparable value that satisfies the credentials provider interface. |
A workaround might look like: staticCreds := credentials.NewStaticCredentialsProvider(awsAccessKeyID, awsSecretAccessKey, "")
cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRegion("us-east-1"))
if err != nil {
log.Fatalf("unable to load SDK config, %v", err)
}
client := s3.NewFromConfig(cfg, func(options *s3.Options) {
options.Credentials = staticCreds
}) Or you can pass it to your config directly: cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRegion("us-east-1"), config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(awsAccessKeyID, awsSecretAccessKey, "")))
if err != nil {
log.Fatalf("unable to load SDK config, %v", err)
} Thanks, |
@RanVaknin Thanks! We needed a fast fix so I just downgraded the S3 package on Monday to get things working again. The use of |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
We upgraded from
service/s3/v1.48.0
toservice/s3/v1.48.1
and started getting this exception on S3 requests:Digging in, the problem is emanating from this line, where two credentials are compared, and comparing functions isn't allowed.
aws-sdk-go-v2/service/s3/express_resolve.go
Lines 34 to 36 in 1ff8d79
I didn't full confirm this (so take it with a grain of salt), but I believe the problem may be related to #2465 from @lucix-aws. In
api_client.go
,resolveCredentialProvider
was removed, which looks like it may have wrapped aCredentialsProviderFunc
into an adapter that might've made it comparable.With the removal of that, comparing the raw
CredentialsProviderFunc
credentials is a panic.https://github.com/aws/aws-sdk-go-v2/pull/2465/files#diff-52ebcb8665d547278ab74478a642e6eab70ec56dc566673ef1d7a1e292e7f285
Expected Behavior
S3 requests work without a panic.
Current Behavior
Panic and program crash occurs.
Reproduction Steps
Make sure to use
CredentialsProviderFunc
for credentials. e.g.Possible Solution
No response
Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
Compiler and Version used
go version go1.21.4 darwin/arm64
Operating System and version
macOS
The text was updated successfully, but these errors were encountered: