Skip to content

Error: The security token included in the request is invalid - in GHA jobs #1190

@dil-jvanganuru

Description

@dil-jvanganuru

Describe the bug

Hi,

We planning to run some tests and below is the flow:

name: 'Run RSpec Tests'
on:
  push:
    branches:
      - master
  pull_request:
  label:
    types: [created, edited, deleted]

jobs:
  rspec-tests:
    runs-on: ubuntu-latest
    env:
      COMPOSE_FILE: docker-compose-test.yml

    steps:
      - name: Checkout code
        uses: actions/checkout@v2
  
      - name: List All Environment Variables
        run: secrets

      - name: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.ACCESS_KEY_SECRET }}
          aws-region: us-east-1

      - name: Login to Amazon ECR
        id: login-ecr
        uses: aws-actions/amazon-ecr-login@v1

      - name: Build, and push test image to Amazon ECR with new node packages
        id: build-image
        env:
          ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
          BUNDLE_GITHUB__COM: ${{ secrets.PAT }}:x-oauth-basic
        if: github.event.label.name == 'enhancement' || contains(github.event.pull_request.labels.*.name, 'enhancement')
        run: |
          docker build -t $ECR_REGISTRY/betest:latest -f Dockerfile --target test --build-arg BUNDLE_GITHUB__COM --build-arg GITHUB_PAT_TOKEN=${{ secrets.PKG_READ_TOKEN }} .
          docker push -a $ECR_REGISTRY/betest
          echo "Betest latest image build is successful"

      - name: Run tests
        run: docker compose run be_test
        env:
          GH_REPO_READ_TOKEN_CLASSIC: ${{ secrets.GH_REPO_READ_TOKEN_CLASSIC }}

This is giving error at aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ***
aws-secret-access-key: ***
aws-region: us-east-1
audience: sts.amazonaws.com
env:
COMPOSE_FILE: docker-compose-test.yml
Error: The security token included in the request is invalid.

Please help us with this issue.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

This should run successfully with no errors.

Current Behavior

This is giving error at aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ***
aws-secret-access-key: ***
aws-region: us-east-1
audience: sts.amazonaws.com
env:
COMPOSE_FILE: docker-compose-test.yml
Error: The security token included in the request is invalid.

Reproduction Steps

This is happening everytime.

Possible Solution

No response

Additional Information/Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingclosed-for-stalenessp2response-requestedWaiting on additional info and feedback. Will move to 'closing-soon' in 5 days.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions