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

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

Closed
6 tasks
terricain opened this issue Jul 19, 2023 · 4 comments · Fixed by #1030
Closed
6 tasks
Assignees

Comments

@terricain
Copy link
Collaborator

terricain commented Jul 19, 2023

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.

@terricain terricain self-assigned this Jul 19, 2023
@terricain
Copy link
Collaborator Author

Looks like #1008 is related/probably solves this

@thehesiod
Copy link
Collaborator

thehesiod commented Jul 19, 2023

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

@terricain
Copy link
Collaborator Author

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

@thehesiod
Copy link
Collaborator

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

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

Successfully merging a pull request may close this issue.

2 participants