toomanyrequests policy resource_error ai_generated true

Error: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating.

ID: policy/github-container-registry-pull-limit-exceeded

Also available as: JSON · Markdown · 中文
88%Fix Rate
87%Confidence
1Evidence
2024-02-10First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
GitHub Container Registry (2024-01) active
Docker 24.0 active

Root Cause

GitHub Container Registry enforces anonymous pull rate limits; unauthenticated requests hit the limit quickly.

generic

中文

GitHub容器注册表对匿名拉取实行速率限制;未经身份验证的请求会快速达到限制。

Official Documentation

https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry

Workarounds

  1. 90% success Authenticate to GitHub Container Registry: `echo $GITHUB_TOKEN | docker login ghcr.io -u USERNAME --password-stdin` then retry the pull.
    Authenticate to GitHub Container Registry: `echo $GITHUB_TOKEN | docker login ghcr.io -u USERNAME --password-stdin` then retry the pull.
  2. 92% success In CI/CD, set the GITHUB_TOKEN environment variable and use `docker login ghcr.io -u $GITHUB_ACTOR -p $GITHUB_TOKEN` before pulling images.
    In CI/CD, set the GITHUB_TOKEN environment variable and use `docker login ghcr.io -u $GITHUB_ACTOR -p $GITHUB_TOKEN` before pulling images.

中文步骤

  1. Authenticate to GitHub Container Registry: `echo $GITHUB_TOKEN | docker login ghcr.io -u USERNAME --password-stdin` then retry the pull.
  2. In CI/CD, set the GITHUB_TOKEN environment variable and use `docker login ghcr.io -u $GITHUB_ACTOR -p $GITHUB_TOKEN` before pulling images.

Dead Ends

Common approaches that don't work:

  1. 70% fail

    The limit resets slowly (typically 1-6 hours); waiting may not be practical for CI/CD pipelines.

  2. 60% fail

    The error is specific to GitHub Container Registry; switching registries requires configuration changes and may break dependencies.

  3. 90% fail

    GitHub does not allow users to increase the limit; authentication is the only mitigation.