jakejarvis / s3-sync-action

🔄 GitHub Action to sync a directory with a remote S3 bucket 🧺
https://github.com/marketplace/actions/s3-sync
MIT License
1.03k stars 473 forks source link

Permission denied error #50

Closed ankitgoyal100 closed 3 years ago

ankitgoyal100 commented 3 years ago

Hi - I’m trying to use this for a basic react app. When it runs, it uploads everything correctly, but then fails at the very end with the following error:

...
Completed 38.6 MiB/38.7 MiB (4.1 MiB/s) with 2 file(s) remaining
Completed 38.7 MiB/38.7 MiB (4.1 MiB/s) with 2 file(s) remaining
upload: build/static/media/socicon.a35b6574.svg to s3://***/static/media/socicon.a35b6574.svg
Completed 38.7 MiB/38.7 MiB (4.1 MiB/s) with 1 file(s) remaining
upload: build/static/js/2.4a354a39.chunk.js.map to s3://***/static/js/2.4a354a39.chunk.js.map
sh: /: Permission denied

The IAM user has full S3 access, so permissioning shouldn’t be an issue.

This is the code block in our Github actions workflow:

    - name: Deploy to S3
      uses: jakejarvis/s3-sync-action@master
      with:
        args: --acl public-read --follow-symlinks --delete
      env:
        AWS_S3_BUCKET: ${{ secrets.AWS_PRODUCTION_BUCKET_NAME }}
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        AWS_REGION: ${{ secrets.AWS_REGION }}
        SOURCE_DIR: "build"
MaiKaY commented 3 years ago

@ankitgoyal100 how did you solve it? I am facing the same issue.

ankitgoyal100 commented 3 years ago

@MaiKaY i ended up creating a new bucket and it worked

MaiKaY commented 3 years ago

@ankitgoyal100 I just found my issue. It was because my S3 bucket was configured as "private". As soon as I turned off the Block all public access it works for me.

alelopezperez commented 1 year ago

I'm having this error, and my s3 bucket is fully public, also IAM user has full S3 access

HalimSD commented 1 year ago

@alelopezperez How did you end up fixing it?