AWS fatal error: An error occurred (400) when calling the HeadObject operation: Bad Request

While using AWS and trying to copy a file from a S3 bucket to my EC2 instance ended up with this error message.

Command Used:  aws s3 cp s3://vv-s3-website-mumbai/index.html /var/www/html/

Error: fatal error: An error occurred (400) when calling the HeadObject operation: Bad Request


The error goes off if we add the region information to the command statement. I am using Asia Pacific (Mumbai) so used ap-south-1 as the region name.


Modified Command:
aws s3 cp s3://mybucketname/myfilename.html /var/www/html/ --region ap-south-1


[root@ip-172-31-18-18 html]# aws s3 cp s3://vv-s3-website-mumbai/index.html /var/www/html/

fatal error: An error occurred (400) when calling the HeadObject operation: Bad Request

[root@ip-172-31-18-18 html]# aws s3 cp s3://vv-s3-website-mumbai/index.html /var/www/html --region ap-south-1

download: s3://vv-s3-website-mumbai/index.html to ./index.html

[root@ip-172-31-18-18 html]# ls -ltr

total 4

-rw-r--r-- 1 root root 192 Jun 14 06:37 index.html

[root@ip-172-31-18-18 html]# pwd

/var/www/html


[root@ip-172-31-18-18 html]#

Comments

Popular Posts