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

no basic auth credentials #337

Open
XI2171-sumitkadian opened this issue Aug 18, 2022 · 11 comments
Open

no basic auth credentials #337

XI2171-sumitkadian opened this issue Aug 18, 2022 · 11 comments

Comments

@XI2171-sumitkadian
Copy link

Some time when pipeline fails with the below error:
no basic auth credentials,
it does not happens regularly but in every 10-15 days this issue is occurring.

Pipeline steps:

  - name: Configure AWS Credentials
    uses: aws-actions/configure-aws-credentials@v1
    with:
     aws-region: ${{env.REGION}}
     role-to-assume: ${{env.ASSUME_ROLE}}
     role-duration-seconds: 1200
     role-skip-session-tagging: true
          

  - name: Login to Amazon ECR 
    id: login-ecr
    uses: aws-actions/amazon-ecr-login@v1
    
  - name: Build, tag, and push image to Amazon ECR
    env:          
      ECR_URL: ${{ steps.login-ecr.outputs.registry }}
    run: |
      docker build -t $ECR_URL/$ECR_REPO:$IMAGE_TAG .
      docker push $ECR_URL/$ECR_REPO:$IMAGE_TAG
@rahul799
Copy link

Facing the same issue too.

@RobinFrcd
Copy link

Same issue when running multiple pushes on different actions on the same runner instance.

@arjraman
Copy link
Contributor

arjraman commented Mar 3, 2023

Could you paste the exact error from your logs here, covering any sensitive information?

@RobinFrcd
Copy link

RobinFrcd commented Mar 3, 2023

Nothing really more useful than OP provided sadly :/

The push refers to repository [***.dkr.ecr.eu-west-3.amazonaws.com/***]
00ae2f02e451: Preparing
e9857ac559f9: Preparing
a70a5126b72f: Preparing
4cdb6e4a61: Preparing
d8009a0aa7: Preparing
2421911654: Preparing
435699713645: Preparing
2231911654: Waiting
4b4b8ae407af: Preparing
6e8b10052d: Preparing
435699713645: Waiting
0d7f412381ae: Preparing
954edfb465a4: Preparing
47ad77: Preparing
4b4b8ae407af: Waiting
no basic auth credentials
Error: Process completed with exit code 1.

But I can easily reproduce it.

  1. Install 2 runners on the same server
  2. Run 2 CIs at the same time that will both try to push an image to ECR

@arjraman
Copy link
Contributor

arjraman commented Mar 7, 2023

Could it be any of the issues mentioned here: https://docs.aws.amazon.com/AmazonECR/latest/userguide/common-errors-docker.html#error-403?

@RobinFrcd
Copy link

Pretty sure it's not:

  • You have authenticated to a different region: Always using the same region, eu-west-3
  • You have authenticated to push to a repository you don't have permissions for: If I retry a few seconds later, it works so the runner has the right permission
  • Your token has expired: I always do the ecr login before trying to push, so no
  • Bug in wincred credential manager: The runner is on Linux

@davi020
Copy link

davi020 commented Mar 30, 2023

Got the same error for me in our GitHub self-hosted server having 3 runners in the same server. Can someone help? There is no issue with authentication creds with AWS.
My setup is using assume_role.

@nerdeveloper
Copy link

@RobinFrcd what was your workaround concerning this issue

@RobinFrcd
Copy link

@nerdeveloper To have the 2 runners on 2 different instances ...

@nerdeveloper
Copy link

OMG! I just knew it. but I thought you'd be able to make it work without having to do that. The solution to this is to increase costs.

@arjraman, any time to fix this issue

@nerdeveloper
Copy link

This is my workaround. I used the native docker login; you can use this if you choose to have multiple runners in one VM pending when this issue is fixed.

      - name: Login into ECR 
        run: echo ::set-output name=logged-in::$(aws ecr get-login-password --region us-west-1 | docker login --username AWS --password-stdin [private ECR repo URL])

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