By using AWS re:Post, you agree to the Terms of Use

SageMaker Issue: AttributeError: 'AioClientCreator' object has no attribute '_register_lazy_block_unknown_fips_pseudo_regions'

0

Hi, there

When training model using sagemaker and calling panda.read_csv().. we are getting the above error. It appears that this is a known issue and the workaround is to upgrade aiobotocore to the latest 2.20 release. However, the missing link is where to upgrade the aiobotocore .. since we are running model against SageMaker and its fully managed M5 instance... instead of an EC2 instance. Any thoughts?

Error message in full: /opt/conda/lib/python3.7/site-packages/aiobotocore/client.py in create_client(self, service_name, region_name, is_secure, endpoint_url, verify, credentials, scoped_config, api_version, client_config) 43 service_client, endpoint_url, client_config 44 ) ---> 45 self._register_lazy_block_unknown_fips_pseudo_regions(service_client) 46 return service_client 47

AttributeError: 'AioClientCreator' object has no attribute '_register_lazy_block_unknown_fips_pseudo_regions'

See notes below under this link: https://github.com/boto/botocore/pull/2558/files#

  • It appears this issue is to do with s3sf aiobotocore needs to be upgrade to be compatible with the botocore version. I would image that AWS would already have a workaround since this is abase lib?

3 Answers
0

Hello, Thank you for contacting us.

I understand that you encountered an AttributeError code and you are looking for where to upgrade the aiobotocore.
=== Error message === Error: AttributeError: 'AioClientCreator' object has no attribute '_register_lazy_block_unknown_fips_pseudo_regions'

As you know, Attribute errors in Python are generally raised when an invalid attribute reference is made. It would seem to me that the issue is caused by a change in dependency library here : https://github.com/boto/botocore/issues/2568

if the aiobotocore latest 2.20 release did not work, other option is to downgrade its version that is working properly. I did some test around both Studio domains and notebooks . The default Kernal that spins up currently for me had the issue replicable and had these versions of the library installed : aiobotocore 2.0.1 boto 2.49.0 boto3 1.20.23 botocore 1.23.23

To make the code work, I downgraded the aiobotocore version. The "1.3.0" version worked for me : pip install aiobotocore==1.3.0. I was able to make it with keeping the existing botocode version the same. Would you please try this? === Test steps ====

import pandas df = pandas.read_csv("s3://testdata/Sales/year='2010'/month='feb'/day='2'/IOS.csv") .... AttributeError: 'AioClientCreator' object has no attribute '_register_lazy_block_unknown_fips_pseudo_regions' pip list | grep boto* aiobotocore 2.0.1 boto 2.49.0 boto3 1.20.23 botocore 1.23.23 pip install aiobotocore==1.3.0 ... Succeeded pip list | grep boto* aiobotocore 1.3.0 boto 2.49.0 boto3 1.20.23 botocore 1.20.49 import pandas df = pandas.read_csv("s3://testdata/Sales/year='2010'/month='feb'/day='2'/IOS.csv") ... No error

If that still does not work, would you please cut a support case with your script? Due to security reason, this post is not suitable for sharing customer's resource.

Thank you.

answered 6 months ago
0

Thanks for the feedback. We opened a support ticket and was able to identify a workaround. Thank you. We were told that SageMaker team is aware of this issue and is working on a fix.

answered 6 months ago
0

While trying pip install aiobotocore==1.3.0, I ve got:

/opt/conda/lib/python3.7/site-packages/secretstorage/dhcrypto.py:16: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes
/opt/conda/lib/python3.7/site-packages/secretstorage/util.py:25: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes
Collecting aiobotocore==1.3.0
  Using cached aiobotocore-1.3.0.tar.gz (48 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "<string>", line 36, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-t0w2jms3/aiobotocore_f1bc89a0a84449de976bab0e94ab3cb8/setup.py", line 68, in <module>
          include_package_data=True
        File "/opt/conda/lib/python3.7/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "/opt/conda/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 109, in setup
          _setup_distribution = dist = klass(attrs)
        File "/opt/conda/lib/python3.7/site-packages/setuptools/dist.py", line 466, in __init__
          for k, v in attrs.items()
        File "/opt/conda/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 293, in __init__
          self.finalize_options()
        File "/opt/conda/lib/python3.7/site-packages/setuptools/dist.py", line 885, in finalize_options
          for ep in sorted(loaded, key=by_order):
        File "/opt/conda/lib/python3.7/site-packages/setuptools/dist.py", line 884, in <lambda>
          loaded = map(lambda e: e.load(), filtered)
        File "/opt/conda/lib/python3.7/site-packages/setuptools/_vendor/importlib_metadata/__init__.py", line 196, in load
          return functools.reduce(getattr, attrs, module)
      AttributeError: type object 'Distribution' has no attribute '_finalize_feature_opts'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Note: you may need to restart the kernel to use updated packages.
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions