aio-libs / aiobotocore

asyncio support for botocore library using aiohttp

Home Page:https://aiobotocore.rtfd.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SSO Token refresh bug - 'ClientCreatorContext' object has no attribute 'create_token'

terricain opened this issue · comments

Describe the bug

It seems theres some oddness when refreshing tokens obtained via the AWS SSO mechanism.

2023-07-19 13:42:58,416 :: INFO :: Loading cached SSO token for profilename
2023-07-19 13:42:58,416 :: WARNING :: Refreshing token failed during the mandatory refresh period.
Traceback (most recent call last):
  File "/home/a/.local/lib/python3.10/site-packages/aiobotocore/tokens.py", line 65, in _protected_refresh
    self._frozen_token = await self._refresh_using()
  File "/home/a/.local/lib/python3.10/site-packages/aiobotocore/tokens.py", line 142, in _refresher
    new_token_dict = await self._refresh_access_token(token_dict)
  File "/home/a/.local/lib/python3.10/site-packages/aiobotocore/tokens.py", line 127, in _refresh_access_token
    return await self._attempt_create_token(token)
  File "/home/a/.local/lib/python3.10/site-packages/aiobotocore/tokens.py", line 86, in _attempt_create_token
    response = await self._client.create_token(
AttributeError: 'ClientCreatorContext' object has no attribute 'create_token'
2023-07-19 13:42:58,584 :: WARNING :: Refreshing temporary credentials failed during mandatory refresh period.

I've not yet reproduced it myself, I'm waiting for some tokens to invalidate themselves then I'll see If i can fix it.

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
  • I have tried the same code in botocore to ensure this is an aiobotocore specific issue
  • I have tried similar code in aiohttp to ensure this is is an aiobotocore specific issue
  • I have checked the latest and older versions of aiobotocore/aiohttp/python to see if this is a regression / injection
**pip freeze results**
aioboto3==11.2.0
aiobotocore==2.5.0
aiohttp==3.8.4
aioitertools==0.11.0
aiosignal==1.3.1
boto3==1.26.76
botocore==1.29.76

Environment:

  • Python Version: 3.10
  • OS name and version: macOS Ventura

Additional context
Add any other context about the problem here.

Looks like #1008 is related/probably solves this

Looks like #1008 is related/probably solves this

ok cool will try to make a new PR that expands that one to fix the other issues as well

If you've not beaten me to it by the morning, and I'm in a position to reproduce the SSO bit, I'll spin up a branch incorporating the changes and suggestions from #1008

cool thanks, today for me is remote (far) work day and trash day, see how much I can do :)