Skip to content

Fix tag-based manifest pulls 404ing while digest-based pulls succeed#2438

Open
wussh wants to merge 3 commits into
pulp:mainfrom
wussh:fix-2417-tag-manifest-404
Open

Fix tag-based manifest pulls 404ing while digest-based pulls succeed#2438
wussh wants to merge 3 commits into
pulp:mainfrom
wussh:fix-2417-tag-manifest-404

Conversation

@wussh

@wussh wussh commented Jul 26, 2026

Copy link
Copy Markdown

Summary

  • ManifestResponse.from_tag rejected requests based on the client Accept header, raising ManifestNotFound when the tag's manifest media type wasn't explicitly listed. from_manifest (the digest lookup path) never had this check, so the identical content served 200 by digest and 404 by tag — most visible for manifest-list/OCI-index tags whose media type clients often omit from Accept.
  • Regression from Omit redirects to content-app #1974 (8479d527), which moved manifest serving from a content-app redirect (that ignored Accept) into the registry API view.
  • from_tag now mirrors from_manifest: it always serves the tagged manifest, only rewriting schema v1 to the signed content type.

Fixes #2417

Test plan

  • Reworked test_pull_content.py::test_api_performes_schema_conversion (previously asserted a 4xx with the comment "I don't understand what this is testing") into test_api_serves_tag_regardless_of_accept_header, which pulls the same manifest by tag and by digest with a narrow Accept header and asserts identical 200 responses.
  • Reproduced end-to-end on the live domain-scoped, on-demand, follow-latest environment that originally reported Domain-scoped container registry: tag-based manifest fetch 404s, digest-based works (pulpcore 3.113.0 / pulp_container 2.28.0) #2417 (Domains enabled, S3-backed storage, pulpcore 3.113.0 / pulp_container 2.28.0). Pulled the exact live registry_api.py out of the running pulp-api pod, applied only the from_tag diff from this PR on top of it (no unrelated version drift), wrote it back into the running container, and reloaded gunicorn workers (no pod restart). Results:
    • Before patch: tag pull 404, digest pull 200 (matches the issue exactly).
    • After patch: tag pull 200, digest pull 200, tags/list 200, and the tag/digest response bodies are byte-identical.
    • Verified pod stayed healthy throughout, then reverted the pod back to the original unpatched image and re-confirmed the original 404 baseline — no lasting changes were left on the cluster.

@wussh

wussh commented Jul 26, 2026

Copy link
Copy Markdown
Author

Verified this fix end-to-end against the live cluster that originally hit #2417 (Domains + on-demand + follow-latest distribution, S3 storage, pulpcore 3.113.0 / pulp_container 2.28.0):

  • Before: GET /v2/default/quay/prometheus/prometheus/manifests/latest404; the same manifest by digest → 200.
  • After (applying only this PR's from_tag diff to the live registry_api.py, no unrelated changes, then reloading gunicorn workers): tag pull → 200, digest pull → 200, tags/list200, and the tag/digest response bodies are byte-identical.
  • Cluster was left in its original (pre-fix) state afterward — no permanent changes.

wussh added 3 commits July 26, 2026 23:08
ManifestResponse.from_tag rejected requests based on the client Accept
header, raising ManifestNotFound when the tag's manifest media type
wasn't explicitly listed. from_manifest (the digest lookup path) never
had this check, so identical content served 200 by digest and 404 by
tag — most visible with manifest-list/OCI-index tags whose media type
clients often omit from Accept.

This was introduced in 8479d52 (pulp#1974) when manifest serving moved
from a content-app redirect (which ignored Accept) into the registry
API view. from_tag now matches from_manifest: it always serves the
tagged manifest, only rewriting schema v1 to the signed content type.

Fixes pulp#2417
Fixes a ruff UP032 finding introduced by the new test added in this branch.
ruff 0.16.0 (released 2026-07-23) introduced new default lint rules that
flag ~200 pre-existing findings across the codebase unrelated to this PR
(confirmed: a clean checkout of main also fails with 0.16.0, and passes
with 0.15.22). lint_requirements.txt does not pin a version, so CI always
installs latest, breaking every PR touched after that release regardless
of content. Pinning below 0.16 restores a clean lint run without masking
any real issue introduced by this change.

This file carries a "managed by plugin_template" banner; a maintainer may
want to fold the same pin into the template instead of carrying it here
long-term.
@wussh
wussh force-pushed the fix-2417-tag-manifest-404 branch from 319a366 to 75a7a9f Compare July 26, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Domain-scoped container registry: tag-based manifest fetch 404s, digest-based works (pulpcore 3.113.0 / pulp_container 2.28.0)

1 participant