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

AWS_S3_BUCKET is not set. Quitting. #53

Open
adam-snetiker opened this issue Feb 3, 2021 · 13 comments
Open

AWS_S3_BUCKET is not set. Quitting. #53

adam-snetiker opened this issue Feb 3, 2021 · 13 comments

Comments

@adam-snetiker
Copy link

My AWS bucket is in fact set, but I keep getting this error message so my action won't work to completion. Should I include the static website endpoint instead or in addition to the bucket name? I know the bucket is correct, but it's not being recognized at all.
Screen Shot 2021-02-03 at 12 09 58 PM

@andre-lx
Copy link

andre-lx commented Mar 4, 2021

Can you paste your step please?

@aljones15
Copy link

aljones15 commented Apr 23, 2021

Here are mine:

  update-s3-bucket:
    runs-on: ubuntu-latest
    steps:
      - name: 'S3 Bucket sync'
        uses: jakejarvis/s3-sync-action@master
        with:
          args: --acl public-read
        env:
          AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          AWS_REGION: ${{ secrets.AWS_REGION }} # optional: defaults to us-east-1
          SOURCE_DIR: 'reports'      # optional: defaults to entire repository

getting the same error

error is coming from here:

if [ -z "$AWS_S3_BUCKET" ]; then
echo "AWS_S3_BUCKET is not set. Quitting."
exit 1
fi

@andre-lx
Copy link

Hi @aljones15.

I have the same configuration as you.

Can you try to set manually the bucket name in the action?

It looks like the secret is not being pulled.

@aljones15
Copy link

aljones15 commented Apr 23, 2021

did that now getting: AWS_ACCESS_KEY_ID is not set. Quitting.

yeah this is weird. any idea why the secrets are not showing up?
They are definitely set.

  update-s3-bucket:
    runs-on: ubuntu-latest
    steps:
      - name: 'S3 Bucket sync'
        uses: jakejarvis/s3-sync-action@master
        with:
          args: --acl public-read
        env:
          AWS_S3_BUCKET: 's3://vaxcert-interop-reports'
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          AWS_REGION: ${{ secrets.AWS_REGION }} # optional: defaults to us-east-1
          SOURCE_DIR: 'reports'      # optional: defaults to entire repository
~                                                                                  

The secrets are set as Environment secrets perhaps they need to be Repository secrets or Organization secrets?

@andre-lx
Copy link

Not a clue. But it's definitely something with your secrets.

Try to delete the secrets and add it again. Are you using organisational secrets or repository ones? Try on the repo itself.

@aljones15
Copy link

Thank you for the help. I was using environment secrets. I think the issue with those was that I was not telling it what environment to use. Using the repo level secrets did work, but now it can't find the dir I want to sync with the bucket.

@andre-lx
Copy link

The reports dir? What error did you get now?

@aljones15
Copy link

The user-provided path ./reports does not exist.

I checked and I seem to be in an empty docker container, not sure how to get the dir that results from the test run to be available to the aws cli docker.

name: Node.js CI
  
on: [push]
  
jobs:
  test-node: 
    runs-on: ubuntu-latest
    timeout-minutes: 35
    strategy:
      matrix:
        node-version: [14.x]
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm install
      - name: Run test with Node.js ${{ matrix.node-version }}
        run: npm run test-node
        continue-on-error: true
  update-s3-bucket:
    runs-on: ubuntu-latest
    needs: [test-node]
    steps:
      - name: 'Dir check'
        run: ls -la
      - name: 'S3 Bucket sync'
        uses: jakejarvis/s3-sync-action@master
        with:
          args: --acl public-read
        env:
          AWS_S3_BUCKET: 's3://vaxcert-interop-reports'
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          AWS_REGION: ${{ secrets.AWS_REGION }} # optional: defaults to us-east-1
          SOURCE_DIR: './reports'      # optional: defaults to entire repository

@andre-lx
Copy link

andre-lx commented Apr 23, 2021

Why are you using two separated jobs?

You can add to the test-node (where you do the checkout) the 'S3 Bucket sync' step. Or, do the checkout again in the update-s3-bucket job. Since you are doing the checkout on the first job, and not the second one, you get the empty dir.

@aljones15
Copy link

I'm a total noob with github actions. Thanks for the help and it is working. Just updated my s3 bucket/ website with fresh reports for the w3c. Thanks for your time and effort.

@vitalykarasik
Copy link

+1 - the same issue:
Screen Shot 2021-07-15 at 19 16 32

@TriangleJuice
Copy link

TriangleJuice commented Sep 2, 2022

We have the same issue. Our code is nothing fancy and used to work. It stopped working when upgrading the Node version of our script from 10 to 14, but this should not be the culprit, since it is a different part of the script.

Update: we found the issue. Right before it stopped working the repo was deleted and then restored. The GitHub secret was set at organisation level with custom access. The binding was lost after the deletion/restore. Everything is working fine again now.

@wtondossantos
Copy link

name: Node.js CI

on: [push]

jobs:
test-node:
runs-on: ubuntu-latest
timeout-minutes: 35
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Run test with Node.js ${{ matrix.node-version }}
run: npm run test-node
continue-on-error: true
update-s3-bucket:
runs-on: ubuntu-latest

environment:
  name: prod

image

needs: [test-node]
steps:
  - name: 'Dir check'
    run: ls -la
  - name: 'S3 Bucket sync'
    uses: jakejarvis/s3-sync-action@master
    with:
      args: --acl public-read
    env:
      AWS_S3_BUCKET: 's3://vaxcert-interop-reports'
      AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
      AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      AWS_REGION: ${{ secrets.AWS_REGION }} # optional: defaults to us-east-1
      SOURCE_DIR: './reports'      # optional: defaults to entire repository

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

6 participants