Closed ZhaoMJ closed 5 months ago
@ZhaoMJ thank you for raising this. Yes, it looks like bucketKeyEnabled
is not being passed to InitiateMultipartUploadRequest. Marking as a bug.
The team's focus is in Java SDK v2 work, so this has low chance to be fixed before the start of Maintenance Mode later this year.
We don't have plans to fix before going into Maintenance Mode, so I'll go ahead and close this.
I've done a quick test using TransferManager v2, and this issue does not happen with S3 CRT client, the bucketKeyEnabled
is correctly reflected in the initiateMultipartUpload request. So we recommend you migrate to Java SDK v2.
This issue is now closed.
Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
Upcoming End-of-Support
Describe the bug
If multipart upload is used, files uploaded by the
TransferManager
don't have the correct object-level bucket key setting as specified in thePutObjectRequest
. It turns out that thebucketKeyEnabled
setting is not copied when configuring theInitiateMultipartUploadRequest
: https://github.com/aws/aws-sdk-java/blob/34b4aa0668c1973252ef764d4768cf3ebfecc15c/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/UploadCallable.java#L422-L430Expected Behavior
Objects uploaded by the
TransferManager
always have the correct object-level bucket key setting as specified in thePutObjectRequest
.Current Behavior
Objects uploaded by the
TransferManager
don't have the correct object-level bucket key setting as specified in thePutObjectRequest
when multipart upload is used.Reproduction Steps
TransferManager
with aMultipartUploadThreshold
of 8MB.TransferManager
with aMultipartUploadThreshold
of 16MB.PutObjectRequest
using the newTransferManager
.Possible Solution
Copy
bucketKeyEnabled
fromPutObjectRequest
toInitiateMultipartUploadRequest
, i.e. Add the following toUploadCallable.initiateMultipartUpload
:Additional Information/Context
No response
AWS Java SDK version used
1.12.466
JDK version used
openjdk version "17.0.9" 2023-10-17 LTS OpenJDK Runtime Environment Zulu17.46+19-CA (build 17.0.9+8-LTS) OpenJDK 64-Bit Server VM Zulu17.46+19-CA (build 17.0.9+8-LTS, mixed mode, sharing)
Operating System and version
macOS 13.6.3