amazon-ecr-login
amazon-ecr-login copied to clipboard
no basic auth credentials
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
Facing the same issue too.
Same issue when running multiple pushes on different actions on the same runner instance.
Could you paste the exact error from your logs here, covering any sensitive information?
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.
- Install 2 runners on the same server
- Run 2 CIs at the same time that will both try to push an image to ECR
Could it be any of the issues mentioned here: https://docs.aws.amazon.com/AmazonECR/latest/userguide/common-errors-docker.html#error-403?
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
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.
@RobinFrcd what was your workaround concerning this issue
@nerdeveloper To have the 2 runners on 2 different instances ...
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
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])