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'm trying to access files in a MinIO bucket using s3fs. The code works with boto3 locally and also with s3fs when using a docker-compose setup. However, when I try to run s3fs locally, I get a FileNotFoundError.
s3fs/core.py", line 1294, in _info
raise FileNotFoundError(path)
FileNotFoundError: test-bucket/01_raw/companies.csv
Listing bucket items also doesn't work:
>>> for obj in s3.list_objects(Bucket=bucket_name)['Contents']:
... print(obj['Key'])
01_raw/companies.csv
>>> for file in fs.ls(bucket_name):
... print(file)
What's interesting here is that when both my s3fs process and minio run in a docker-compose setup, then it works fine.
At the moment, I want to only run minio in a container and s3fs on my MacOS (have also reproduced on Ubuntu). It works fine with boto3, but s3fs leaves me hanging, as illustrated above.
I've also compared s3fs versions inside and outside of my container:
@martindurant Thanks a lot for your fast feedback! I don't have .boto/.aws directories inside or outside the container and also env vars seem clean, but I did make an interesting discovery: As soon as I pip install boto3 within the container, also there my s3fs method stops working. Any idea how this might be happening?
Ah, so this is a problem with pip. s3fs has a hard pin on a specific version of aiobotocore, which in turn pins botocore. Apparently, your installing boto3 afterwards is breaking that pin, and things stop working. You can fix this by forcing the versions you need, perhaps in a requiremements.txt . I don't think there's anything we can do about it from this end. Note that conda installs do not suffer from this problem.
Friends, cross-posting from https://stackoverflow.com/questions/75913127/using-s3fs-with-minio-filenotfounderror-when-running-s3fs-locally-but-works-wi , hope this is acceptable:
I'm trying to access files in a MinIO bucket using
s3fs
. The code works withboto3
locally and also withs3fs
when using adocker-compose
setup. However, when I try to runs3fs
locally, I get aFileNotFoundError
.Here's the working code using
boto3
:Here's the non-working code using
s3fs
:This throws the following error:
Listing bucket items also doesn't work:
What's interesting here is that when both my
s3fs
process andminio
run in adocker-compose
setup, then it works fine.At the moment, I want to only run
minio
in a container ands3fs
on my MacOS (have also reproduced on Ubuntu). It works fine withboto3
, buts3fs
leaves me hanging, as illustrated above.I've also compared
s3fs
versions inside and outside of my container:Any ideas for how to fix would be greatly appreciated. :)
The text was updated successfully, but these errors were encountered: