question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

botocore.exceptions.ProfileNotFound: The config profile (xxx-xxx) could not be found

See original GitHub issue

I get this sometimes:

$ aws-google-auth --idp-id qqqqqqqq --sp-id 123456879 --username user@domain.com --duration 43200 --role-arn arn:aws:iam::6666666666:role/sso/sso-administrator --profile xxx-xxx --keyring
Failed to import U2F libraries, U2F login unavailable. Other methods can still continue.
Open the Google App, and tap 'Yes' on the prompt to sign in ...
Assuming arn:aws:iam::6666666666:role/sso/sso-administrator
Traceback (most recent call last):
  File "/usr/local/bin/aws-google-auth", line 11, in <module>
    sys.exit(main())
  File "/Users/max.williams/Library/Python/3.6/lib/python/site-packages/aws_google_auth/__init__.py", line 226, in main
    cli(cli_args)
  File "/Users/max.williams/Library/Python/3.6/lib/python/site-packages/aws_google_auth/__init__.py", line 65, in cli
    process_auth(args, config)
  File "/Users/max.williams/Library/Python/3.6/lib/python/site-packages/aws_google_auth/__init__.py", line 216, in process_auth
    print("Credentials Expiration: " + format(amazon_client.expiration.astimezone(get_localzone())))
  File "/Users/max.williams/Library/Python/3.6/lib/python/site-packages/aws_google_auth/amazon.py", line 50, in expiration
    return self.token['Credentials']['Expiration']
  File "/Users/max.williams/Library/Python/3.6/lib/python/site-packages/aws_google_auth/amazon.py", line 29, in token
    self.__token = self.sts_client.assume_role_with_saml(
  File "/Users/max.williams/Library/Python/3.6/lib/python/site-packages/aws_google_auth/amazon.py", line 20, in sts_client
    return boto3.client('sts', region_name=self.config.region)
  File "/Users/max.williams/Library/Python/3.6/lib/python/site-packages/boto3/__init__.py", line 91, in client
    return _get_default_session().client(*args, **kwargs)
  File "/Users/max.williams/Library/Python/3.6/lib/python/site-packages/boto3/__init__.py", line 80, in _get_default_session
    setup_default_session()
  File "/Users/max.williams/Library/Python/3.6/lib/python/site-packages/boto3/__init__.py", line 34, in setup_default_session
    DEFAULT_SESSION = Session(**kwargs)
  File "/Users/max.williams/Library/Python/3.6/lib/python/site-packages/boto3/session.py", line 80, in __init__
    self._setup_loader()
  File "/Users/max.williams/Library/Python/3.6/lib/python/site-packages/boto3/session.py", line 120, in _setup_loader
    self._loader = self._session.get_component('data_loader')
  File "/Users/max.williams/Library/Python/3.6/lib/python/site-packages/botocore/session.py", line 729, in get_component
    return self._components.get_component(name)
  File "/Users/max.williams/Library/Python/3.6/lib/python/site-packages/botocore/session.py", line 946, in get_component
    self._components[name] = factory()
  File "/Users/max.williams/Library/Python/3.6/lib/python/site-packages/botocore/session.py", line 186, in <lambda>
    lambda:  create_loader(self.get_config_variable('data_path')))
  File "/Users/max.williams/Library/Python/3.6/lib/python/site-packages/botocore/session.py", line 281, in get_config_variable
    elif self._found_in_config_file(methods, var_config):
  File "/Users/max.williams/Library/Python/3.6/lib/python/site-packages/botocore/session.py", line 308, in _found_in_config_file
    return var_config[0] in self.get_scoped_config()
  File "/Users/max.williams/Library/Python/3.6/lib/python/site-packages/botocore/session.py", line 385, in get_scoped_config
    raise ProfileNotFound(profile=profile_name)
botocore.exceptions.ProfileNotFound: The config profile (xxx-xxxx) could not be found

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
stevemac007commented, Oct 15, 2018

This has been improved, shouldn’t get a crazy error any more.

0reactions
max-rocket-internetcommented, Aug 20, 2018

If it’s any consolation, the AWS CLI doesn’t handle it either:

$ aws s3 ls
Traceback (most recent call last):
  File "/usr/local/bin/aws", line 27, in <module>
    sys.exit(main())
  File "/usr/local/bin/aws", line 23, in main
    return awscli.clidriver.main()
  File "/usr/local/Cellar/awscli/1.14.50/libexec/lib/python3.6/site-packages/awscli/clidriver.py", line 59, in main
    rc = driver.main()
  File "/usr/local/Cellar/awscli/1.14.50/libexec/lib/python3.6/site-packages/awscli/clidriver.py", line 194, in main
    command_table = self._get_command_table()
  File "/usr/local/Cellar/awscli/1.14.50/libexec/lib/python3.6/site-packages/awscli/clidriver.py", line 103, in _get_command_table
    self._command_table = self._build_command_table()
  File "/usr/local/Cellar/awscli/1.14.50/libexec/lib/python3.6/site-packages/awscli/clidriver.py", line 123, in _build_command_table
    command_object=self)
  File "/usr/local/Cellar/awscli/1.14.50/libexec/lib/python3.6/site-packages/botocore/session.py", line 719, in emit
    return self._events.emit(event_name, **kwargs)
  File "/usr/local/Cellar/awscli/1.14.50/libexec/lib/python3.6/site-packages/botocore/hooks.py", line 227, in emit
    return self._emit(event_name, kwargs)
  File "/usr/local/Cellar/awscli/1.14.50/libexec/lib/python3.6/site-packages/botocore/hooks.py", line 210, in _emit
    response = handler(**kwargs)
  File "/usr/local/Cellar/awscli/1.14.50/libexec/lib/python3.6/site-packages/awscli/customizations/preview.py", line 69, in mark_as_preview
    service_name=original_command.service_model.service_name,
  File "/usr/local/Cellar/awscli/1.14.50/libexec/lib/python3.6/site-packages/awscli/clidriver.py", line 315, in service_model
    return self._get_service_model()
  File "/usr/local/Cellar/awscli/1.14.50/libexec/lib/python3.6/site-packages/awscli/clidriver.py", line 332, in _get_service_model
    api_version = self.session.get_config_variable('api_versions').get(
  File "/usr/local/Cellar/awscli/1.14.50/libexec/lib/python3.6/site-packages/botocore/session.py", line 279, in get_config_variable
    elif self._found_in_config_file(methods, var_config):
  File "/usr/local/Cellar/awscli/1.14.50/libexec/lib/python3.6/site-packages/botocore/session.py", line 306, in _found_in_config_file
    return var_config[0] in self.get_scoped_config()
  File "/usr/local/Cellar/awscli/1.14.50/libexec/lib/python3.6/site-packages/botocore/session.py", line 383, in get_scoped_config
    raise ProfileNotFound(profile=profile_name)
botocore.exceptions.ProfileNotFound: The config profile (does-not-exist) could not be found

😁

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS : The config profile (MyName) could not be found
This happened to me when AWS config file was not found since the user starting the service was a root user, when i...
Read more >
The config profile (default) could not be found – iTecNote
I'm facing issue while export CSV from pandas datafram to S3, getting below error: The config profile (default) could not be found: ProfileNotFound...
Read more >
The config profile (default) could not be found - appsloveworld
I'm facing issue while export CSV from pandas datafram to S3, getting below error: The config profile (default) could not be found: ProfileNotFound...
Read more >
cloud-custodian/cloud-custodian - Gitter
... in get_scoped_config raise ProfileNotFound(profile=profile_name) botocore.exceptions.ProfileNotFound: The config profile (xxxxxx) could not be found.
Read more >
aws cli ProfileNotFound - Life in USA - WordPress.com
... kms encrypt xxx, the botocore.exceptions.ProfileNotFound: The config profile (SOME_DEV_ROLE) could not be found constantly pop up.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found