Skip to content

TransferManager copy not using endpoint override in source object metadata request's Host header #3370

Closed
@bpiper

Description

@bpiper

Describe the bug

When copying from and to a single bucket hosted on a local Minio server (e.g. localhost:9100) using S3TransferManager.copy, it's getting a 404 when trying to get the source object metadata, which is due to an incorrect Host header in the request.

Expected Behavior

Metadata for the source object should be successfully retrieved and followed by a successful PUT to create the destination object.

Current Behavior

The SDK sends something like the following request (auth/signing headers not included as they're irrelevant) to Minio:

HEAD /74123c17-e8b5-413d-9b20-386dc4afbdef HTTP/1.1
Host: my-bucket.s3.us-west-2.amazonaws.com
User-Agent: CRTS3NativeClient/0.1.x
X-Amz-Date: 20220821T233250Z

This results in a 404, presumably because Minio doesn't identify with the domain in the Host header, which should really have been my-bucket.localhost:9100.

Reproduction Steps

Just a standard within-bucket object copy using S3TransferManager.copy and overriding the endpoint to a local Minio server using http (behaviour may or may not differ if using https).

Possible Solution

I couldn't track down the code that actually executes the operation, so no clue currently. This just seems like an oversight with the addition of endpoint overriding (i.e. not honouring that override in the Host header and instead defaulting to the standard S3 endpoint for the default region).

Additional Information/Context

No response

AWS Java SDK version used

2.17.236

JDK version used

OpenJDK 64-Bit Server VM Temurin-11.0.16+8 (build 11.0.16+8, mixed mode)

Operating System and version

Ubuntu 20.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions