Bablu Raul created HDDS-17644:
---------------------------------
Summary: S3 CreateMultipartUpload is accepted under a parent that
is a file, then every UploadPart fails with 500 InternalError
Key: HDDS-17644
URL: https://issues.apache.org/jira/browse/HDDS-17644
Project: Apache Ozone
Issue Type: Bug
Components: S3
Reporter: Bablu Raul
In an FSO bucket, if a parent path already exists as a regular file, a
{{PutObject}} request to create an object under that file is correctly rejected
with HTTP 400 {{{}InvalidRequest{}}}.
However, {{CreateMultipartUpload}} for the same key succeeds and returns an
{{{}UploadId{}}}. When attempting to upload a part, the request fails with HTTP
500 {{{}InternalError{}}}.
The S3 Gateway logs show that Ozone Manager rejects the operation with
{{NOT_A_FILE}} because the parent path is already an existing file. However,
the S3 Gateway returns a generic 500 error instead of an appropriate 4xx error.
As a result, the multipart upload is created but no parts can be uploaded,
leaving it unusable until explicitly aborted.
*Steps to Reproduce*
# Create a bucket with {{FILE_SYSTEM_OPTIMIZED}} layout.
# Create a regular file in the bucket (for example, {{{}file-062844{}}}).
# Try a {{PutObject}} request using {{file-062844/child}} as the key. It
should fail with HTTP 400 {{{}InvalidRequest{}}}.
# Initiate a multipart upload for the same key using
{{{}CreateMultipartUpload{}}}.
# Verify that the request succeeds and returns an {{{}UploadId{}}}.
# Attempt to upload a part using the returned {{{}UploadId{}}}.
*Actual Result*
* {{CreateMultipartUpload}} succeeds even though the parent path is an
existing file.
* Every {{UploadPart}} request fails with HTTP 500 {{{}InternalError{}}}.
* Ozone Manager reports a {{NOT_A_FILE}} exception, but the S3 Gateway returns
a generic 500 error.
* No parts are stored, and the multipart upload can only be aborted.
*Expected Result*
* {{CreateMultipartUpload}} should be rejected immediately with HTTP 400
{{{}InvalidRequest{}}}, consistent with {{{}PutObject{}}}.
* If {{UploadPart}} encounters a {{NOT_A_FILE}} exception, the S3 Gateway
should return an appropriate 4xx error instead of HTTP 500
{{{}InternalError{}}}.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]