-
Notifications
You must be signed in to change notification settings - Fork 865
S3 GetObjectAsync broken in version AWSSDK.S3 3.7.104.28 #2622
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
Comments
same here |
PutObjectRequest is also broken after testing |
33bfebe this change is breaking the old behaviour. |
Appears to be reproducible. Needs review with the team. I'm not sure if the syntax In
using (AmazonS3Client client = new AmazonS3Client(new AmazonS3Config()))
{
AWSConfigs.LoggingConfig.LogTo = LoggingOptions.Console;
AWSConfigs.LoggingConfig.LogResponses = ResponseLoggingOption.Always;
AWSConfigs.LoggingConfig.LogMetrics = true;
var getObjectResponse = await client.GetObjectAsync(new GetObjectRequest() {
BucketName = "testbucket",
Key = "foldername/test.txt"
});
Console.WriteLine($"Object Size: {getObjectResponse.ContentLength}");
} used
using (AmazonS3Client client = new AmazonS3Client(new AmazonS3Config()))
{
AWSConfigs.LoggingConfig.LogTo = LoggingOptions.Console;
AWSConfigs.LoggingConfig.LogResponses = ResponseLoggingOption.Always;
AWSConfigs.LoggingConfig.LogMetrics = true;
var getObjectResponse = await client.GetObjectAsync(new GetObjectRequest() {
BucketName = "testbucket/foldername",
Key = "test.txt"
});
Console.WriteLine($"Object Size: {getObjectResponse.ContentLength}");
} used |
Hi @renemadsen @jeferssonlemes Sorry the 33bfebe change affected you but it was never intended to pass in a key prefix as part of the There is a lot of logic in the SDK inspecting the bucket name for figuring out DNS routing and signing. In many of those scenarios if you would have added the key prefix that would have broken the scenario. For example if you were using a multi region access point as a the bucket name and added a key prefix the SDK would have failed to recognize the access point and would have signed it incorrectly. I'm sure S3 will want us to add even more logic like this to the To give you an appreciation of the complexity of the |
It's not a problem that we have this kind of change, it should just have been marked as a breaking change. |
@renemadsen fair callout that this was a breaking change. This just wasn't a scenario we thought of to have a test for to catch the breaking change. |
Maybe there should be some test in the code to ensure one does not try to do what we apparently was able to do for several years. Throw an exception if the bucketname includes "/" ? |
|
Describe the bug
Using the S3 part and consider a structure, where there are a bucket with "folders" in it, so we have this structure bucketname/foldername/filename.png
The location of foldername in parameters for GetObjectRequest has changed.
Expected Behavior
Return the object
Current Behavior
The request signature we calculated does not match the signature you provided. Check your key and signing method.
Reproduction Steps
In version 3.7.104.20 and older, you could do the following to retrieve an object:
In version 3.7.104.28 it's changed and now you have to do:
Possible Solution
No response
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
AWSSDK.S3 3.7.104.28
Targeted .NET Platform
Net 7
Operating System and version
Ubuntu 22.04, 22.10, 23.04
The text was updated successfully, but these errors were encountered: