Problem loading from credentials file
Closed this issue · 3 comments
Steps taken:
- git cloned the repo
- installed requirements
- ran "stacks" command
- Got following output:
usage: stacks [-h] [-p PROFILE] [-r REGION] {list,create,update,delete} ...
optional arguments:
-h, --help show this help message and exit
-p PROFILE, --profile PROFILE
-r REGION, --region REGION
available subcommands:
{list,create,update,delete}
list List stacks
create Create a new stack
update Update an existing stack
delete Delete an existing stack
Trying to load file.../home/tgent/.aws/credentials
Traceback (most recent call last):
File "./stacks", line 95, in get_region_name
c = botocore.config.load_config(config_file)
AttributeError: 'module' object has no attribute 'load_config'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./stacks", line 341, in
main()
File "./stacks", line 296, in main
elif get_region_name(args.profile):
File "./stacks", line 63, in retry_call
retval = func(*args)
File "./stacks", line 100, in get_region_name
raise RuntimeError('Failed loading config {}'.format(config_file))
RuntimeError: Failed loading config /home/tgent/.aws/credentials
Things checked:
- Python version - 3.4.0
- ~/.aws/credentials file contains -
[default]
aws_access_key_id = stuff
aws_secret_access_key = stuff
region = eu-west-1
output = json
Seems to be complaining about "botocore.config.load_config(config_file)" and there being no load_config method, though I can see that in the botocore library.
Thanks for trying stacks out!
It seems the boto library you've got doesn't have the load_config
method which is odd.
What version of boto do you have installed? is there more than one which might be conflicting?
We've talked about pinning the version in the requirements.txt and also making a packaged python build which should help issues like this.
Spot on it just wasn't installing the correct version of botocore, as there was already a really old one installed so it just thought it was already there and didn't do anything.
Running:
sudo pip3 install botocore --upgrade
fixes the issue. Could just amend readme so instructions ask people to use the upgrade flag? Though agree pinning the version sounds like a sensible move.