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

Remove _register_lazy_block_unknown_fips_pseudo_regions #905

Closed
hayashier opened this issue Nov 27, 2021 · 5 comments
Closed

Remove _register_lazy_block_unknown_fips_pseudo_regions #905

hayashier opened this issue Nov 27, 2021 · 5 comments

Comments

@hayashier
Copy link

hayashier commented Nov 27, 2021

Sorry for opening the same issue(#900) again because I couldn't reopen that issue(only repo owner or collaborator can reopen as far as I know).

I investigated this issue and found this issue is caused by this change(boto/botocore#2558) in botocore 1.23.0.

aiobotocore 2.0.1 is tied to botocore 1.22.8. So in order to resolve this issue, I confirmed aiobotocore should bump to botocore 1.23.0 or later(For example, 1.23.14)
https://github.com/aio-libs/aiobotocore/blob/2.0.1/setup.py#L10

'botocore>=1.22.8,<1.22.9',

So I opened the issue(#904) which requests to bump to botocore 1.23.0 or later.

Thanks,

@hayashier
Copy link
Author

hayashier commented Nov 27, 2021

Details

The caller of aiobotocore is at the following location.
https://github.com/aio-libs/aiobotocore/blob/master/aiobotocore/client.py#L46

self._register_lazy_block_unknown_fips_pseudo_regions(service_client)

This corresponds to the following function in the parent class botocore.
https://github.com/boto/botocore/blob/1.22.8/botocore/client.py#L102

self._register_lazy_block_unknown_fips_pseudo_regions(service_client)

In botocore 1.23.0 and later, the above line has been removed and the following line has been added in its place.
This corresponds to the following function in the parent class botocore.
https://github.com/boto/botocore/blob/1.23.0/botocore/client.py

region_name, client_config = self._normalize_fips_region(
    region_name, client_config)

So I confirmed this issue was resolved by patching the following diff. Actually, according to the Contributing policy, it seems that aiobotocore needs to be updated entirely to match the version of botocore.

diff --git a/aiobotocore/client.py b/aiobotocore/client.py
index 5dee865..13cf364 100644
--- a/aiobotocore/client.py
+++ b/aiobotocore/client.py
@@ -28,6 +28,8 @@ class AioClientCreator(ClientCreator):
         service_name = first_non_none_response(responses, default=service_name)
         service_model = self._load_service_model(service_name, api_version)
         cls = await self._create_client_class(service_name, service_model)
+        region_name, client_config = self._normalize_fips_region(
+            region_name, client_config)
         endpoint_bridge = ClientEndpointBridge(
             self._endpoint_resolver, scoped_config, client_config,
             service_signing_name=service_model.metadata.get('signingName'))
@@ -42,7 +44,6 @@ class AioClientCreator(ClientCreator):
         self._register_endpoint_discovery(
             service_client, endpoint_url, client_config
         )
-        self._register_lazy_block_unknown_fips_pseudo_regions(service_client)
         return service_client
 
     async def _create_client_class(self, service_name, service_model):
diff --git a/setup.py b/setup.py
index 9d8d0c3..c69296a 100644
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@ from setuptools import setup, find_packages
 # NOTE: When updating botocore make sure to update awscli/boto3 versions below
 install_requires = [
     # pegged to also match items in `extras_require`
-    'botocore>=1.22.8,<1.22.9',
+    'botocore>=1.23.13,<1.23.14',
     'aiohttp>=3.3.1',
     'wrapt>=1.10.10',
     'aioitertools>=0.5.1',
@@ -19,8 +19,8 @@ def read(f):
 
 
 extras_require = {
-    'awscli': ['awscli>=1.21.8,<1.21.9'],
-    'boto3': ['boto3>=1.19.8,<1.19.9'],
+    'awscli': ['awscli>=1.22.13,<1.22.14'],
+    'boto3': ['boto3>=1.20.13,<1.20.14'],
 }  

@thehesiod
Copy link
Collaborator

this is not an issue of removing this method, it's about ensuring the version of botocore matches the version required by aiobotocore per the req in setup.py. This is covered by #904 . The patch needs to batch all methods that are overridden per: https://github.com/aio-libs/aiobotocore/blob/master/CONTRIBUTING.rst#how-to-upgrade-botocore. closing this as it's much more involved than the diff mentioned above and is covered by #904

archlinux-github pushed a commit to archlinux/svntogit-community that referenced this issue Dec 8, 2021
Ref: aio-libs/aiobotocore#905 (comment)

git-svn-id: file:///srv/repos/svn-community/svn@1065594 9fca08f4-af9d-4005-b8df-a31f2cc04f65
archlinux-github pushed a commit to archlinux/svntogit-community that referenced this issue Dec 8, 2021
Ref: aio-libs/aiobotocore#905 (comment)


git-svn-id: file:///srv/repos/svn-community/svn@1065594 9fca08f4-af9d-4005-b8df-a31f2cc04f65
@hayashier
Copy link
Author

hayashier commented Dec 15, 2021

@thehesiod

I confirmed this error was resolved with aiobotocore 2.1.0. Thank you very much!

@mailjunze
Copy link

mailjunze commented Jan 5, 2022

@hayashier
I am still getting the same error.
AttributeError: 'AioClientCreator' object has no attribute '_register_lazy_block_unknown_fips_pseudo_regions'
bash-4.2$ pip list | grep boto*
aiobotocore 2.1.0
botocore 1.23.24

May I know which boto* and aio* versions are you using ?

@thehesiod
Copy link
Collaborator

can you please post callstack?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants