Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to pull an image with old manifest from pull-through cache #1700

Closed
git-hyagi opened this issue Jul 12, 2024 · 0 comments · Fixed by #1726
Closed

Error when trying to pull an image with old manifest from pull-through cache #1700

git-hyagi opened this issue Jul 12, 2024 · 0 comments · Fixed by #1726
Assignees
Labels

Comments

@git-hyagi
Copy link
Contributor

Describe the bug
Trying to pull an image with old manifest schema using pull-through caching will fail in the first execution:

('pulp [1d3e7a1770b046159c5efc4561c64d4d]: ::ffff:127.0.0.1 - - [12/Jul/2024:13:00:54 +0000] "GET /v2/docker-cache/pulp/redis/manifests/latest HTTP/1.0" 302 0 "-" "containers/5.28.0 (github.com/containers/image)"',)
[2024-07-12 13:00:55 +0000] [4736] [ERROR] Error handling request
Traceback (most recent call last):
...
   File "/src/pulp_container/pulp_container/app/registry.py", line 452, in init_pending_content
     if manifest_data["mediaType"] in (MEDIA_TYPE.MANIFEST_V2, MEDIA_TYPE.MANIFEST_OCI)
 KeyError: 'mediaType'

To Reproduce
Steps to reproduce the behavior:

  • create a pull-through distribution:
REMOTE_HREF=$(curl -sH 'content-type: application/json' -XPOST http://localhost:5001/pulp/api/v3/remotes/container/pull-through/ -d '{"name": "foo", "url": "https://quay.io"}' | jq .pulp_href)
curl -H 'content-type: application/json'  -XPOST http://localhost:5001/pulp/api/v3/distributions/container/pull-through/ -d '{"remote": '${REMOTE_HREF}', "name": "docker-cache", "base_path": "docker-cache"}'
  • try to pull an image with an old manifest
podman pull pulp-container:5001/docker-cache/pulp/redis:latest --tls-verify=false

Expected behavior
It should not raise the KeyError exception and work on the first try.

Additional context
Trying to pull the same content again works.

@git-hyagi git-hyagi self-assigned this Aug 1, 2024
git-hyagi added a commit to git-hyagi/pulp_container that referenced this issue Aug 1, 2024
git-hyagi added a commit to git-hyagi/pulp_container that referenced this issue Aug 1, 2024
@lubosmj lubosmj closed this as completed in 1075b43 Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

2 participants