-
Notifications
You must be signed in to change notification settings - Fork 274
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
S3 error : Unable to locate credentials #558
Comments
lease cross-post to aiobotocor and/or botocore - they might be aware of this. |
PS: worth trying whether using boto directly works, or causes the same exception. |
I stumbled into this issue while using S3 for a dvc remote storage. I isolated the failure to Btw. A very similar problem is described in iterative/dvc#6899 - and fixed in upstream?!
|
The linked issue seems to be around azure-blob, not s3 - are you sure it is similar? If yes, please tag a couple of the people there to see if they can help. Note that aiohttp is now at 3.8.1; can you generate a set of versions which do/do not work? |
Hey @martindurant Re DVC issue: I noticed that. It is similar from an "end-user" perspective, using DVC and s3fs and getting the same error. I've added the word "surprisingly", I can't say whether this is a red herring. Re version comparison: The setup I'm debugging is a bit more complex, so I will boil it down over the next day or two. Here a diff between the two quite convoluted conda environments:
The passing environment contains the The failing test produced this traceback:
|
If you pip install s3fs does it works? (#553 (comment) and #554 (comment) for reference) |
I had problems with the pip installation as well - but (both pip and conda) it worked when having only the minimal environment definition with the latest versions of all packages - but stopped working for a richer (more realistic) environment (both pip and conda). So, that's why I intend to try to provide an environment definition soon... just having not enough time at hand, sorry. |
A minimal conda environment to reproduce the error. NB dvc and the version numbers seem to be critical.
The difference between pass and fail are:
The environment lists are attached: |
A week ago I had problems with a pip installed s3fs. I can't reproduce the error with a minimal pip requirements file similar to the conda environment. The platform is ubuntu 20.04 with python3.9 (installed with conda). this is the requirements file:
|
fails as well |
So only ever in conjunction with dvc? |
@martindurant - yes for me. @jmleoni any insight in this? I believe it is due to a weird and unfortunate combination of libraries and their versions, so I try to help with reporting... |
We are trying to reproduce the issue in isolation, from our application with no luck so far. |
Hello, By plugging a debugger to the python running on batch EC2 we've discovered that the error does not appear when the code has been halted by breakpoints, due to this we suspect there might be a race condition when AioCredentialsResolver#load_credentials() is called (see screenshot). |
Thanks for the investigation and interesting finding. I'm not certain what to do about it. It is it a timing thing indeed, it suggests we can merely retry on credentials error, or explicitly wait for the credentials provider above to complete, before attempting anything else. |
@jmleoni any idea if this is fixed with the latest s3fs? |
Indeed To reproduce in my case: Then: import s3fs
fs = s3fs.S3FileSystem()
fs.ls('my-bucket') |
Hey @garibarba - thanks for reproducing. I ran the same commands with python3.8, python3.9 and python3.10 - and "it works for me" without
and then executing the commands - replacing
Result: I get the bucket listing as expected. I repeated the setup from #558 (comment) and it works as well. - I am not convinced whether the diff is really helpful, but here it is.
My next step: I will wait for the December s3fs release and test it in the full data-science tool chain. Thanks |
@achimgaedke interesting. In my case there is a chance of some non-standard network configuration. I believe my access to S3 is through a VPC endpoint, but there might be other specific configs. I've seen some relatable 3.8.0 issues such as aio-libs/aiohttp#6227 or aio-libs/aiohttp#6239 but I cannot put my finger on it. |
Doesn't work with the more complex setup... so still something wrong. |
Since we are likely to bump the req, can you try with aiiohttp>4? |
I've tried
but deleting line 93 of |
Having such a retry option (and even maybe putting it at like 5 retry by default) would be really appreciated. I just hit an intermittent such auth issue and it's a bit ugly of having to handle that in user code |
There has been some more work on this bug. PR aio-libs/aiobotocore#934 looks promising. Consider upgrading requirements to |
@achimgaedke , would you like to make a PR with that change, when available? |
* aiobotocore to 2.3.0 closes #558 * use conda-forge's aiobotocore 2.3 for CI pipeline
@achimgaedke I didn't take the opportunity yet, but many thanks to you for fixing on this issue, you are a life saver ! |
I waited for almost half a year for someone else to dig it up. Took me 4 hours, 30 min to fix and then another x hours over 3 weeks to push it through the software supply chain... now conda-forge is the last one missing... Thanks for thanking, @jmleoni . |
Hello,
since asynciohttp v3.8.1 was deployed on condaforge 3 days ago while trying to use s3fs with iamRole based credentials in AWS EC2 servers, we are encountering the following errors :
It seems that fixing aiohttp in version v3.7.4.post0 solves this issue.
Not also that we are not encountering the same errors on the same codebase on tasks that are running on Fargate instead of EC2.
I guess it would be good to investigate what happened with aiohttp (which is required by aiobotocore)
Any better solution than fixing aiohttp version is welcome !
The text was updated successfully, but these errors were encountered: