cli icon indicating copy to clipboard operation
cli copied to clipboard

start: slim images (SUPABASE_USE_SLIM_IMAGES) have no fallback to the ECR Public mirror when GHCR returns toomanyrequests

Open luizfneves404 opened this issue 1 month ago • 0 comments

Affected area

Docker

Supabase CLI version

2.120.0 (the code path below is unchanged in v2.122.0 and on develop)

Operating system

Ubuntu 24.04 (GitHub Actions runners, Ubicloud standard-4)

Installation method

pnpm

Command

SUPABASE_USE_SLIM_IMAGES=1 supabase start -x <unused services>

Actual output

When GHCR throttles, every slim image fails all three attempts on ghcr.io and start gives up, without trying the ECR Public copy of the same digest:

Error response from daemon: toomanyrequests: retry-after: 173.687µs, allowed: 44000/minute
Retrying after 4s: ghcr.io/supabase/cli/postgres:17.11.0.004-r1@sha256:8fb7ae7cd0d8121c460c8756d7f2791ce9a19c3331b46987456dfa4f8b45d701
...
Retrying after 8s: ghcr.io/supabase/cli/postgres:17.11.0.004-r1@sha256:8fb7ae7c...
failed to pull docker image from all registries: ghcr.io/supabase/cli/postgres:17.11.0.004-r1@sha256:8fb7ae7c... attempt 1: ... toomanyrequests ...; ... attempt 3: ... toomanyrequests ...

The same happened for auth, realtime and storage in the same run. Over 10 days of CI, this failed 11 jobs in 6 runs, in two bursts (2026-10-22 ~17:22 UTC and 2026-10-26 16:16-17:44 UTC), across unrelated branches. Re-runs passed.

Expected behavior

supabase start with slim images falls back to public.ecr.aws/supabase/cli/<service> at the same digest when GHCR fails, as the regular images already fall back across public.ecr.aws → ghcr.io/supabase → docker.io/supabase.

The mirror is already there: ADR 0026 ("Registry and bucket mirrors") publishes each slim image digest-preserving to ECR Public, and the stack runtime already uses it (packages/stack/src/runtime/Container.ts, imageMirrors: "pulls a catalog image from GHCR first and falls back to the same reference on ECR Public"). I checked that the failing digest above resolves on public.ecr.aws/supabase/cli/postgres.

The legacy start path does not use it. getRegistryImageUrlCandidates in apps/cli/src/command-internal/docker-registry.ts returns [imageName] for any slim ref, so the slim images have a single registry and no fallback. SUPABASE_INTERNAL_IMAGE_REGISTRY cannot help either: slim refs skip every rewrite, and setting it turns off the fallback for the regular images.

A possible fix: for a slim ref, return [ghcrRef, ghcrRef with the ghcr.io/supabase/cli/ prefix replaced by public.ecr.aws/supabase/cli/], digest kept, so the existing per-candidate retry walks to ECR.

The allowed: 44000/minute limit seems to be GHCR-wide, not per client. trivy hit the same message in 2024 (aquasecurity/trivy-action#389), and users there reported that authenticating did not avoid it.

Steps to reproduce

  1. Run SUPABASE_USE_SLIM_IMAGES=1 supabase start on a clean Docker daemon while GHCR is returning toomanyrequests (it happens in bursts, so it is easiest to see from CI history).
  2. To see the missing fallback without waiting for a burst, block ghcr.io (for example 127.0.0.1 ghcr.io in /etc/hosts) and run SUPABASE_USE_SLIM_IMAGES=1 supabase start. The pull fails after 3 GHCR attempts per image and never tries public.ecr.aws/supabase/cli. Without SUPABASE_USE_SLIM_IMAGES, the regular images pull from public.ecr.aws and the block has no effect.

Crash report ID

No response


This report was drafted with an AI coding agent (Claude Code) from our CI logs and your source. The code references, the digest check and the counts were verified against them.

luizfneves404 avatar Oct 26 '26 20:10 luizfneves404