Closed hseipp closed 4 days ago
@nadavMiz can you please take a look?
Please note that the same error occurs when using Ceph s3-tests test_versioning_obj_create_versions_remove_all()
:
S3TEST_CONF=s3tests.conf tox -- s3tests_boto3/functional/test_s3.py::test_versioning_obj_create_versions_remove_all
...
client = <botocore.client.S3 object at 0x7f29f51579d0>, bucket_name = 's3tests-l07lrjq90dn6imxsfi5dj-1', key = 'testobj', version_ids = ['mtime-d3ro2a9o7f28-ino-1es0']
contents = ['content-9']
def check_obj_versions(client, bucket_name, key, version_ids, contents):
# check to see if objects is pointing at correct version
response = client.list_object_versions(Bucket=bucket_name)
versions = []
> versions = response['Versions']
E KeyError: 'Versions'
And another variant of the same issue - Ceph s3-tests test_versioning_obj_create_versions_remove_special_names()
:
contents = ['content-9']
def check_obj_versions(client, bucket_name, key, version_ids, contents):
# check to see if objects is pointing at correct version
response = client.list_object_versions(Bucket=bucket_name)
versions = []
> versions = response['Versions']
E KeyError: 'Versions'
Please note that due to the empty ListBucketVersion response also the teardown()
of the s3-tests framework is failing because it deletes the objects in the bucket based on the ListBucketVersion information before trying to delete the bucket. In our case, the bucket will not be emptied as the ListBucketVersion response contains nothing except the RequestCharged entry while one version of the object is still present. Thus we get a BucketNotEmpty
exception:
s3tests_boto3/functional/__init__.py:303: in teardown
nuke_prefixed_buckets(prefix=prefix)
s3tests_boto3/functional/__init__.py:159: in nuke_prefixed_buckets
raise err
s3tests_boto3/functional/__init__.py:150: in nuke_prefixed_buckets
nuke_bucket(client, bucket_name)
s3tests_boto3/functional/__init__.py:139: in nuke_bucket
client.delete_bucket(Bucket=bucket)
.tox/py/lib/python3.8/site-packages/botocore/client.py:569: in _api_call
return self._make_api_call(operation_name, kwargs)
....
if http.status_code >= 300:
error_info = parsed_response.get("Error", {})
error_code = error_info.get("QueryErrorCode") or error_info.get(
"Code"
)
error_class = self.exceptions.from_code(error_code)
> raise error_class(parsed_response, operation_name)
E botocore.exceptions.ClientError: An error occurred (BucketNotEmpty) when calling the DeleteBucket operation: The bucket you tried to delete is not empty. You must delete all versions in the bucket.
Environment info
Actual behavior
ListObjectVersions does not return a VersionId for last remaining version after all previous versions of a key are deleted. Instead, ListObjectVersions only returns:
Expected behavior
ListObjectVersions should report correct versioning information for the object. Example:
Steps to reproduce
Execute Ceph s3-tests, function
test_versioning_obj_create_read_remove()
Alternatively run the following python script (adjust profile and certificate to your needs):
More information - Screenshots / Logs / Other output
Output of the Python script with the error:
Noobaa log with "all" mode enabled:
noobaa_20240828_1455.log.gz