Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copying the wildrydes files from s3 fails with access denied #292

Open
daiscog opened this issue Sep 23, 2020 · 35 comments
Open

Copying the wildrydes files from s3 fails with access denied #292

daiscog opened this issue Sep 23, 2020 · 35 comments

Comments

@daiscog
Copy link

daiscog commented Sep 23, 2020

Following the "build a serverless web app" tutorial, and hit two issues in the Copy the files from S3 step in Module 1 - Static Web Hosting with Continuous Deployment.

Firstly, the pre-requisites for the tutorial didn't mention the need to install the aws cli, so I had to go and figure that out (more an annoyance than a blocker, as a quick Google for "aws cli" sorted that).

Then once the CLI is installed, running the aws s3 cp s3://wildrydes-us-east-1/WebApplication/1_StaticWebHosting/website ./ --recursive command as instructed results in this error:

fatal error: An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied

I assume the target S3 bucket is no longer publicly available...

@mtreby
Copy link

mtreby commented May 18, 2021

Hi @daiscog - I had the same problem. I resolved it by granting the IAM user that was doing the copy the AmazonS3ReadOnlyAccess policy - this gave the user permission to read from S3.

@SuperGx
Copy link

SuperGx commented Jul 29, 2021

Hi @daiscog - I had the same problem. I resolved it by granting the IAM user that was doing the copy the AmazonS3ReadOnlyAccess policy - this gave the user permission to read from S3.

Worked for me as well! Thanks

@phmohan
Copy link

phmohan commented Sep 15, 2021

Adding AmazonS3ReadOnlyAccess policy did not work for me

@skilletspecial
Copy link

Adding AmazonS3ReadOnlyAccess policy did not work for me

@phmohan I had to wait a few minutes after granting the IAM user AmazonS3ReadOnlyAccess before it took effect and I was able to copy the files from the S3 bucket.

@ranaalisaeed
Copy link

how much wait is required? AmazonS3ReadOnlyAccess permission is not working for me as well.

@ranaalisaeed
Copy link

Ok so the solution is a few things:

  1. For the IAM user, ensure you added the Access key ID and secret in your environment. You can check it on cat ~/.aws/credentials
  1. For the IAM user, ensure you have AmazonS3ReadOnlyAccess permission

@Delali97
Copy link

Delali97 commented Nov 2, 2022

@mtreby worked for me thanks!

@tordue
Copy link

tordue commented Nov 8, 2022

@ranaalisaeed , I have done no2, and it did not work, how can I go about doing no1

Ok so the solution is a few things:

  1. For the IAM user, ensure you added the Access key ID and secret in your environment. You can check it on cat ~/.aws/credentials

  2. For the IAM user, ensure you have AmazonS3ReadOnlyAccess permission

@jay1299
Copy link

jay1299 commented Dec 8, 2022

I faced same issue and resolved it using IAM. My IAM policies had S3 full access, Cloudshell full access(Since I used AWS CLI)

@aditya-grk
Copy link

Can anyone help me with the below error for the above tutorial:
I have given s3fullaccess as well. what does it mean when it says token expired.

aws s3 cp s3://wildrydes-us-east-1/WebApplication/1_StaticWebHosting/website ./ --recursive
fatal error: An error occurred (ExpiredToken) when calling the ListObjectsV2 operation: The provided token has expired.

@pkOO5
Copy link

pkOO5 commented Mar 8, 2023

Thanks that work for me. @aditya-grk try to generate new access keys in the security credentials of your IAM user.

@Smith-Steve
Copy link

Hi @daiscog - I had the same problem. I resolved it by granting the IAM user that was doing the copy the AmazonS3ReadOnlyAccess policy - this gave the user permission to read from S3.

I had the same issue. It worked for me by adding this Policy. Great job AWS.. absolutely no context left in the description about that.

@lavenaj
Copy link

lavenaj commented Jan 25, 2024

@mtreby - worked for me! Thanks

@dwittle
Copy link

dwittle commented Feb 8, 2024

I've found the "same" tutorial at https://webapp.serverlessworkshops.io/ is more up-to-date. It also pulls from GitHub.

@xuesen-li
Copy link

xuesen-li commented Feb 12, 2024

After doing the following, i still have the same issue. Anyone have any ideas?

  • Add AmazonS3ReadOnlyAccess
  • Make sure ~/.aws/credentials and ~/.aws/config have the correct content
  • To verify my setup, i created a public s3 bucket, and i am able to download files from it via CLI.

My AmazonS3ReadOnlyAccess looks like this:

Screenshot from 2024-02-12 09-45-51

@blossom2016
Copy link

Following the "build a serverless web app" tutorial, and hit two issues in the Copy the files from S3 step in Module 1 - Static Web Hosting with Continuous Deployment.

Firstly, the pre-requisites for the tutorial didn't mention the need to install the aws cli, so I had to go and figure that out (more an annoyance than a blocker, as a quick Google for "aws cli" sorted that).

Then once the CLI is installed, running the aws s3 cp s3://wildrydes-us-east-1/WebApplication/1_StaticWebHosting/website ./ --recursive command as instructed results in this error:

fatal error: An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied

I assume the target S3 bucket is no longer publicly available...

as at today 13th February 2024, I still have this issue

@blossom2016
Copy link

the problem is that the s3 bucketv isn't publicly accessible anymore. in order to find it check it here
aws s3 cp s3://ttt-wildrydes/wildrydes-site ./ --recursive

@Adhikesavan12
Copy link

i too got the same access denied error i have granted administrator access.

@blossom2016
Copy link

the problem is that the s3 bucketv isn't publicly accessible anymore. in order to find it check it here aws s3 cp s3://ttt-wildrydes/wildrydes-site ./ --recursive

AccessDenied error is gone but now when I git push, here's the new error:

fatal: repository 'https://git-codecommit.us-west-2.amazonaws.com/v1/repos/wildrydes-site/' not found

create a new repo and start all over again , with the git clone etc process. Also make sure you are in the us-west-2 region this is very important . I had to change my region and created the repo in this region

@blossom2016
Copy link

the problem is that the s3 bucketv isn't publicly accessible anymore. in order to find it check it here aws s3 cp s3://ttt-wildrydes/wildrydes-site ./ --recursive

AccessDenied error is gone but now when I git push, here's the new error:
fatal: repository 'https://git-codecommit.us-west-2.amazonaws.com/v1/repos/wildrydes-site/' not found

create a new repo and start all over again , with the git clone etc process. Also make sure you are in the us-west-2 region this is very important . I had to change my region and created the repo in this region

Tried changing region to us-west-2 and doing all over again but didn't help. When I git push to CodeCommit repository, after it asks credentials, I get this error again:

fatal: repository 'https://git-codecommit.us-west-2.amazonaws.com/v1/repos/wildrydes-site/' not found

did you name the repo you created in the us-west-2 region " wildrydes-site " when I had similar issues, I deleted the repos there, started again and named my repo "wildrydes-site" not " wildrydes-site2 "

@lakshiuuu
Copy link

C:\Users\compu\wildrydes-site>git add .
error: 'wildrydes-site/' does not have a commit checked out
fatal: adding files failed
WHAT DO I DO NOWW

@Bigguy98
Copy link

Bigguy98 commented Mar 4, 2024

ws s3 cp s3://ttt-wildrydes/wildrydes-site ./ --recursive

This's exactly the solution for me. Thanks you!

@A-ravi
Copy link

A-ravi commented Mar 15, 2024

the problem is that the s3 bucketv isn't publicly accessible anymore. in order to find it check it here aws s3 cp s3://ttt-wildrydes/wildrydes-site ./ --recursive

AccessDenied error is gone but now when I git push, here's the new error:

fatal: repository 'https://git-codecommit.us-west-2.amazonaws.com/v1/repos/wildrydes-site/' not found

Change the remote URL by running:
git remote set-url origin https://git-codecommit.us-east-1.amazonaws.com/v1/repos/wildrydes-site

then run

git push

@mhnrj1993
Copy link

aws s3 cp s3://ttt-wildrydes/wildrydes-site ./ --recursive

@mhnrj1993
Copy link

it works

@i-moreno
Copy link

the problem is that the s3 bucketv isn't publicly accessible anymore. in order to find it check it here aws s3 cp s3://ttt-wildrydes/wildrydes-site ./ --recursive

That solved my issue, thanks man!

@meghnadutta02
Copy link

the problem is that the s3 bucketv isn't publicly accessible anymore. in order to find it check it here aws s3 cp s3://ttt-wildrydes/wildrydes-site ./ --recursive

You are a savior 🙏

@Eblazecode
Copy link

Thank you !. you made the journey seamless

@Charleswang8711
Copy link

Charleswang8711 commented May 14, 2024

Thank you!
aws s3 cp s3://ttt-wildrydes/wildrydes-site ./ --recursive it works well.

Just a bit reminder. the remote repo address is changed to https://git-codecommit.us-west-2.amazonaws.com/v1/repos/wildrydes-site after executing the s3 command above

@alwayskkc
Copy link

Yup, aws s3 cp s3://ttt-wildrydes/wildrydes-site ./ --recursive this works.

@jaywhocodes
Copy link

jaywhocodes commented May 15, 2024

As others have stated, you can use @blossom2016 s3 bucket to cp:

>> aws s3 cp s3://ttt-wildrydes/wildrydes-site ./ --recursive

You then, if you are working on a repo in a different region, need to reset the git head to your cloned URL, which will be in your region, i.e., as @A-ravi stated, use,

>>git remote set-url origin <WHAT_YOUR_CLONED_URL_COPIED_VALUE_IS>

@Eblazecode
Copy link

please help my wildrydes-site is not deployed . it is showing master "failed ". i have added amplify.yml file in the base directory

@jaywhocodes
Copy link

please help my wildrydes-site is not deployed . it is showing master "failed ". i have added amplify.yml file in the base directory

What is showing as master failed? Can you copy+paste the code/log?

@MeenalJy
Copy link

MeenalJy commented Jun 10, 2024

the problem is that the s3 bucketv isn't publicly accessible anymore. in order to find it check it here aws s3 cp s3://ttt-wildrydes/wildrydes-site ./ --recursive

Thank you so much, it works but only when you have created your CodeCommit Repo in the region: us-west-2

@Hitz2001
Copy link

the problem is that the s3 bucketv isn't publicly accessible anymore. in order to find it check it here aws s3 cp s3://ttt-wildrydes/wildrydes-site ./ --recursive

This worked for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests