-
Notifications
You must be signed in to change notification settings - Fork 970
Description
Describe the bug
We are using AWS SDK V2 and CRT to read, list and write files to S3 buckets across regions (cross region enabled)
We are able to download / read the file from the primary region without any issues.
But when we tried to download from the S3 bucket in other region, it fails with error like
"s.a.a.s.s.m.S3Exception: null (Service: S3, Status Code: 400, Request ID: *****, Extended Request ID: ****)
s.a.a.s.s.m.S3Exception$BuilderImpl.build(S3Exception.java:104)"
But if we issue a list or a write operation, it does not error out. Interestingly if we execute the read/get after a list or write, read /get operation works fine.
It fails if we are directly reading (get object) file from cross region S3 bucket with out executing a list or write operation.
Expected Behavior
Download of the file from a cross region S3 bucket should work fine.
Current Behavior
It fails if we are directly reading (get object) file from cross region S3 bucket with out executing a list or write operation.
Reproduction Steps
// Downloading file
S3TransferManager.builder().s3Client(S3AsyncClient.crtBuilder().region(Region.of("us-east-1")).crossRegionAccessEnabled(true) .build()).build().downloadFile(DownloadFileRequest.builder().getObjectRequest(b -> b.bucket(s3BucketInUsw2).key(s3Key)).destination(file).build()).completionFuture().join();
Possible Solution
As a work around, we are issuing the list operation before reading the file. Also disabling the CRT works.
Additional Information/Context
aws-crt version 0.27.7. Also tested with latest AWS SDK versions - 2.21.28 and CRT 0.28.8
AWS Java SDK version used
2.21.4
JDK version used
17
Operating System and version
linux