login-action icon indicating copy to clipboard operation
login-action copied to clipboard

Intermittent failures on logging in with Google Artifact Registry

Open yairhay-di opened this issue 1 year ago • 11 comments

Contributing guidelines

I've found a bug, and:

  • [x] The documentation does not mention anything about my problem
  • [x] There are no open or closed issues that are related to my problem

Description

When running the login action # - name: Login to GAR # id: docker_gar # uses: docker/login-action@v3 We intermittently experiencing the following error: Error: Error response from daemon: Get "https://${region}-docker.pkg.dev/v2/": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

Most of the time it works, but sometimes it fails.

Expected behaviour

To login successfuly

Actual behaviour

Error: Error response from daemon: Get "https://${region}-docker.pkg.dev/v2/": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

Repository URL

No response

Workflow run URL

No response

YAML workflow

`    # - name: Login to GAR
    #   id: docker_gar
    #   uses: docker/login-action@v3`

Workflow logs

No response

BuildKit logs


Additional info

No response

yairhay-di avatar Aug 13 '25 13:08 yairhay-di

Same here

joaodiogocosta avatar Aug 13 '25 15:08 joaodiogocosta

with

Run docker/login-action@v3
  with:
    registry: us.gcr.io
    username: oauth2accesstoken
    password: ***
    ecr: auto
    logout: true

getting

Error: Error response from daemon: Get "https://us.gcr.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

austinpray-mixpanel avatar Aug 13 '25 19:08 austinpray-mixpanel

Do you still repro? Might be smth flaky with Google Artifact Registry

crazy-max avatar Sep 29 '25 10:09 crazy-max

Same here, but for a self hosted registry. I haven't had any issues elsewhere with that registry, and rerunning a few times usually fixes it. Would it be possible to just add a retry count?

jsmith212 avatar Dec 15 '25 18:12 jsmith212

We're seeing a similar behaviour every now and then and it's happening more frequently lately:

  with:
    registry: gcr.io
    username: _json_key
    password: ***
  
    logout: true
Logging into gcr.io...
Error: Error response from daemon: login attempt to https://gcr.io/v2/ failed with status: 401 Unauthorized

moicalcob avatar Jan 28 '26 12:01 moicalcob

Our actions are completely down due to unable to pull:

Unable to find image 'docker.pkg.github.com/**/**/**:head' locally
docker: Error response from daemon: unknown: failed to resolve reference "docker.pkg.github.com/**/**/**:head": unexpected status from HEAD request to https://docker.pkg.github.com/v2/**/**/**/manifests/head: 401 Unauthorized

The login works fine before it?

Run docker/login-action@v3
Logging into docker.pkg.github.com...
Login Succeeded!

Anyone else experiencing the same issue?

matthiasPOE avatar Feb 13 '26 10:02 matthiasPOE

Our actions are completely down due to unable to pull:

Unable to find image 'docker.pkg.github.com/**/**/**:head' locally
docker: Error response from daemon: unknown: failed to resolve reference "docker.pkg.github.com/**/**/**:head": unexpected status from HEAD request to https://docker.pkg.github.com/v2/**/**/**/manifests/head: 401 Unauthorized

The login works fine before it?

Run docker/login-action@v3
Logging into docker.pkg.github.com...
Login Succeeded!

Anyone else experiencing the same issue?

That's unrelated with this issue that is about GAR. Also docker.pkg.github.com is EOL, switch to ghcr.io: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-docker-registry

crazy-max avatar Feb 13 '26 12:02 crazy-max

is this really triage since Aug 2025...?

esavier avatar Feb 26 '26 14:02 esavier

here, a PR. generally network issue. Error is forwarded from docker and is misleading.

esavier avatar Feb 26 '26 15:02 esavier

This smells like transient network / registry edge flake rather than a deterministic auth/config bug.

Two concrete guardrails that usually collapse this class fast:

  1. Retry transient failures only (timeout / connection reset / EOF), with a hard cap + jittered backoff.

    • e.g. 3 attempts, 2s → 4s → 8s (+ jitter)
    • Never retry 401/403 (those are terminal: creds/permissions).
  2. Emit a tiny “receipt” per attempt so we can separate:

    • DNS vs TCP connect vs TLS handshake vs “awaiting headers”
    • runner context (hosted vs self-hosted, region if known)
    • latency_ms + error_class

If maintainers are open to it, docker/login-action could accept something like retry_max + retry_backoff_ms (or implement internally around the docker login call), but only for known transient error classes.

Happy to help draft the minimal classification list + defaults.

———

If you can share 5–20 redacted failure receipts (timestamps + error string + latency), I can turn it into a ranked hazard signature.

SirBrenton avatar Feb 26 '26 19:02 SirBrenton

Closing in favor of #750.

This looks like the same underlying class of workflow reliability problem, and I'd rather keep the retry discussion tracked in one place instead of splitting it across multiple issues.

The current direction is that action-specific retry logic in login-action is not the right abstraction, so I'm consolidating this under the broader discussion in #750.

crazy-max avatar Apr 02 '26 17:04 crazy-max