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

[BUG] AttributeError: 'ClientCreatorContext' object has no attribute 'assume_role_with_web_identity' #1444

Closed
DanielTsiang opened this issue Dec 5, 2023 · 2 comments

Comments

@DanielTsiang
Copy link
Contributor

AttributeError: 'ClientCreatorContext' object has no attribute 'assume_role_with_web_identity'

Problem

Using the current latest versions of fsspec and s3fs i.e. 2023.12.0, when I tried to get a file via:

 fs.get_file()

I got this error:

  File "main.py", line 75, in get_document
    fs.get_file(document_path, video_path)
  File "/usr/local/lib/python3.11/site-packages/fsspec/asyn.py", line 118, in wrapper
    return sync(self.loop, func, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fsspec/asyn.py", line 103, in sync
    raise return_result
  File "/usr/local/lib/python3.11/site-packages/fsspec/asyn.py", line 56, in _runner
    result[0] = await coro
                ^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/s3fs/core.py", line 1262, in _get_file
    body, content_length = await _open_file(range=0)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/s3fs/core.py", line 1253, in _open_file
    resp = await self._call_s3(
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/s3fs/core.py", line 355, in _call_s3
    await self.set_session()
  File "/usr/local/lib/python3.11/site-packages/s3fs/core.py", line 507, in set_session
    self.key = credentials.access_key
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/credentials.py", line 409, in access_key
    self._refresh()
  File "/usr/local/lib/python3.11/site-packages/botocore/credentials.py", line 502, in _refresh
    self._protected_refresh(is_mandatory=is_mandatory_refresh)
  File "/usr/local/lib/python3.11/site-packages/botocore/credentials.py", line 518, in _protected_refresh
    metadata = self._refresh_using()
               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/credentials.py", line 665, in fetch_credentials
    return self._get_cached_credentials()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/credentials.py", line 675, in _get_cached_credentials
    response = self._get_credentials()
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/credentials.py", line 909, in _get_credentials
    return client.assume_role_with_web_identity(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ClientCreatorContext' object has no attribute 'assume_role_with_web_identity'

This same code was working before on version 2023.10.0 of fsspec and s3fs.

@martindurant
Copy link
Member

This is being tracked at s3fs - expect a fix and release in the next ~day

@DanielTsiang
Copy link
Contributor Author

Thanks Martin, I can see fsspec/s3fs#833 has been closed as completed 🎉

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

2 participants