lakeFS icon indicating copy to clipboard operation
lakeFS copied to clipboard

S3 Gateway: Wrong error message when try to use copy_object with size > 5GB

Open N-o-Z opened this issue 1 year ago • 0 comments

When trying to use boto's copy_object on a file > 5GB the returned error is:

botocore.exceptions.ClientError: An error occurred (InvalidRequest) when calling the CopyObject operation: This copy request is illegal because it is trying to copy an object to itself without changing the object's metadata, storage class, website redirect location or encryption attributes.

Even though the underlying error message from S3 states:

api error InvalidRequest: The specified copy source is larger than the maximum allowable size for a copy source

This is because of error mapping in the gateway:

var Codes = errorCodeMap{
	ErrInvalidCopyDest: {
		Code:           "InvalidRequest",
		Description:    "This copy request is illegal because it is trying to copy an object to itself without changing the object's metadata, storage class, website redirect location or encryption attributes.",
		HTTPStatusCode: http.StatusBadRequest,
	},

N-o-Z avatar Feb 12 '24 09:02 N-o-Z