Open shirady opened 3 weeks ago
@romayalon same behaiour is tested in version enabled bucket and its working with out creating any issue
s3-api put-object --bucket naveen-noobaa-bucket --key x/y/z/lala.txt
{
"ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"",
"ServerSideEncryption": "AES256",
"VersionId": "xoWDrLSfwBFc4ByeDT1hD3VIPambJblb"
}
3-api list-object-versions --bucket naveen-noobaa-bucket
{
"Versions": [
{
"ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"",
"Size": 0,
"StorageClass": "STANDARD",
"Key": "x/y/z/lala.txt",
"VersionId": "xoWDrLSfwBFc4ByeDT1hD3VIPambJblb",
"IsLatest": true,
"LastModified": "2024-11-04T10:10:26+00:00",
"Owner": {
"DisplayName": "pnt-aws-root+255735097469",
"ID": "2e055fd7dc2c9eb01fe8d089e32b84c4b9e8a66b85e370793b4c7259ea477902"
}
}
],
"RequestCharged": null
}
s3-api delete-object --bucket naveen-noobaa-bucket --key x/y/z
{
"DeleteMarker": true,
"VersionId": "5OKNiYVfBRTsyZzQhEV9WMQcpq3H8Gn0"
}
naveenpaul:noobaa-core$ s3-api list-object-versions --bucket naveen-noobaa-bucket
{
"Versions": [
{
"ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"",
"Size": 0,
"StorageClass": "STANDARD",
"Key": "x/y/z/lala.txt",
"VersionId": "xoWDrLSfwBFc4ByeDT1hD3VIPambJblb",
"IsLatest": true,
"LastModified": "2024-11-04T10:10:26+00:00",
"Owner": {
"DisplayName": "pnt-aws-root+255735097469",
"ID": "2e055fd7dc2c9eb01fe8d089e32b84c4b9e8a66b85e370793b4c7259ea477902"
}
}
],
"DeleteMarkers": [
{
"Owner": {
"DisplayName": "pnt-aws-root+255735097469",
"ID": "2e055fd7dc2c9eb01fe8d089e32b84c4b9e8a66b85e370793b4c7259ea477902"
},
"Key": "x/y/z",
"VersionId": "5OKNiYVfBRTsyZzQhEV9WMQcpq3H8Gn0",
"IsLatest": true,
"LastModified": "2024-11-04T10:11:33+00:00"
}
],
"RequestCharged": null
}
cc : @shirady
@romayalon both noobaa and aws behaving similer, When I try to get object using dir path such as (a/b/c or a/b/c/) its returning The specified key does not exist.
error for both noobaa and AWS
Local noobaa behavior
s3-local put-object --bucket bucket4 --key a/b/c/lala.txt
urllib3/connectionpool.py:1061: InsecureRequestWarning: Unverified HTTPS request is being made to host 'localhost'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
{
"ETag": "\"mtime-d5ddydsepvcw-ino-byd1o\"",
"VersionId": "mtime-d5ddydsepvcw-ino-byd1o"
}
s3-local get-object --bucket bucket4 --key a/b/c ./src/cmd/text1.txt
urllib3/connectionpool.py:1061: InsecureRequestWarning: Unverified HTTPS request is being made to host 'localhost'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
An error occurred (NoSuchKey) when calling the GetObject operation: The specified key does not exist.
s3-local get-object --bucket bucket4 --key a/b/c/ ./src/cmd/text1.txt urllib3/connectionpool.py:1061: InsecureRequestWarning: Unverified HTTPS request is being made to host 'localhost'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings An error occurred (NoSuchKey) when calling the GetObject operation: The specified key does not exist.
3. try with object key path and its working
naveenpaul:noobaa-core$ s3-local get-object --bucket bucket4 --key a/b/c/lala.txt ./src/cmd/text1.txt urllib3/connectionpool.py:1061: InsecureRequestWarning: Unverified HTTPS request is being made to host 'localhost'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings { "AcceptRanges": "bytes", "LastModified": "2024-11-04T12:16:30+00:00", "ContentLength": 0, "ETag": "\"mtime-d5ddydsepvcw-ino-byd1o\"", "VersionId": "mtime-d5ddydsepvcw-ino-byd1o", "ContentType": "text/plain", "Metadata": {} }
**AWS Behavior**
1. list object items
naveenpaul:noobaa-core$ s3-aws list-objects --bucket naveen-noobaa-bucket { "Contents": [ { "Key": "i/j/k/lala.txt", "LastModified": "2024-11-04T11:50:33+00:00", "ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"", "Size": 0, "StorageClass": "STANDARD", "Owner": { "DisplayName": "pnt-aws-root+255735097469", "ID": "2e055fd7dc2c9eb01fe8d089e32b84c4b9e8a66b85e370793b4c7259ea477902" } }, { "Key": "x/y/z/lala.txt", "LastModified": "2024-11-04T10:10:26+00:00", "ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"", "Size": 0, "StorageClass": "STANDARD", "Owner": { "DisplayName": "pnt-aws-root+255735097469", "ID": "2e055fd7dc2c9eb01fe8d089e32b84c4b9e8a66b85e370793b4c7259ea477902" } } ], "RequestCharged": null }
2. try to get using dir path (i/j/k or i/j/k/) both failed.
s3-aws get-object --bucket naveen-noobaa-bucket --key i/j/k ./src/cmd/text1.txt An error occurred (NoSuchKey) when calling the GetObject operation: The specified key does not exist.
s3-aws get-object --bucket naveen-noobaa-bucket --key i/j/k/ ./src/cmd/text1.txt\ An error occurred (NoSuchKey) when calling the GetObject operation: The specified key does not exist.
3. get object with object complete path and its working
noobaa-core$ s3-aws get-object --bucket naveen-noobaa-bucket --key i/j/k/lala.txt ./src/cmd/text1.txt { "AcceptRanges": "bytes", "LastModified": "2024-11-04T11:50:33+00:00", "ContentLength": 0, "ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"", "VersionId": "MnMY1mGNXquvYLicPaEeqgFb8gmNJ_Ff", "ContentType": "binary/octet-stream", "ServerSideEncryption": "AES256", "Metadata": {} }
@romayalon both noobaa and aws behaving similer, When I try to get object using dir path such as (a/b/c or a/b/c/) its returning
The specified key does not exist.
error for both noobaa and AWSLocal noobaa behavior
- put object
s3-local put-object --bucket bucket4 --key a/b/c/lala.txt urllib3/connectionpool.py:1061: InsecureRequestWarning: Unverified HTTPS request is being made to host 'localhost'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings { "ETag": "\"mtime-d5ddydsepvcw-ino-byd1o\"", "VersionId": "mtime-d5ddydsepvcw-ino-byd1o" }
- try to get using dir path both failed
s3-local get-object --bucket bucket4 --key a/b/c ./src/cmd/text1.txt urllib3/connectionpool.py:1061: InsecureRequestWarning: Unverified HTTPS request is being made to host 'localhost'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings An error occurred (NoSuchKey) when calling the GetObject operation: The specified key does not exist.
s3-local get-object --bucket bucket4 --key a/b/c/ ./src/cmd/text1.txt urllib3/connectionpool.py:1061: InsecureRequestWarning: Unverified HTTPS request is being made to host 'localhost'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings An error occurred (NoSuchKey) when calling the GetObject operation: The specified key does not exist.
- try with object key path and its working
naveenpaul:noobaa-core$ s3-local get-object --bucket bucket4 --key a/b/c/lala.txt ./src/cmd/text1.txt urllib3/connectionpool.py:1061: InsecureRequestWarning: Unverified HTTPS request is being made to host 'localhost'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings { "AcceptRanges": "bytes", "LastModified": "2024-11-04T12:16:30+00:00", "ContentLength": 0, "ETag": "\"mtime-d5ddydsepvcw-ino-byd1o\"", "VersionId": "mtime-d5ddydsepvcw-ino-byd1o", "ContentType": "text/plain", "Metadata": {} }
AWS Behavior
- list object items
naveenpaul:noobaa-core$ s3-aws list-objects --bucket naveen-noobaa-bucket { "Contents": [ { "Key": "i/j/k/lala.txt", "LastModified": "2024-11-04T11:50:33+00:00", "ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"", "Size": 0, "StorageClass": "STANDARD", "Owner": { "DisplayName": "pnt-aws-root+255735097469", "ID": "2e055fd7dc2c9eb01fe8d089e32b84c4b9e8a66b85e370793b4c7259ea477902" } }, { "Key": "x/y/z/lala.txt", "LastModified": "2024-11-04T10:10:26+00:00", "ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"", "Size": 0, "StorageClass": "STANDARD", "Owner": { "DisplayName": "pnt-aws-root+255735097469", "ID": "2e055fd7dc2c9eb01fe8d089e32b84c4b9e8a66b85e370793b4c7259ea477902" } } ], "RequestCharged": null }
- try to get using dir path (i/j/k or i/j/k/) both failed.
s3-aws get-object --bucket naveen-noobaa-bucket --key i/j/k ./src/cmd/text1.txt An error occurred (NoSuchKey) when calling the GetObject operation: The specified key does not exist.
s3-aws get-object --bucket naveen-noobaa-bucket --key i/j/k/ ./src/cmd/text1.txt\ An error occurred (NoSuchKey) when calling the GetObject operation: The specified key does not exist.
- get object with object complete path and its working
noobaa-core$ s3-aws get-object --bucket naveen-noobaa-bucket --key i/j/k/lala.txt ./src/cmd/text1.txt { "AcceptRanges": "bytes", "LastModified": "2024-11-04T11:50:33+00:00", "ContentLength": 0, "ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"", "VersionId": "MnMY1mGNXquvYLicPaEeqgFb8gmNJ_Ff", "ContentType": "binary/octet-stream", "ServerSideEncryption": "AES256", "Metadata": {} }
@naveenpaul1 On NooBaa you tested it on the branch that contains your fix https://github.com/noobaa/noobaa-core/pull/8480 ?
yes @romayalon , I did the test with my changes in branch delete_partial_dir
Environment info
Actual behavior
AccessDenied
and in FS layer it isError: Operation not permitted, code: 'EPERM'
Expected behavior
Steps to reproduce
sudo node src/cmd/manage_nsfs account add --name <account-name> --new_buckets_path /tmp/nsfs_root1 --access_key <access-key> --secret_key <secret-key> --uid <uid> --gid <gid>
Note: before creating the account need to give permission to thenew_buckets_path
:chmod 777 /tmp/nsfs_root1
,chmod 777 /tmp/nsfs_root2
.sudo node src/cmd/nsfs --debug 5
Notes:config.NSFS_CHECK_BUCKET_BOUNDARIES = false; //SDSD
because I’m using the/tmp/
and not/private/tmp/
.alias nc-user-1-s3=‘AWS_ACCESS_KEY_ID=<access-key> AWS_SECRET_ACCESS_KEY=<secret-key> aws --no-verify-ssl --endpoint-url https://localhost:6443’
.nc-user-1-s3 s3 ls; echo $?
nc-user-1-s3 s3 mb s3://bucket-v
(bucket-v
is the bucket name in this example)nc-user-1-s3 s3api put-bucket-versioning --bucket bucket-v --versioning-configuration Status=Enabled
nc-user-1-s3 s3api put-object --bucket bucket-v --key /a/b/c/lala.txt
nc-user-1-s3 s3api delete-object --bucket bucket-v --key /a/b/c
Note: deleting the directory creates the delete marker as expected (nc-user-1-s3 s3api delete-object --bucket bucket-v --key /a/b/c/
).More information - Screenshots / Logs / Other output
Might be that this issue is with the same root cause of the issue - #8320