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

As first time, running gimme-aws-creds returns a error #107

Closed
ogarciatn opened this issue Feb 8, 2019 · 5 comments
Closed

As first time, running gimme-aws-creds returns a error #107

ogarciatn opened this issue Feb 8, 2019 · 5 comments
Assignees
Labels

Comments

@ogarciatn
Copy link

ogarciatn commented Feb 8, 2019

After use the gimme-aws-creds as first time,

complete the verification with Okta:

Multi-factor Authentication required.
Okta Verify App: SmartPhone_Android: Moto E (4) Plus selected
Okta Verify push sent...
done

And pick a role:

Pick a role any role:
[0] arn:aws:iam::<ID>:role/<ROLE_NAME>
[1] arn:aws:iam::<ID>:role/<ROLE_NAME>
Selection: 1

returns this error:

  File "/usr/local/bin/gimme-aws-creds", line 17, in <module>
    GimmeAWSCreds().run()
  File "/usr/local/lib/python3.7/site-packages/gimme_aws_creds/main.py", line 453, in run
    aws_creds = self._get_sts_creds(aws_partition, saml_data['SAMLResponse'], role.idp, role.role, config.aws_default_duration)
  File "/usr/local/lib/python3.7/site-packages/gimme_aws_creds/main.py", line 135, in _get_sts_creds
    client = boto3.client('sts')
  File "/usr/local/lib/python3.7/site-packages/boto3/__init__.py", line 91, in client
    return _get_default_session().client(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/boto3/__init__.py", line 80, in _get_default_session
    setup_default_session()
  File "/usr/local/lib/python3.7/site-packages/boto3/__init__.py", line 34, in setup_default_session
    DEFAULT_SESSION = Session(**kwargs)
  File "/usr/local/lib/python3.7/site-packages/boto3/session.py", line 80, in __init__
    self._setup_loader()
  File "/usr/local/lib/python3.7/site-packages/boto3/session.py", line 120, in _setup_loader
    self._loader = self._session.get_component('data_loader')
  File "/usr/local/lib/python3.7/site-packages/botocore/session.py", line 679, in get_component
    return self._components.get_component(name)
  File "/usr/local/lib/python3.7/site-packages/botocore/session.py", line 902, in get_component
    self._components[name] = factory()
  File "/usr/local/lib/python3.7/site-packages/botocore/session.py", line 150, in <lambda>
    lambda:  create_loader(self.get_config_variable('data_path')))
  File "/usr/local/lib/python3.7/site-packages/botocore/session.py", line 233, in get_config_variable
    logical_name)
  File "/usr/local/lib/python3.7/site-packages/botocore/configprovider.py", line 226, in get_config_variable
    return provider.provide()
  File "/usr/local/lib/python3.7/site-packages/botocore/configprovider.py", line 323, in provide
    value = provider.provide()
  File "/usr/local/lib/python3.7/site-packages/botocore/configprovider.py", line 382, in provide
    config = self._session.get_scoped_config()
  File "/usr/local/lib/python3.7/site-packages/botocore/session.py", line 334, in get_scoped_config
    raise ProfileNotFound(profile=profile_name)
botocore.exceptions.ProfileNotFound: The config profile (<PROFILE_NAME>) could not be found

My solution was just create in
~/.aws/credentials a new PROFILE_NAME (empty ) like:

[default]
aws_access_key_id = blabla
aws_secret_access_key = blabla

[PROFILE_NAME]

And works! 😄 But I think should be something that gimme-aws-creds should do or returns a better exception. 👍

Its retaliated with #93

@Sector95 Sector95 added the bug label Jul 16, 2019
@Sector95
Copy link
Contributor

Yup this is a big one, ran into it myself just last week when setting up a new employee. We'll get a patch out.

@Sector95 Sector95 self-assigned this Jul 16, 2019
@Sector95
Copy link
Contributor

Sector95 commented Nov 5, 2019

This should no longer be a problem in the newer releases. Thanks!

@Sector95 Sector95 closed this as completed Nov 5, 2019
@Mizaro
Copy link

Mizaro commented Feb 15, 2021

Got the same problem and fixed it with the same solution as written here.
Installed version is 2.3.5. (Fresh install on Mac Pro M1 using brew)

@rammanokar
Copy link

This should no longer be a problem in the newer releases. Thanks!

Getting this issue in 2.4.0

@eponymz
Copy link

eponymz commented Sep 26, 2023

Still getting this issue in 2.7.2
Fix mentioned above still works. I have aws_rolename = all and setting the one role that I requested pulled in all as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants