Skip to content

S3 uploads fail with HTTP 400 on buckets with Object Lock enabled #727

@tianshanghong

Description

@tianshanghong

Describe the bug

Backing up to an S3 bucket that has default Object Lock retention enabled fails with:

error uploading backup to remote storage:
  [Message]: 'Content-MD5 OR x-amz-checksum- HTTP header is required
              for Put Object requests with Object Lock parameters',
  [Code]: InvalidRequest,
  [StatusCode]: 400

AWS S3 requires a Content-MD5 (or x-amz-checksum-*) header on every PutObject when the target bucket has Object Lock. The minio-go SDK supports this via PutObjectOptions.SendContentMd5, but it defaults to false.

To Reproduce

  1. Create an S3 bucket with default Object Lock retention (e.g., Governance mode, 30 days).
  2. Configure docker-volume-backup to back up to that bucket.
  3. Run a backup — the upload fails with the 400 error above.

Expected behavior

The backup uploads successfully. Content-MD5 is sent with the PutObject request, satisfying the Object Lock requirement.

Version (please complete the following information):

  • Image Version: v2 (latest)
  • Docker Version: 27.x
  • Docker Compose Version: 2.x

Additional context

Setting SendContentMd5: true in the PutObjectOptions struct in internal/storage/s3/s3.go resolves the issue. See #728.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions