Skip to content

tags/list drops tags that are a lexical prefix of another tag (S3 storage driver, regression in 3.1.0) #4891

Closed

Description

@FD-HH

Description

With the S3 storage driver, GET /v2/<name>/tags/list omits any tag whose name is a lexical prefix of another tag in the same repository. The shorter tag is returned and the longer one is dropped, e.g. 0.1.2 is returned but 0.1.20 is not.

The dropped tag is otherwise fully functional — GET /v2/<name>/manifests/<dropped-tag> returns 200 and the image is pullable. It is only missing from the tag listing.

This breaks any client that relies on the tag list, most notably Helm OCI semver resolution: helm pull --version "^0.1.0" against a repo containing 0.1.2, 0.1.3, 0.1.19, 0.1.20, 0.2.0 resolves to 0.1.19 instead of 0.1.20, because 0.1.20 is absent from the catalog.

Reproduction (self-contained, public images)

docker network create rnet

# S3-compatible backend
docker run -d --name minio --network rnet \
  -e MINIO_ROOT_USER=minioadmin -e MINIO_ROOT_PASSWORD=minioadmin \
  minio/minio server /data
docker run --rm --network rnet --entrypoint sh minio/mc -c \
  'mc alias set m http://minio:9000 minioadmin minioadmin && mc mb -p m/registry'

# registry 3.1.1 backed by the S3 driver
docker run -d --name reg --network rnet -p 5000:5000 \
  -e REGISTRY_STORAGE=s3 \
  -e REGISTRY_STORAGE_S3_REGION=us-east-1 \
  -e REGISTRY_STORAGE_S3_REGIONENDPOINT=http://minio:9000 \
  -e REGISTRY_STORAGE_S3_BUCKET=registry \
  -e REGISTRY_STORAGE_S3_ACCESSKEY=minioadmin \
  -e REGISTRY_STORAGE_S3_SECRETKEY=minioadmin \
  -e REGISTRY_STORAGE_S3_FORCEPATHSTYLE=true \
  -e REGISTRY_STORAGE_S3_SECURE=false \
  registry:3.1.1

# push a few tags, including prefix-overlapping ones
crane copy --insecure gcr.io/distroless/static:nonroot localhost:5000/repro:base
for t in 0.1.2 0.1.20 1.2 1.20 1.3; do crane tag --insecure localhost:5000/repro:base "$t"; done

curl -s localhost:5000/v2/repro/tags/list

Actual result

{"name":"repro","tags":["0.1.2","1.2","1.3","base"]}

0.1.20 and 1.20 are missing, even though curl -s -o /dev/null -w '%{http_code}' localhost:5000/v2/repro/manifests/0.1.20 returns 200.

Expected result

{"name":"repro","tags":["0.1.2","0.1.20","1.2","1.20","1.3","base"]}

Regression range

Same MinIO backend, same tag set:

Version Storage driver Result
3.0.0 s3 ✅ all tags listed
3.1.0 s3 ❌ 0.1.20, 1.20 dropped
3.1.1 s3 ❌ 0.1.20, 1.20 dropped
3.1.1 filesystem ✅ all tags listed

Introduced in 3.1.0, still present in 3.1.1 (latest), and specific to the S3 storage driver (filesystem is unaffected). It looks like S3 tag enumeration treats a tag name as a path prefix of another, dropping the longer entry.

Environment

  • distribution/distribution registry:3.1.1 (and 3.1.0)
  • S3 driver against MinIO (also observed against AWS S3)
  • Clients: crane, helm (OCI), plain curl

Activity

  1. JR40159 commented on Jun 8, 2026

    @JR40159

    We are also having the same issue when using versions 3.1.1 and 3.1.0 with the S3 storage driver.

  2. milosgajdos commented on Jun 8, 2026

    @milosgajdos
    Member

    Uh oh, interesting. Hmm, feel free to open a PR - I dont think I'll have time for it this week.

  3. added a commit that references this issue on Jun 15, 2026
    d1dbbb1
  4. FD-HH commented on Jun 15, 2026

    @FD-HH
    Author

    Big thanks to @milosgajdos for providing a fix for this!
    I saw your comment last week but didn't get around to make myself familiar with the code base yet, so I really appreciate the quick fix here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions