Bug #39622
closedrgw:RGWGetBucketVersioning on non-existing bucket does not return NoSuchBucket (http=404)
0%
Description
The issue is reproducible with downstream luminous and should be reproducible with master branch as well.
Steps to reproduce:
1. Get available buckets
$ python s3.list_bucket.py
Bucket List: ['bbq', 'my-av-bucket', 's3bucket']
-------------------------
s3.list_bucket.py
-------------------------
#!/usr/bin/python
import boto3
access_key = 's3user'
secret_key = 's3user'
s3 = boto3.client('s3', endpoint_url='http://rgw.default.abc.xyz.com:8080')
response = s3.list_buckets()
buckets = [bucket['Name'] for bucket in response['Buckets']]
print("Bucket List: %s" % buckets)
-------------------------
2. try to get bucket version for non-existing bucket
$ python s3.bucket_version.py
{'ResponseMetadata': {'HTTPStatusCode': 200, 'RetryAttempts': 0, 'HostId': '', 'RequestId': 'tx000000000000000000063-005cd23c32-fac4-us-east', 'HTTPHeaders': {'date': 'Wed, 08 May 2019 02:17:22 GMT', 'content-length': '137', 'x-amz-request-id': 'tx000000000000000000063-005cd23c32-fac4-us-east', 'content-type': 'application/xml'}}}
---------------------------
s3.bucket_version.py
---------------------------
#!/usr/bin/python
access_key = 's3user'
secret_key = 's3user'
- Create an S3 client
s3 = boto3.client('s3', endpoint_url='http://rgw.default.abc.xyz.com:8080')
print(s3.get_bucket_versioning(Bucket='BUCKET'))
---------------------------
Actual results: {'ResponseMetadata': {'HTTPStatusCode': 200, 'RetryAttempts': 0, 'HostId': '', 'RequestId': 'tx000000000000000000063-005cd23c32-fac4-us-east', 'HTTPHeaders': {'date': 'Wed, 08 May 2019 02:17:22 GMT', 'content-length': '137', 'x-amz-request-id': 'tx000000000000000000063-005cd23c32-fac4-us-east', 'content-type': 'application/xml'}}}
Expected results:
botocore.errorfactory.NoSuchBucket: An error occurred (NoSuchBucket) when calling the GetBucketVersioning operation: Unknown