I was merrily going on my way, everything was working, and suddenly I'm getting errors from all my EC2 Ansible operations (The warning about rebuilding was there before and not an issue):
ec2-user]# ansible -m ping -u ec2-user all
/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
_warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)
Traceback (most recent call last):
File "/root/ansible/bin/ansible", line 194, in <module>
(runner, results) = cli.run(options, args)
File "/root/ansible/bin/ansible", line 112, in run
inventory_manager = inventory.Inventory(options.inventory, vault_password=vault_pass)
File "/root/ansible/lib/ansible/inventory/__init__.py", line 118, in __init__
self.parser = InventoryScript(filename=host_list)
File "/root/ansible/lib/ansible/inventory/script.py", line 49, in __init__
self.groups = self._parse(stderr)
File "/root/ansible/lib/ansible/inventory/script.py", line 57, in _parse
self.raw = utils.parse_json(self.data)
File "/root/ansible/lib/ansible/utils/__init__.py", line 552, in parse_json
results = json.loads(data)
File "/usr/lib64/python2.6/json/__init__.py", line 307, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.6/json/decoder.py", line 319, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.6/json/decoder.py", line 338, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Anyone know what gives?
If I try to runs hosts I get:
ec2-user]# /etc/ansible/hosts
Looks like AWS is down again:
EC2ResponseError: 403 Forbidden
<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>UnauthorizedOperation</Code><Message>You are not authorized to perform this operation.</Message></Error></Errors><RequestID>9c499f04-3fd8-47cd-a7e4-655af47c1564</RequestID></Response>
All my operations in the AWS console are still successful.
I ran into this issue as well. Turned out to be a problem with my AWS keys. Here's what I would suggest:
export AWS_SECRET_ACCESS_KEY=...
to set them in your environment, it's important that the punctuation around them be correct. Mine look likeexport AWS_ACCESS_KEY_ID="ASFSADFSDF"
(with quotes)
export AWS_SECRET_ACCESS_KEY=ADSFASFAASFASDFSADSFDASDFSADF
(no quotes)
Hope that helps!
Make sure you have AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY exported. (as others have pointed)
Make sure you have boto installed, you can install it by running :
sudo pip install boto
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With