Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnocchi upgrade fails when using s3 driver for aggregate storage if bucket is present #1085

Open
manuvakery1 opened this issue Nov 24, 2020 · 1 comment
Labels

Comments

@manuvakery1
Copy link

manuvakery1 commented Nov 24, 2020

Which version of Gnocchi are you using

gnocchi 4.3.4 (centos-release-openstack-train)

How to reproduce your problem

  1. use s3 driver for gnocchi aggregate storage
  2. perform gnocchi-upgrade multiple times

What is the result that you get

2020-11-23 11:55:38,990 [13618] CRITICAL root: Traceback (most recent call last):
  File "/bin/gnocchi-upgrade", line 11, in <module>
    load_entry_point('gnocchi==4.3.4', 'console_scripts', 'gnocchi-upgrade')()
  File "/usr/lib/python2.7/site-packages/gnocchi/cli/manage.py", line 73, in upgrade
    s.upgrade()
  File "/usr/lib/python2.7/site-packages/gnocchi/storage/s3.py", line 90, in upgrade
    s3.create_bucket(self.s3, self._bucket_name, self._region_name)
  File "/usr/lib/python2.7/site-packages/tenacity/__init__.py", line 292, in wrapped_f
    return self.call(f, *args, **kw)
  File "/usr/lib/python2.7/site-packages/tenacity/__init__.py", line 358, in call
    do = self.iter(retry_state=retry_state)
  File "/usr/lib/python2.7/site-packages/tenacity/__init__.py", line 319, in iter
    return fut.result()
  File "/usr/lib/python2.7/site-packages/concurrent/futures/_base.py", line 422, in result
    return self.__get_result()
  File "/usr/lib/python2.7/site-packages/tenacity/__init__.py", line 361, in call
    result = fn(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/gnocchi/common/s3.py", line 65, in create_bucket
    return conn.create_bucket(Bucket=name, **kwargs)
  File "/usr/lib/python2.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/lib/python2.7/site-packages/botocore/client.py", line 676, in _make_api_call
    raise error_class(parsed_response, operation_name)
BucketAlreadyOwnedByYou: An error occurred (BucketAlreadyOwnedByYou) when calling the CreateBucket operation: Your previous request to create the named bucket succeeded and you already own it.

What is result that you expected

BucketAlreadyOwnedByYou exception should be handled gracefully

@manuvakery1 manuvakery1 changed the title gnicchi upgrade fails when using s3 driver for aggregate storage when bucket is present gnicchi upgrade fails when using s3 driver for aggregate storage if bucket is present Nov 24, 2020
@manuvakery1
Copy link
Author

manuvakery1 commented Nov 24, 2020

I think the check here should be changed as follows

try:
            s3.create_bucket(self.s3, self._bucket_name, self._region_name)
        except botocore.exceptions.ClientError as e:
            if e.response['Error'].get('Code') != "BucketAlreadyOwnedByYou":
                raise

helpful link

@manuvakery1 manuvakery1 changed the title gnicchi upgrade fails when using s3 driver for aggregate storage if bucket is present gnocchi upgrade fails when using s3 driver for aggregate storage if bucket is present Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants