From 2a7545ba4bb39601f566251ebb639f62109ecd11 Mon Sep 17 00:00:00 2001 From: shaolila Date: Tue, 14 Jul 2026 18:20:02 +0800 Subject: [PATCH] fix(storage): suppress SDK checksum WARN for S3-compatible backends AWS SDK Go v2 logs a WARN on every GetObject response when the server does not return x-amz-checksum-* headers, which MinIO and other S3-compatible backends do not include by default. Setting ResponseChecksumValidation to WhenRequired tells the SDK to only validate payload checksums when the caller explicitly requests one, eliminating the noise without compromising integrity guarantees for callers that do use checksums. --- packages/shared/pkg/storage/storage_aws.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/shared/pkg/storage/storage_aws.go b/packages/shared/pkg/storage/storage_aws.go index a35f003323..90ea077e15 100644 --- a/packages/shared/pkg/storage/storage_aws.go +++ b/packages/shared/pkg/storage/storage_aws.go @@ -73,6 +73,18 @@ func newAWSStorage(ctx context.Context, spec Spec, limiter *limit.Limiter) (*aws // default virtual-host style https://bucket.host/key) is required by // most S3-compatible backends (MinIO, Ceph, …). o.UsePathStyle = spec.UsePathStyle + + // S3-compatible backends (MinIO, Ceph, etc.) do not return x-amz-checksum-* + // response headers. Without this setting the SDK logs a WARN for every + // GetObject response because it cannot validate the payload checksum. + // WhenRequired tells the SDK to only validate when the caller explicitly + // requested a checksum — matching the actual contract with these backends. + // Standard AWS S3 returns checksums and benefits from WhenSupported (the + // SDK default), so this opt-out is gated on UsePathStyle which already + // identifies S3-compatible deployments. + if spec.UsePathStyle { + o.ResponseChecksumValidation = aws.ResponseChecksumValidationWhenRequired + } }) presignClient := s3.NewPresignClient(client)