• Register
0 votes

Problem :

I want to setup the Amazon Linux AMI(ami-f0091d91) also I have the script that runs a copy command to copy from the S3 bucket as follows:

aws --debug s3 cp s3://aws-codedeploy-us-west-2/latest/codedeploy-agent.noarch.rpm .

Above script works properly on my local machine however fails with the below error on my Amazon Image:

2019-12-09 01:07:47,110 - MainThread - botocore.auth - DEBUG - StringToSign:


Mon, 09 Dec 2019 01:07:47



2019-12-09 01:07:47,111 - MainThread - botocore.endpoint - DEBUG - Sending http request: <PreparedRequest [HEAD]>

2019-12-09 01:07:47,111 - MainThread - botocore.vendored.requests.packages.urllib3.connectionpool - INFO - Starting new HTTPS connection (1): aws-codedeploy-us-west-2.s3.amazonaws.com

2019-12-09 01:07:47,151 - MainThread - botocore.vendored.requests.packages.urllib3.connectionpool - DEBUG - "HEAD /latest/codedeploy-agent.noarch.rpm HTTP/1.1" 403 0

2019-12-09 01:07:47,151 - MainThread - botocore.parsers - DEBUG - Response headers: {'x-amz-id-2': '0mRvGge9ugu+KKyDmROm4jcTa1hAnA5Ax8vUlkKZXoJ//HVJAKxbpFHvOGaqiECa4sgon2F1kXw=', 'server': 'AmazonS3', 'transfer-encoding': 'chunked', 'x-amz-request-id': '6204CD88E880E5DD', 'date': 'Tue, 22 Mar 2016 01:07:46 GMT', 'content-type': 'application/xml'}

2019-12-09 01:07:47,152 - MainThread - botocore.parsers - DEBUG - Response body:

2019-12-09 01:07:47,152 - MainThread - botocore.hooks - DEBUG - Event needs-retry.s3.HeadObject: calling handler <botocore.retryhandler.RetryHandler object at 0x7f421075bcd0>

2019-12-09 01:07:47,152 - MainThread - botocore.retryhandler - DEBUG - No retry needed.

2019-12-09 01:07:47,152 - MainThread - botocore.hooks - DEBUG - Event after-call.s3.HeadObject: calling handler <function enhance_error_msg at 0x7f4211085758>

2019-12-09 01:07:47,152 - MainThread - botocore.hooks - DEBUG - Event after-call.s3.HeadObject: calling handler <awscli.errorhandler.ErrorHandler object at 0x7f421100cc90>

2019-12-09 01:07:47,152 - MainThread - awscli.errorhandler - DEBUG - HTTP Response Code: 403

2019-12-09 01:07:47,152 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Exception caught during task execution: A client error (403) occurred when calling the HeadObject operation: Forbidden

6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I found the solution on your issue. I had the same error in my cloud formation template that was behind the creation of the EC2 instances. Because of that the EC2 instances that were trying to access the code deploy buckets, were in the different regions. It guess it is like the access policies on the buckets which are owned by Amazon only allows the access from the region they belong to. When I fixed the error in my template which was showing the wrong parameter map the error disappeared.

9 7 4
38,600 points

Related questions

0 votes
1 answer 1K views
Problem : I am facing following error : An error occurred (AccessDenied) when calling the ListObjects operation: Access Denied Whenever I tried to get folder from my S5 bucket using following command : aws s5 cp s5://bucket-name/data/all-data/ . --recursive My IAM permissions for the ... ": [ "arn:aws:s5:::bucketname/*" ] } ] } What should I update to be able to execute copy and ls successfully?
asked Dec 5, 2019 alecxe 7.5k points
0 votes
1 answer 863 views
Problem : I have coded one example for how to grant the user access to just one bucket. After that I tested the config using my W3 Total Cache Wordpress plugin. However my test failed. I also tried by reproducing the issue using below command : aws s3 cp ... /my-bucket/test.txt A client error (AccessDenied) occurred when calling the PutObject operation: Access Denied How can I upload to my bucket?
asked Dec 10, 2019 alecxe 7.5k points
0 votes
1 answer 4 views
Problem: Another service operation is currently in progress.
asked Mar 22 Dan phillip 4.7k points
0 votes
1 answer 7 views
Problem: Can someone tell me why the Site domain redirecting to the URL of the amazon web services bucket?
asked Mar 10 ummesalma 24.5k points
0 votes
0 answers 190 views
Problem: I have only managed to have the elementary knowledge on AWS. Currently I am trying to download all of the available files from the s3 bucket to the local machine. I have already installed AWS cli. After that I have tried to use the aws configure to ... the ListObjectsV2 operation: The AWS Access Key Id you provided does not exist in our records. Kindly guide me in fixing above AWS error.
asked Jun 22, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 140 views
Problem : I have searched on a web for over two days now, and probably have looked through most of a online documented scenarios and workarounds, but nothing realy worked for me so far. I am on a AWS SDK for PHP V2.8.7 running on PHP 5.3. I want to ... pass in the information (example: profile and including credentials in code) but nothing is working at the moment for me. Any solution on my error?
asked Jan 18, 2020 jwilliam 3.9k points
0 votes
1 answer 5 views
Problem: I am stuck with this ... Please help me that how to deal with this error? aws lambda read file from s3 node js
asked Mar 24 Ifra 24.4k points
0 votes
1 answer 2 views
Problem: I have an issue that i am unable to initialize connection to steam eso.
asked Mar 22 waseem memon 2.4k points
0 votes
1 answer 7 views
Problem: i have an issue that i am unable to locate a running instance of steam plaease solve this issue.
asked Mar 22 waseem memon 2.4k points