Aws-cli: CentOS 7.x x64 Unable to grab EC2 Information

Created on 2 May 2016  路  2Comments  路  Source: aws/aws-cli

Having an issue now where I cannot run

$ aws ec2 describe-instances

It always results in

A client error (AuthFailure) occurred when calling the DescribeInstanceStatus operation: AWS was not able to validate the provided access credentials

Troubleshooting

CentOS 7.x x64

$ cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)

Python Version(s)

$ which python python2 python2.7
/usr/bin/python
/usr/bin/python2
/usr/bin/python2.7

$ python --version ; python2 --version ; python2.7 --version
Python 2.7.5
Python 2.7.5
Python 2.7.5

"pip" and "awscli" PIP Package Versions:

$ pip list | grep "pip\|aws"
awscli (1.10.24)
pip (8.1.1)

Current IAM Security Policy:

{
    "Version": "2016-05-02",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "*",
            "Resource": "*"
        }
    ]
}

Screenshot of working simulation of "describe-instances":

http://i.imgur.com/jglmvbi.png

Contents of /home//.aws/credentials and config:

$ cat .aws/credentials
[default]
aws_access_key_id = <REMOVED>
aws_secret_access_key = <REMOVED>

$ cat .aws/config
[default]
region = us-east-1

Testing with other permissions and commands:

$ aws iam list-access-keys
{
    "AccessKeyMetadata": [
        {
            "UserName": "<REMOVED FOR PRIVACY>",
            "Status": "Active",
            "CreateDate": "2016-05-02T19:16:31Z",
            "AccessKeyId": "<REMOVED FOR PRIVACY>"
        }
    ]
}

But I receive errors when running "describe-instances", "describe-regions", etc.

$ aws ec2 describe-instances

A client error (AuthFailure) occurred when calling the DescribeInstances operation: AWS was not able to validate the provided access credentials

I ran --debug with this as well but it doesn't _seem_ to provide any useful insight, only that Amazon returns back the same error above, only in a more verbose, XML format.

Has anyone any ideas or have run into this before?

Most helpful comment

Resolved;

Apparently this can happen if the time is not sync'd and is too far off. In my case, my server was nearly one minute off of sync.

All 2 comments

Resolved;

Apparently this can happen if the time is not sync'd and is too far off. In my case, my server was nearly one minute off of sync.

Hours. You've saved me hours. I can't thank you enough. How did you even figure this out?

Was this page helpful?
0 / 5 - 0 ratings