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 error for random builds #431

Closed
davi020 opened this issue Mar 30, 2023 · 5 comments
Closed

no basic auth credentials error for random builds #431

davi020 opened this issue Mar 30, 2023 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@davi020
Copy link

davi020 commented Mar 30, 2023

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

My setup -

  • Have 3 runner instances in my self-hosted github runner
  • Using assume role to authenticate with AWS
  • If a build fails, the next build will pass. Issue occurring on random builds

Logs
Successfully built 96a7fcd1b011 Successfully tagged ***.dkr.ecr.eu-central-1.amazonaws.com/registry:latest The push refers to repository [***.dkr.ecr.eu-central-1.amazonaws.com/registry] 374b29f6eb29: Preparing 02541b6f86e9: Preparing d36dc390a6a2: Preparing 28adcc2eea7f: Preparing 8c667e7e65fe: Preparing no basic auth credentials Error: Process completed with exit code 1.

@arjraman arjraman added the duplicate This issue or pull request already exists label Mar 30, 2023
@nerdeveloper
Copy link

@davi020 I am having same issue. What was your work around for this.

@LiJell
Copy link

LiJell commented Jan 15, 2024

@davi020 I am also having same issue. did you solve this problem? I am using v2 btw

@davi020
Copy link
Author

davi020 commented Jan 15, 2024

@nerdeveloper @LiJell - Hi Guys, This mentioned issue is intermediate and I have fixed it by using the native AWS cli commands -

  • name: Native docker ECR login
    id: docker-ecr-login
    run: |
    result=$(aws ecr get-login-password --region | docker login --username AWS --password-stdin ${{ env.ECR_REGISTRY }})
    echo "Login Result: $result"

Let me know if this works!!

@LiJell
Copy link

LiJell commented Jan 15, 2024

@nerdeveloper @LiJell - Hi Guys, This mentioned issue is intermediate and I have fixed it by using the native AWS cli commands -

  • name: Native docker ECR login
    id: docker-ecr-login
    run: |
    result=$(aws ecr get-login-password --region | docker login --username AWS --password-stdin ${{ env.ECR_REGISTRY }})
    echo "Login Result: $result"

Let me know if this works!!

Actually I also solved this problem by using aws cli. Thank you for your help :)

@davi020 davi020 closed this as completed Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants