You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidRequest</Code><Message>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.</Message><Resource></Resource><RequestId></RequestId><HostId></HostId></Error>
The error makes some sense, since trying to add a folder to another folder in POSIX, when a file with the same name already exists in that folder, results in a "file exists" error. However, this operation is legal in direct-to-s3, and may be confusing to someone coming from s3 who doesn't understand why this doesn't work with a POSIX backend. One suggestion is be similar to the s3api error response: "Directory object contains data payload", if the object contains data, or something similar to: "a directory object cannot have the same name as a non-directory object in POSIX mode."
To Reproduce
Start versity with a posix backend, e.g.: ./versitygw --access=******** --secret=******** --region=us-east-1 --iam-dir=/Users/lukemccrone/devel/versitygw/iam --cert /Users/lukemccrone/devel/versitygw/cert.pem --key /Users/lukemccrone/devel/versitygw/versitygw.pem posix --versioning-dir /tmp/versioning /tmp/gw
Create, and add an object to the bucket, e.g.: aws --no-verify-ssl s3api put-object --body /Users/lukemccrone/devel/versitygw/versity-gwtest-files/a --bucket versity-gwtest-bucket-one-1 --key a
Use to script at https://github.com/versity/versitygw/blob/test/directory_objects/tests/rest_scripts/copy_object.sh to send a command to copy 'a' to 'a/'. The curl command should look like this: curl -ks -w %{http_code} -X PUT https://localhost:7070/versity-gwtest-bucket-one-1/a/ -H Authorization: AWS4-HMAC-SHA256 Credential=********/20250109/us-east-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-copy-source;x-amz-date,Signature=56ab338dbace53054d43c22a67837c861f9d3daa379dc71a2cc5b221570d0641 -H x-amz-content-sha256: UNSIGNED-PAYLOAD -H x-amz-copy-source: versity-gwtest-bucket-one-1/a -H x-amz-date: 20250109T215702Z -o /Users/lukemccrone/devel/versitygw/versity-gwtest-files/result.txt
Expected behavior
A clearer error when the copy fails.
Server Version
Version : v1.0.9
Build : 684d053
BuildTime: 2025-01-09_11:04:12PM
Darwin Lukes-MacBook-Pro.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:25 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6030 arm64
The text was updated successfully, but these errors were encountered:
Describe the bug
The error is:
The error makes some sense, since trying to add a folder to another folder in POSIX, when a file with the same name already exists in that folder, results in a "file exists" error. However, this operation is legal in direct-to-s3, and may be confusing to someone coming from s3 who doesn't understand why this doesn't work with a POSIX backend. One suggestion is be similar to the s3api error response: "Directory object contains data payload", if the object contains data, or something similar to: "a directory object cannot have the same name as a non-directory object in POSIX mode."
To Reproduce
./versitygw --access=******** --secret=******** --region=us-east-1 --iam-dir=/Users/lukemccrone/devel/versitygw/iam --cert /Users/lukemccrone/devel/versitygw/cert.pem --key /Users/lukemccrone/devel/versitygw/versitygw.pem posix --versioning-dir /tmp/versioning /tmp/gw
aws --no-verify-ssl s3api create-bucket --bucket versity-gwtest-bucket-one-1
aws --no-verify-ssl s3api put-object --body /Users/lukemccrone/devel/versitygw/versity-gwtest-files/a --bucket versity-gwtest-bucket-one-1 --key a
curl -ks -w %{http_code} -X PUT https://localhost:7070/versity-gwtest-bucket-one-1/a/ -H Authorization: AWS4-HMAC-SHA256 Credential=********/20250109/us-east-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-copy-source;x-amz-date,Signature=56ab338dbace53054d43c22a67837c861f9d3daa379dc71a2cc5b221570d0641 -H x-amz-content-sha256: UNSIGNED-PAYLOAD -H x-amz-copy-source: versity-gwtest-bucket-one-1/a -H x-amz-date: 20250109T215702Z -o /Users/lukemccrone/devel/versitygw/versity-gwtest-files/result.txt
Expected behavior
A clearer error when the copy fails.
Server Version
Version : v1.0.9
Build : 684d053
BuildTime: 2025-01-09_11:04:12PM
Darwin Lukes-MacBook-Pro.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:25 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6030 arm64
The text was updated successfully, but these errors were encountered: