Question:
I’m new to AWS and I’m trying to download a bunch of files from my S3 bucket to my local machine using aws s3 sync
as described in http://docs.aws.amazon.com/cli/latest/reference/s3/sync.html.
I used the following command:
1 2 |
aws s3 sync s3://outputbucket/files/ . |
I got the following error:
A client error (AccessDenied) occurred when calling the ListObjects operation: Access Denied
Completed 1 part(s) with … file(s) remaining
Even though I have configured my access key ID & secret access key as described in http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html
Where might the problem be?
Answer:
Assuming that you are an Administrator and/or you have set your credentials properly, it is possible that you are using an old AWS CLI.
I encountered this while using the packaged AWS CLI with Ubuntu 14.04.
The solution that worked for me is to remove the AWS CLI prepackaged with Ubuntu, and download it from python-pip instead:
1 2 3 4 |
sudo apt-get remove awscli sudo apt-get install python-pip sudo pip install awscli |
Many thanks to this link:
https://forums.aws.amazon.com/thread.jspa?threadID=173124