You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to authenticate to S3 with a web identity token file, as created by the AWS pod identity webhook.
The following snipped reproduces the issue:
imports3fsfs=s3fs.S3FileSystem()
fs.ls("foo") # Fails with `AttributeError`
This is the traceback of the error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.12/site-packages/fsspec/asyn.py", line 118, in wrapper
return sync(self.loop, func, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/fsspec/asyn.py", line 103, in sync
raise return_result
File "/usr/local/lib/python3.12/site-packages/fsspec/asyn.py", line 56, in _runner
result[0] = await coro
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/s3fs/core.py", line 1023, in _ls
files = await self._lsdir(path, refresh, versions=versions)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/s3fs/core.py", line 744, in _lsdir
async for c in self._iterdir(
File "/usr/local/lib/python3.12/site-packages/s3fs/core.py", line 775, in _iterdir
await self.set_session()
File "/usr/local/lib/python3.12/site-packages/s3fs/core.py", line 507, in set_session
self.key = credentials.access_key
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/botocore/credentials.py", line 409, in access_key
self._refresh()
File "/usr/local/lib/python3.12/site-packages/botocore/credentials.py", line 502, in _refresh
self._protected_refresh(is_mandatory=is_mandatory_refresh)
File "/usr/local/lib/python3.12/site-packages/botocore/credentials.py", line 518, in _protected_refresh
metadata = self._refresh_using()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/botocore/credentials.py", line 665, in fetch_credentials
return self._get_cached_credentials()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/botocore/credentials.py", line 675, in _get_cached_credentials
response = self._get_credentials()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/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'
I had installed s3fs with just pip install s3fs, it resulted in these specific versions:
Using a plain botocore client seems to work (and also works without an AccessDenied error when using a bucket I have access to):
importbotocore.sessionsession=botocore.session.get_session()
client=session.create_client('s3')
client.list_objects_v2(Bucket="foo") # Fails with 'AccessDenied', as expected
The text was updated successfully, but these errors were encountered:
I am trying to authenticate to S3 with a web identity token file, as created by the AWS pod identity webhook.
The following snipped reproduces the issue:
This is the traceback of the error:
I had installed
s3fs
with justpip install s3fs
, it resulted in these specific versions:Using a plain
botocore
client seems to work (and also works without anAccessDenied
error when using a bucket I have access to):The text was updated successfully, but these errors were encountered: