gimme-aws-creds fails on StopIteration exception

Viewed 429

Summary:

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

Description:

When running gimme-aws-creds with the below .okta_aws_login_config configuration file the application crashes with the following exception:

Trace:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/gimme-aws-creds/2.4.3_2/libexec/lib/python3.10/site-packages/gimme_aws_creds/main.py", line 773, in iter_selected_aws_credentials
    for role in self.aws_selected_roles:
  File "/opt/homebrew/Cellar/gimme-aws-creds/2.4.3_2/libexec/lib/python3.10/site-packages/gimme_aws_creds/main.py", line 672, 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.3_2/libexec/lib/python3.10/site-packages/gimme_aws_creds/main.py", line 662, in aws_roles
    self._cache['aws_roles'] = roles = self.resolver._enumerate_saml_roles(
  File "/opt/homebrew/Cellar/gimme-aws-creds/2.4.3_2/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 <module>
    GimmeAWSCreds().run()
  File "/opt/homebrew/Cellar/gimme-aws-creds/2.4.3_2/libexec/lib/python3.10/site-packages/gimme_aws_creds/main.py", line 469, in run
    self._run()
  File "/opt/homebrew/Cellar/gimme-aws-creds/2.4.3_2/libexec/lib/python3.10/site-packages/gimme_aws_creds/main.py", line 802, in _run
    for data in self.iter_selected_aws_credentials():
RuntimeError: generator raised StopIteration

Config:

[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 = user@example.com
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

I am using the following versions:

  • gimme-aws-creds 2.4.3
  • Python 3.8.10
  • MacBook Pro M1, 12.1 (21C52)
0 Answers
Related