question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Intermittent error: Docker Login failed with exit code 1 running jobs in container

See original GitHub issue

Describe the bug I am running a job in a container using self-hosted runners and sometimes an error related to docker login occurs so we need to re-run the job again and everything works fine.

I know it can be related to my credentials but I have another job running aws ecr get-login-password command to get the token before this job below.

Note: I am using a private ECR.

My job:

job_name:
    name: Job Name
    runs-on: self-hosted
    container:
      image: 12345678910.dkr.ecr.eu-west-1.amazonaws.com/ecr_name:tag
      credentials:
        username: AWS
        password:  ${{ secrets.password }}

Expected behavior

Run job without docker login error

Runner Version and Platform

EKS version: v1.22.9-eks-a64ea69 Current runner version: ‘2.293.0’

What’s not working?

Screen Shot 2022-06-29 at 11 19 26 AM

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:8

github_iconTop GitHub Comments

1reaction
rsilva-rscommented, Jul 5, 2022

@rlinstorres Adding to the proposed fix by @ksdc-andreo you may be facing an intermittent escaping or special char mismatch. Have you tried the following?

- run: echo `(aws ecr get-login-password --region $AWS_REGION)` | gh secret set password
0reactions
tom-robocommented, Feb 2, 2023

However, this does mean that I can’t start a job inside a container (I can only launch containers, etc. as steps within a job).

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitHub Action Error: Docker pull failed with exit code 1
I'm trying to run my npm build inside the docker container using our private docker image with GitHub actions. My Workflow yaml file...
Read more >
The CI/CD Pipeline suddenly fails without any changes ...
Hello! As the title suggests, starting today we've been experiencing issues with successfully running the build job in our pipeline.
Read more >
How to Fix 'Terminated With Exit Code 1' Error
Exit Code 1 indicates that a container shut down, either because of an application failure or because the image pointed to an invalid...
Read more >
Initialize containers: Docker login fail with exit code 1
Re: Azure DevOps Pipelines failing: Initialize containers: Docker login fail with exit code 1 ... - Go to the SP, create a new...
Read more >
Docker Compose release notes
Fixed a race condition, waiting for containers when one exit. Added a warning telling users that uid,gid,mode are not implemented for build.secrets ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found