Comments (6)
All right sounds good. Do you want to make a PR or do you want me to do it? I probably will have time for this on Friday/the weekend at the earliest.
from s3fs.
After debugging a little bit I've found the issue, I don't know how this worked ever with our code?
Int this code line s3fs creates a new credential resolver:
Line 497 in cc6663f
Which is exactly the same as:
https://github.com/aio-libs/aiobotocore/blob/ab08687fdedd5407ab53315716c097543957c684/aiobotocore/session.py#L49
Which gets set in the session here:
https://github.com/boto/botocore/blob/4b728545d43ff70287ae1d0dce42e995790e6b85/botocore/session.py#L186
Which then can be used with get_credentials
:
https://github.com/aio-libs/aiobotocore/blob/ab08687fdedd5407ab53315716c097543957c684/aiobotocore/session.py#L76
So basically If s3fs would replace these lines:
Lines 497 to 500 in cc6663f
with
await self.session.get_credentials()
everything would be the same, except that we can insert our own credentials providers.
@BENR0 Is there a specific reason that s3fs creates its own credentials_resolver here? While it is the exact same that gets registered on the aiobotocore session.
from s3fs.
No there is not. My experience with (aio)botocore is very limited and how this is implemented is purely based on what I "puzzled" together. I am very curious why you get the error because the credential_resolver
gets created with your session so should basically do the same? But it seems that I am missing something. Apart from that obviously there is a unit test missing for that case.
That said from a first glimpse it seems like your proposed solution could work. Did you have a chance to test if that solves your problem?
from s3fs.
No there is not. My experience with (aio)botocore is very limited and how this is implemented is purely based on what I "puzzled" together. I am very curious why you get the error because the
credential_resolver
gets created with your session so should basically do the same? But it seems that I am missing something. Apart from that obviously there is a unit test missing for that case.
I also don't have much experience with (aio)botocore, but this is what I found out after debugging this issue.
Basically, we add the credential provider to the credential resolver instance that is registered in the AioSession. What you do in your code is creating a completely new instance of a credential resolver which is seemingly "connected" (as in, it has the session as a parameter when creating) to the session, but not "registered" as a "component" in the session (as in, it is added to the component list of the session).
That's what's happening in these lines of code:
- It first creates the credential resolver in the same way you've created it here:
https://github.com/boto/botocore/blob/5a02e644c0bc86dd9bac6227154cc765dabf85a9/botocore/session.py#L191-L194 - And then registers it lazily in the session:
https://github.com/boto/botocore/blob/5a02e644c0bc86dd9bac6227154cc765dabf85a9/botocore/session.py#L186-L189
So creating a new credential provider instance seems to be not needed, as it is already registered as a component in the session.
And we only have access to the credential provider that is registered in the session, without patching the s3fs code directly.
That said from a first glimpse it seems like your proposed solution could work. Did you have a chance to test if that solves your problem?
Yes it solved my problem, I also found an issue in my Credential Provider implementation, but after that with my proposed solution works.
from s3fs.
All right sounds good. Do you want to make a PR or do you want me to do it? I probably will have time for this on Friday/the weekend at the earliest.
I'll give creating the PR a shot. Thanks!
EDIT: nvm it seems like your PR got reverted yesterday :/ so it's now working again
from s3fs.
Closing since it's reverted
from s3fs.
Related Issues (20)
- Inconsistent recursive `put` behavior when running an identical command twice successively HOT 1
- open_async file is closed on arrival HOT 1
- set_session does not seem to be thread / jobs safe HOT 4
- Random XAmzContentSHA256Mismatch Errors HOT 6
- Access denied when providing an authentication token associated with a set of permission policies to S3FileSystem HOT 3
- calling flush on s3fs fails HOT 2
- s3fs 2024.3.0 fails reading glob patterns through pandas HOT 12
- Question: is awscrt useful ? HOT 2
- Errors when installing s3fs on Sagemaker Studio HOT 1
- Why isn't Pathlib supported yet? HOT 1
- Working example of using Async/Await HOT 7
- Custom s3 compatible https endpoint not working, port forwarded to localhost works HOT 9
- How to Increase async httpconnection limit? HOT 7
- Does aioboto3 Support Authentication with EC2 IAM Roles? HOT 3
- upload function didn't recognize the file path having "[]". HOT 4
- How to upload a list of files from local fs to cloud s3 fs async? HOT 3
- Writing metadata with underscores fail silently HOT 1
- s3fs.exists incorrectly returns False after calling glob
- fsspec.generic.rsync(<s3_path>, <s3_path>) raises FileNotFoundError HOT 7
- When requesting the wrong version of an existing file, the `FileNotFoundError` could be more informative. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from s3fs.