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

gimme-aws-creds fails with StopIteration exception #359

Open
elcapitan-abdul opened this issue Jul 27, 2022 · 3 comments
Open

gimme-aws-creds fails with StopIteration exception #359

elcapitan-abdul opened this issue Jul 27, 2022 · 3 comments

Comments

@elcapitan-abdul
Copy link

Expected Behavior

  1. execute gimme-aws-creds
  2. Using password from keyring for [email protected]
  3. Pick a factor:
    [0] Okta Verify App: SmartPhone_Android: SM-S123U4
    [1] token:software:totp( OKTA ) : [email protected]
  4. Selection: 0
    Okta Verify push sent...
  5. List of AWS Accounts to select from.

Current Behavior

when i execute gimme-aws-creds it crashes with StopIteration exception when trying to login to aws from CLI.

`Traceback (most recent call last):
File "/opt/homebrew/Cellar/gimme-aws-creds/2.4.4/libexec/lib/python3.10/site-packages/gimme_aws_creds/main.py", line 787, in iter_selected_aws_credentials
for role in self.aws_selected_roles:
File "/opt/homebrew/Cellar/gimme-aws-creds/2.4.4/libexec/lib/python3.10/site-packages/gimme_aws_creds/main.py", line 670, in aws_selected_roles
selected_roles = self._get_selected_roles(self.requested_roles, self.aws_roles)
File "/opt/homebrew/Cellar/gimme-aws-creds/2.4.4/libexec/lib/python3.10/site-packages/gimme_aws_creds/main.py", line 660, in aws_roles
self._cache['aws_roles'] = roles = self.resolver._enumerate_saml_roles(
File "/opt/homebrew/Cellar/gimme-aws-creds/2.4.4/libexec/lib/python3.10/site-packages/gimme_aws_creds/aws.py", line 94, in _enumerate_saml_roles
role = next(iter(table))
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/homebrew/bin/gimme-aws-creds", line 17, in
GimmeAWSCreds().run()
File "/opt/homebrew/Cellar/gimme-aws-creds/2.4.4/libexec/lib/python3.10/site-packages/gimme_aws_creds/main.py", line 467, in run
self._run()
File "/opt/homebrew/Cellar/gimme-aws-creds/2.4.4/libexec/lib/python3.10/site-packages/gimme_aws_creds/main.py", line 816, in _run
for data in self.iter_selected_aws_credentials():
RuntimeError: generator raised StopIteration`

Steps to Reproduce (for bugs)

  1. brew install gimme-aws-creds

  2. run gimme-aws-creds --action-configuration. >> .okta_aws_login_config file
    [DEFAULT] okta_org_url = https://some-org.okta.com okta_auth_server = client_id = gimme_creds_server = appurl aws_appname = aws_rolename = write_aws_creds = True cred_profile = default okta_username = [email protected] app_url = https://some-org.okta.com/home/amazon_aws_sso/... resolve_aws_alias = True preferred_mfa_type = token:software:totp remember_device = aws_default_duration = 28800 device_token = output_format = json

  3. execute gimme-aws-creds

  4. Using password from keyring for [email protected]

  5. Pick a factor:
    [0] Okta Verify App: SmartPhone_Android: SM-S123U4
    [1] token:software:totp( OKTA ) : [email protected]

  6. Selection: 0
    Okta Verify push sent... to mobile phone

  7. accept on okta verify app on mobile phone

  8. `Traceback (most recent call last):
    File "/opt/homebrew/Cellar/gimme-aws-creds/2.4.4/libexec/lib/python3.10/site-packages/gimme_aws_creds/main.py", line 787, in iter_selected_aws_credentials
    for role in self.aws_selected_roles:
    File "/opt/homebrew/Cellar/gimme-aws-creds/2.4.4/libexec/lib/python3.10/site-packages/gimme_aws_creds/main.py", line 670, in aws_selected_roles
    selected_roles = self._get_selected_roles(self.requested_roles, self.aws_roles)
    File "/opt/homebrew/Cellar/gimme-aws-creds/2.4.4/libexec/lib/python3.10/site-packages/gimme_aws_creds/main.py", line 660, in aws_roles
    self._cache['aws_roles'] = roles = self.resolver._enumerate_saml_roles(
    File "/opt/homebrew/Cellar/gimme-aws-creds/2.4.4/libexec/lib/python3.10/site-packages/gimme_aws_creds/aws.py", line 94, in _enumerate_saml_roles
    role = next(iter(table))
    StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/homebrew/bin/gimme-aws-creds", line 17, in
GimmeAWSCreds().run()
File "/opt/homebrew/Cellar/gimme-aws-creds/2.4.4/libexec/lib/python3.10/site-packages/gimme_aws_creds/main.py", line 467, in run
self._run()
File "/opt/homebrew/Cellar/gimme-aws-creds/2.4.4/libexec/lib/python3.10/site-packages/gimme_aws_creds/main.py", line 816, in _run
for data in self.iter_selected_aws_credentials():
RuntimeError: generator raised StopIteration`

Your Environment

  • gimme-aws-creds 2.4.4
  • python 3.10.5
  • MacBook Pro 16(2021), Chip Apple M1 Pro,
  • macOS Monterey Version: 12.4
@KamilBlaz
Copy link

Any news here?

@elcapitan-abdul
Copy link
Author

nope no response

@epierce
Copy link
Member

epierce commented May 24, 2024

Is this still an issue with the latest version? v2.4.4 was replaced 18 months ago

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

3 participants