Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2125244 - Sync of a docker type repository containing schema 1 manifest fails with error
Summary: Sync of a docker type repository containing schema 1 manifest fails with error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Pulp
Version: 6.12.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: 6.12.0
Assignee: Ina Panova
QA Contact: Vladimír Sedmík
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-08 12:36 UTC by Vladimír Sedmík
Modified: 2022-11-16 13:36 UTC (History)
5 users (show)

Fixed In Version: pulp_container-2.10.9, pulp_container-2.9.8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-16 13:35:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pulp pulp_container issues 1045 0 None closed signed manifest media type should be translated to v1+json in pulp-api 2022-09-19 14:29:56 UTC
Red Hat Issue Tracker SAT-12817 0 None None None 2022-09-08 14:07:42 UTC
Red Hat Product Errata RHSA-2022:8506 0 None None None 2022-11-16 13:36:00 UTC

Description Vladimír Sedmík 2022-09-08 12:36:11 UTC
Description of problem:
Sync of a docker type repository containing schema 1 manifest fails with error.


Version-Release number of selected component (if applicable):
6.12.0 snap 10


How reproducible:
always


Steps to Reproduce:
1. On a blank Satellite create a Product and a Repository with these specs:
   Type: docker
   Upstream URL: https://quay.io
   Upstream Repository Name: quay/busybox
2. Try to sync the repo.


Actual results:
The sync tasks fails with "undefined method `schema_version' for nil:NilClass" error


Expected results:
The task succeeds and repo is synchronized.


Additional info:
1. I can't reproduce the error in snap 8, so it looks like a regression since then.
2. Another error occurs when syncing a repository with both schemas, for example foreman/foreman from quay.io:
500, message='Internal Server Error', url=URL('https://cdn02.quay.io/sha256/b1/b1f5f4483d8c969c5fedd04eba3d136856153db431d23c3478b00bb3caeac32c?username=None&...')

Comment 1 Daniel Alley 2022-09-08 12:48:13 UTC
500 "Internal server error" doesn't sound like a Pulp problem necessarily. It could be a transient issue with Quay.

Comment 2 Ian Ballou 2022-09-08 13:41:43 UTC
After poking around the database, it looks like the repository in question is not getting the docker manifest indexed from Pulp into the Katello DB.

This has reportedly been reproduced on 3 separate Satellite machines across snaps 9 and 10

Comment 3 Ian Ballou 2022-09-08 14:21:13 UTC
Looks like I found the root issue. In Katello's manifest indexing code, we look for media types: ['application/vnd.docker.distribution.manifest.v1+json', 'application/vnd.docker.distribution.manifest.v2+json']

But, the Pulp API is returning a new manifest media type (+prettyjws):

[root@dhcp-3-187 ~]# pulp show --href /pulp/api/v3/content/container/manifests/?repository_version_added=/pulp/api/v3/repositories/container/container/055b9df9-5ae2-484d-be70-be27f4ee87ee/versions/1/
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "pulp_href": "/pulp/api/v3/content/container/manifests/796a10da-a1a1-4834-ac38-1816dfb4c130/",
      "pulp_created": "2022-09-08T10:57:43.725388Z",
      "artifact": "/pulp/api/v3/artifacts/80b8c577-9f82-47ab-a67c-42f6796dd5b7/",
      "digest": "sha256:ffd944135bc9fe6573e82d4578c28beb6e3fec1aea988c38d382587c7454f819",
      "schema_version": 1,
      "media_type": "application/vnd.docker.distribution.manifest.v1+prettyjws",
      "listed_manifests": [],
      "config_blob": null,
      "blobs": [
        "/pulp/api/v3/content/container/blobs/973153f7-e098-4d59-b7c1-ae3c1a0ed435/",
        "/pulp/api/v3/content/container/blobs/f3930908-96df-471b-bf75-664c3f0186f8/",
        "/pulp/api/v3/content/container/blobs/82af9e66-f3bc-45f2-b183-8d18b5e9012f/"
      ]
    }
  ]
}

I think Katello should just need to start looking out for this "new" media type.  What would be good to know though is if this means older pulp-container needs to return the signed manifest type.

Comment 4 Ian Ballou 2022-09-08 14:24:46 UTC
Edit: it sounds like Pulp shouldn't be returning this new media_type via the repository versions API. It cannot be filtered for: https://docs.pulpproject.org/pulp_container/restapi.html#tag/Content:-Manifests/operation/content_container_manifests_list

Comment 5 Ian Ballou 2022-09-08 14:41:58 UTC
After a discussion with Ina, I'm changing this to the Pulp component since the signed media type shouldn't be presented via the API.

Comment 6 Ina Panova 2022-09-08 14:53:42 UTC
This change makes it so that the media type is taken from response headers https://github.com/pulp/pulp_container/commit/89548413a8ab78af83cd34412062eb149dd41b09#diff-b4450b457692a725eeadc0ef7b13abfb35f2969203ee4c21bea33b2d8bbf37dbR28 which happens to be signed manifest. There question is how the heck it got saved if we enforce this on the DB level with the choices fields which do not have among the signed media_type https://github.com/pulp/pulp_container/blob/main/pulp_container/app/models.py#L93

Comment 8 Ina Panova 2022-09-14 13:32:18 UTC
The fix is available in pulp-container 2.10.9 and 2.9.8

Comment 9 Vladimír Sedmík 2022-09-23 15:00:57 UTC
Verified in 6.12.0 snap 12

Comment 11 Ian Ballou 2022-11-02 19:12:00 UTC
*** Bug 2134682 has been marked as a duplicate of this bug. ***

Comment 14 errata-xmlrpc 2022-11-16 13:35:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.12 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:8506


Note You need to log in before you can comment on or make changes to this bug.