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

Enable to pass storage region outside of create-s3 #768

Open
falexwolf opened this issue May 21, 2024 · 4 comments
Open

Enable to pass storage region outside of create-s3 #768

falexwolf opened this issue May 21, 2024 · 4 comments

Comments

@falexwolf
Copy link
Member

We also need to be able to pass a storage region outside the storage param because otherwise during init_storage_hub we'll try to infer it while not yet having access:

"region": ssettings.region,

I'll make a PR that adds this ability.

@Koncopd
Copy link
Member

Koncopd commented May 21, 2024

I am not sure what do you mean here. Do we want to force passing the region on storage init? I think we need to make sure that the region is resolved even without access rights instead of forcing manual passing. https://github.com/fsspec/s3fs/blob/a28863f084a91ee78d9cd65bd6767b2f44e81b33/s3fs/utils.py#L40
This is how it is done in s3fs, it should be able to retrieve region even when the access is denied because error response also carries the region if i understand corretly.

@falexwolf
Copy link
Member Author

I mean that we get a "HeadBucket operation: Forbidden" error because it's calling the below before the storage row is in the hub and access-aws can be called:

response = s3_client.head_bucket(Bucket=bucket)

If we can get region without calling head_bucket: great!

@Koncopd
Copy link
Member

Koncopd commented May 21, 2024

We still call the bucket and but we check the error header in the response and it should contain the region (see the code in s3fs above), i can add this to get_storage_region tmr.

@falexwolf
Copy link
Member Author

That'd be a very elegant solution! Anytime this or early next week is fine! We worked around this issue where needed it so far and it's nothing that a user will face.

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