-
Notifications
You must be signed in to change notification settings - Fork 741
Description
Acknowledgements
- I have searched (https://github.com/aws/aws-sdk/issues?q=is%3Aissue) for past instances of this issue
- I have verified all of my SDK modules are up-to-date (you can perform a bulk update with
go get -u github.com/aws/aws-sdk-go-v2/...)
Describe the bug
I am working with a S3-compatible object storage, but after switch to SDK v2, the DeleteObjects API start to fail with
operation error S3: DeleteObjects, https response error StatusCode: 400, RequestID: fbi00t
8ei6ioa47vfp8qrmtclmur37p9, HostID: , api error InvalidRequest: Missing required header for this request: Content-MD5.
from the doc https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html
Content-MD5 request header
General purpose bucket - The Content-MD5 request header is required for all Multi-Object Delete requests. Amazon S3 uses the header value to ensure that your request body has not been altered in transit.
Directory bucket - The Content-MD5 request header or a additional checksum request header (including x-amz-checksum-crc32, x-amz-checksum-crc32c, x-amz-checksum-sha1, or x-amz-checksum-sha256) is required for all Multi-Object Delete requests.
I found a history issue which has been fixed, #795, but the same phenomenon appears again
Also found a similar issue in the AWS Java SDK v2 aws/aws-sdk-java-v2#5805 which have a comment that we can workaround by set request_checksum_calculation = when_required, but it's not working in golang SDK.
and from the source code, the DeleteObjects API doesn't have the ContentMd5 field like other APIs have,
| type DeleteObjectsInput struct { |
aws-sdk-go-v2/service/s3/api_op_PutObject.go
Line 377 in 48b8c1d
| ContentMD5 *string |
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
no error or have a workaround
Current Behavior
report 400
Reproduction Steps
simple DeleteObjects on S3-compatibile object store
Possible Solution
No response
Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
github.com/aws/aws-sdk-go-v2 v1.38.1
github.com/aws/aws-sdk-go-v2/config v1.29.17
github.com/aws/aws-sdk-go-v2/credentials v1.17.70
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.84
github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.45.3
github.com/aws/aws-sdk-go-v2/service/ec2 v1.232.0
github.com/aws/aws-sdk-go-v2/service/kms v1.41.2
github.com/aws/aws-sdk-go-v2/service/s3 v1.87.1
github.com/aws/aws-sdk-go-v2/service/sts v1.34.0
Compiler and Version used
1.25
Operating System and version
mac