Aws-cli: Problems with aws cli.....

Created on 2 Nov 2017  路  3Comments  路  Source: aws/aws-cli

Having some issue with aws cli.

~/.aws/config:
[default]
region=us-west-2
output=json

~/aws/credentials:
[default]
aws_access_key_id = AKIAJJUY63AE4XXXXXXX
aws_secret_access_key= ULLhYEWIjYownAbzvd9bMXXXXgzlEs

$ aws
Traceback (most recent call last):
File "/usr/local/bin/aws", line 27, in
sys.exit(main())
File "/usr/local/bin/aws", line 23, in main
return awscli.clidriver.main()
File "/usr/local/Cellar/awscli/1.11.170/libexec/lib/python2.7/site-packages/awscli/clidriver.py", line 56, in main
return driver.main()
File "/usr/local/Cellar/awscli/1.11.170/libexec/lib/python2.7/site-packages/awscli/clidriver.py", line 189, in main
command_table = self._get_command_table()
File "/usr/local/Cellar/awscli/1.11.170/libexec/lib/python2.7/site-packages/awscli/clidriver.py", line 98, in _get_command_table
self._command_table = self._build_command_table()
File "/usr/local/Cellar/awscli/1.11.170/libexec/lib/python2.7/site-packages/awscli/clidriver.py", line 118, in _build_command_table
command_object=self)
File "/usr/local/Cellar/awscli/1.11.170/libexec/lib/python2.7/site-packages/botocore/session.py", line 719, in emit
return self._events.emit(event_name, kwargs)
File "/usr/local/Cellar/awscli/1.11.170/libexec/lib/python2.7/site-packages/botocore/hooks.py", line 227, in emit
return self._emit(event_name, kwargs)
File "/usr/local/Cellar/awscli/1.11.170/libexec/lib/python2.7/site-packages/botocore/hooks.py", line 210, in _emit
response = handler(
kwargs)
File "/usr/local/Cellar/awscli/1.11.170/libexec/lib/python2.7/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.11.170/libexec/lib/python2.7/site-packages/awscli/clidriver.py", line 308, in service_model
return self._get_service_model()
File "/usr/local/Cellar/awscli/1.11.170/libexec/lib/python2.7/site-packages/awscli/clidriver.py", line 325, in _get_service_model
api_version = self.session.get_config_variable('api_versions').get(
File "/usr/local/Cellar/awscli/1.11.170/libexec/lib/python2.7/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.11.170/libexec/lib/python2.7/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.11.170/libexec/lib/python2.7/site-packages/botocore/session.py", line 383, in get_scoped_config
raise ProfileNotFound(profile=profile_name)
botocore.exceptions.ProfileNotFound: The config profile () could not be found

Tried adding an empty profile in config:
[profile]
region=us-west-2
output=json

But that did not help resolve the issue. Even the command like aws --version emits the same output as above.

Most helpful comment

Able to debug the issue and find a solution. For my particular case, some how an environment variable "AWS_PROFILE" was added accidently/automatically. After unsetting that variable, I was able to execute the aws command.

All 3 comments

Able to debug the issue and find a solution. For my particular case, some how an environment variable "AWS_PROFILE" was added accidently/automatically. After unsetting that variable, I was able to execute the aws command.

might want to remove the credentials from this post

This was also my issue.

Was this page helpful?
0 / 5 - 0 ratings