actions / runner

The Runner for GitHub Actions :rocket:
https://github.com/features/actions
MIT License
4.76k stars 925 forks source link

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

Open FRABUCHI opened 1 month ago

FRABUCHI commented 1 month ago

Describe the bug I'm experiencing intermittent errors when attempting to log in to Docker on GitHub Enterprise using a self-hosted runner.

The error resembles the one discussed in this issue.

I am trying to log in to Harbor, but there are no error traces in the Harbor logs corresponding to these login attempts.

When login information is incorrect, I expect an unauthorized error, but instead, I receive an error message saying "Docker login for [harbor url] failed with exit code 1".

I suspect the problem might be related to the runner. Notably, the workflow works correctly if I re-run the failed job.

To Reproduce Steps to reproduce the behavior:

  1. Go to the job configuration.
  2. Run the GitHub Actions workflow.
  3. Observe the error.
  4. Re-run the failed workflow.
  5. Observe that it runs successfully the second time.

Expected behavior This docker login should succeed every time without exception

Runner Version and Platform

Version of your runner? 2.311.0

OS of the machine running the runner? Amazon Linux 2

What's not working?

The intermittent error occurs during the Docker login command to Harbor. The specific error is:

Docker login for [harbor url] failed with exit code 1

jobs:
  publish-events:
    runs-on:
      - gprunner
      - pool=m5a.large
    container:
      image: [harbor url]/devops/actions/devops:latest
      credentials:
        username: temp@example.com
        password: ${{ secrets.HARBOR_PASSWORD }}
스크린샷 2024-07-11 오후 4 57 30

The workflow works correctly when re-run.

nsudhanva commented 1 month ago

Can confirm that the same error is happening with ECR as well:

Checking docker version
Clean up resources from previous jobs
Create local container network
Starting job container
  /usr/local/bin/docker --config /runner/_work/_temp/.docker_23e[8](https://github.com/***/***/actions/runs/9921460081/job/27410175185#step:3:9)bb56-03f0-455f-ad36-3bb699f691cc login ***.dkr.ecr.us-east-1.amazonaws.com -u *** --password-stdin
  Warning: Docker login for '0[15](https://github.com/***/***/actions/runs/9921460081/job/27410175185#step:3:18)551053535.dkr.ecr.us-east-1.amazonaws.com' failed with exit code 1, back off 2.521 seconds before retry.
  /usr/local/bin/docker --config /runner/_work/_temp/.docker_23e8bb56-03f0-455f-ad36-3bb699f691cc login ***.dkr.ecr.us-east-1.amazonaws.com -u *** --password-stdin
  Warning: Docker login for '***.dkr.ecr.us-east-1.amazonaws.com' failed with exit code 1, back off 3.036 seconds before retry.
  /usr/local/bin/docker --config /runner/_work/_temp/.docker_23e8bb56-03f0-455f-ad36-3bb699f691cc login ***.dkr.ecr.us-east-1.amazonaws.com -u *** --password-stdin
  Error: Docker login for '***.dkr.ecr.us-east-1.amazonaws.com' failed with exit code 1

This I have tested and tried so far:

Runner Version and Platform

spindev commented 1 month ago

We are facing the same issue with GitHub Container Registry for GHES using the normal GITHUB_TOKEN.

Runner version: 2.314.1 Runner os:

mark-pearson-bluefruit commented 1 month ago

We are facing the same issue. Here is the evidence image image