Closed shirady closed 3 months ago
closing - I don't think we have a better solution for this scenario.
The options that were considered:
InternalError
and it is less user-friendly than the original solution (although we could attach to it additional details). By changing the message for this specific error (BucketAlreadyExists
) we will pay for it by being not compatible with the S3 error message.
Environment info
Actual behavior
BucketAlreadyExists
, when there is not config file with this name.Expected behavior
BucketAlreadyExists
explains it) and a check that we do and there is a file that already exists (the bucket doesn't have a config file).Steps to reproduce
sudo mkdir -p /tmp/nsfs_root1/my-bucket
(the/tmp/nsfs_root1
will be used asnew_buckets_path
the sub directorymy-bucket
will create the issue) and give permissionchmod 777 /tmp/nsfs_root1/.
.sudo node src/cmd/manage_nsfs account add --name <account-name> --uid <uid> --gid <gid> --new_buckets_path <new_buckets_path>
(use those credentials in the alias step below).sudo node src/cmd/nsfs --debug 5
Create the alias for the created account in the S3 service:alias s3-nc-user-1='AWS_ACCESS_KEY_ID=<access-key> AWS_SECRET_ACCESS_KEY=<secret-key> aws --no-verify-ssl --endpoint-url https://localhost:6443/'
Note: I Change theconfig.NSFS_CHECK_BUCKET_BOUNDARIES = false; //SDSD
because I'm using the/tmp/
and not/private/tmp/
.s3-nc-user-1 s3 mb s3://my-bucket
To show the difference that we have in the logs between the cases:
sudo rmdir /tmp/nsfs_root1/my-bucket
s3-nc-user-1 s3 mb s3://my-bucket
s3-nc-user-1 s3 mb s3://my-bucket
(expectBucketAlreadyExists
).More information - Screenshots / Logs / Other output
Output of
s3-nc-user-1 s3 mb s3://my-bucket
:Partial logs (
udo node src/cmd/nsfs --debug 5
):Run
s3-nc-user-1 s3 mb s3://my-bucket
after it was created: