Anuroop
Anuroop

Reputation: 1002

"aws s3 ls" command throwing "InvalidRequest" error message. How to solve it?

After I run aws s3 ls command I get below error message:-

A client error (InvalidRequest) occurred when calling the ListBuckets operation: You are attempting to operate on a bucket in a region that requires Signature Version 4. You can fix this issue by explicitly providing the correct region location using the --region argument, the AWS_DEFAULT_REGION environment variable, or the region variable in the AWS CLI configuration file. You can get the bucket's location by running "aws s3api get-bucket-location --bucket BUCKET".

Below are more details and my findings that may help to answer the question:-

Upvotes: 5

Views: 5896

Answers (3)

Deepak Chaudhary
Deepak Chaudhary

Reputation: 486

You need to update aws cli to latest version(v1.11.84 at the time of writing).

If yum update is not working then try following this Guide to install AWS CLI

The reason behind this error is, in newer regions AWS S3 doesn't support Lower Signature Version.

Upvotes: 9

pnv
pnv

Reputation: 1499

This worked for me:

sudo pip install --upgrade awscli

Upvotes: 4

Nayan
Nayan

Reputation: 235

For Mac do sudo pip install awscli and that should fix the issue.

Upvotes: 3

Related Questions