2017-04-05 135 views
1

我有一个具有AmazonS3FullAccess策略权限的用户,我的存储桶名称为abcxyzchristestAWS s3 cp命令返回:调用ListObjects操作时发生错误(InvalidRequest)

我已经用上述用户配置了AWS cli。

当运行aws s3 cp --region eu s3://abcxyzchristest/ abcxyz我得到:

fatal error: An error occurred (InvalidRequest) when calling the ListObjects operation: Missing required header for this request: x-amz-content-sha256 

什么是错误的原因是什么?

+3

可能是'eu'不是地区?例如,它应该是'eu-west-1'。你可以插入你的完整区域,然后再试一次吗? –

+0

如何确定我的存储桶位于哪个区域?它只是在S3控制台上说'欧盟(法兰克福)' –

+1

请点击此处:http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region法兰克福是'eu-central-1' –

回答

1

这是由于指定了错误的区域。

我不得不这样做: aws s3 cp --region eu-central-1 s3://abcxyzchristest/ bobby

0

有两个步骤来解决这个问题:

1)配置命令行AWS

[[email protected] ec2-user]# aws configure 
AWS Access Key ID [None]: 
AWS Secret Access Key [None]: 
Default region name [ap-south-1a]: ap-south-1 <-- give your region here 
Default output format [None]: 

2)在S3指定的区域cp命令

aws s3 cp --recursive s3://buckername /home/ec2-user --region ap-south-1 
相关问题