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

aiobotocore does not work with only IMDSv1 #1055

Open
3 tasks
Strunevskiy opened this issue Nov 15, 2023 · 2 comments
Open
3 tasks

aiobotocore does not work with only IMDSv1 #1055

Strunevskiy opened this issue Nov 15, 2023 · 2 comments

Comments

@Strunevskiy
Copy link

Strunevskiy commented Nov 15, 2023

Describe the bug
When I try to get any access to AWS service on EC2 with only IMDSv1, aiobotocore fails to get credentials. botocore usually fails back to IMDSv1 when IMDSv2 is not available, but aiobotocore throws the error.

Checklist

  • I have reproduced in environment where pip check passes without errors
  • I have provided pip freeze results
  • I have provided sample code or detailed way to reproduce
  • [YES] I have tried the same code in botocore to ensure this is an aiobotocore specific issue
  • [YES] I have tried similar code in aiohttp to ensure this is is an aiobotocore specific issue
  • [YES] I have checked the latest and older versions of aiobotocore/aiohttp/python to see if this is a regression / injection

pip freeze results

Environment:

  • Python Version: [e.g. 3.6]
  • OS name and version: [e.g. darwin stretch]

Additional context
I believe it happens because botocore and aiobotocore use different underlying HTTP clients which behave differently when getting 405

It looks like it is failing here instead of returning None.
https://github.com/aio-libs/aiobotocore/blob/master/aiobotocore/utils.py#L118

As a result, it is failing here
https://github.com/aio-libs/aiobotocore/blob/master/aiobotocore/utils.py#L210

@thehesiod
Copy link
Collaborator

i think there's a way to force an authentication mechanism, is there any way to make a testcase? Ideally either via moto or a cloudformation script to bring up an env to test with. THanks!

@Strunevskiy
Copy link
Author

i think there's a way to force an authentication mechanism, is there any way to make a testcase? Ideally either via moto or a cloudformation script to bring up an env to test with. THanks!

Where do you have this mechanism to force an authentication?
My credentials sits in IMDSv1 when I try to access S3 a request fails.

I will try to create cloudformation for this test case.

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