Skip to content

Concent-MD5 missing from DeleteObjects #3258

@D3Hunter

Description

@D3Hunter

Acknowledgements

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 {

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions