Skip to content

Google Cloud Storage bucket: putObject access broken since 2.30.0 #5987

@uwolfer

Description

@uwolfer

Describe the bug

When using the library against a Google Cloud Storage bucket, it fails uploading an object starting 2.30.0 (tested until 2.31.6),

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

PutObject should work as it used to until 2.29.52.

Current Behavior

It throws

software.amazon.awssdk.services.s3.model.S3Exception: Invalid argument. (Service: S3, Status Code: 403, Request ID: null) (SDK Attempt Count: 1)

When stepping a bit into, I can see that SignatureDoesNotMatch is received.

Image

Reproduction Steps

      var credentials = AwsBasicCredentials.create("...", "...");
      var s3Client = S3Client.builder()
              .credentialsProvider(StaticCredentialsProvider.create(credentials))
              .endpointOverride(URI.create("https://storage.googleapis.com"))
              .region(Region.of("auto"))
              .serviceConfiguration(S3Configuration.builder().pathStyleAccessEnabled(true).build())
              .build());
      var request =
          PutObjectRequest.builder()
              .bucket(bucketName)
              .key(key)
              .contentType(contentType)
              .contentLength((long) contents.length)
              .build();
      s3Client.putObject(request, fromBytes(contents));

Possible Solution

No response

Additional Information/Context

Note: I have seen the following in changelog, could be related:

This change enhances integrity protections for new SDK requests to S3. S3 SDKs now support the CRC64NVME checksum algorithm, full object checksums for multipart S3 objects, and new default integrity protections for S3 requests.

AWS Java SDK version used

2.31.6

JDK version used

21.0.6

Operating System and version

archlinux (up-to-date)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.closed-for-stalenessp2This is a standard priority issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions