Bug 2257957

Summary: Error when synchronizing custom container repo (https://registry-1.docker.io)
Product: Red Hat Satellite Reporter: Satyajit Das <sadas>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: sganar
Severity: high Docs Contact:
Priority: high    
Version: 6.14.1CC: ahumbe, dalley, lmjachky, rlavi, shwsingh, zhunting
Target Milestone: 6.15.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pulp-container-2.16.0, pulp-container-2.14.10 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-04-23 17:17:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Satyajit Das 2024-01-11 19:18:42 UTC
Description of problem:
When trying to sync images from registry-1.docker.io to satellite, it fails with an error.

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

6.14

How reproducible:

100%

Steps to Reproduce:

1. Create a docker-type repo:
--------------------------------------------
# hammer repository info --id 82
Id:                          82
Name:                        elasticsearch
Label:                       elasticsearch
Description:                 
Organization:                RedHat
Red Hat Repository:          no
Content Type:                docker
Content Label:               RedHat_Convert2RHEL_elasticsearch
Mirroring Policy:            Content Only
Url:                         https://registry-1.docker.io
Publish Via HTTP:            yes
Published At:                satellite.example.com/redhat-convert2rhel-elasticsearch
Relative Path:               redhat-convert2rhel-elasticsearch
Download Policy:             immediate
Upstream Repository Name:    elasticsearch
Container Image Tags Filter: 
Container Repository Name:   redhat-convert2rhel-elasticsearch
HTTP Proxy:                  
    HTTP Proxy Policy: global_default_http_proxy
Product:                     
    Id:   308
    Name: Convert2RHEL
GPG Key:                     

Sync:                        
    Status:         Warning
    Last Sync Date: about 1 hour
Created:                     2024/01/09 20:15:29
Updated:                     2024/01/10 15:19:45
Content Counts:              
    Container Image Manifest Lists: 0
    Container Image Manifests:      0
    Container Image Tags:           0

--------------------------------------------

2. Try to sync it.


Actual results:

Katello::Errors::Pulp3Error

{'errors': [{'code': ErrorDetail(string='MANIFEST_INVALID', code='parse_error'), 'message': ErrorDetail(string="manifests.2.mediaType: 'application/vnd.docker.distribution.manifest.v2+json' is not one of ['application/vnd.oci.image.manifest.v1+json', 'application/vnd.oci.image.index.v1+json']", code='parse_error'), 'detail': {'digest': ErrorDetail(string='2cadca6c21de5802b085f25532bba11cb893589b64ca8c94d62ac69eec923fad', code='parse_error')}}]}


Expected results:

Content should be synced without any issue.

Additional info:

Comment 6 Daniel Alley 2024-01-15 15:43:57 UTC
Should already be fixed in the latest 6.15.0 snap, so I'm adding

Comment 7 lmjachky 2024-01-15 16:10:00 UTC
The fix has landed into pulp-container 2.14.10. Please, verify the patch in the workflow again.

https://pypi.org/project/pulp-container/2.14.10/
https://github.com/pulp/pulp_container/pull/1461

Comment 8 sganar 2024-01-25 17:26:16 UTC
Verified.

Tested on Satellite 6.15.0 Snap 8.0

Steps followed: 
1. Create a docker-type repo(https://registry-1.docker.io/)
2. Sync the repo

Observation:
Content synced successfully without any errors

hammer repository info --id 5
Id:                        5
Name:                      docker-repo
Label:                     docker-repo
Description:               
Organization:              Default Organization
Red Hat Repository:        no
Content Type:              docker
Content Label:             Default_Organization_docker_docker-repo
Mirroring Policy:          Content Only
Url:                       https://registry-1.docker.io/
Publish Via HTTP:          yes
Published At:              satellite.example.com/default_organization-docker-docker-repo
Relative Path:             default_organization-docker-docker-repo
Download Policy:           immediate
Upstream Repository Name:  centos
Container Repository Name: default_organization-docker-docker-repo
HTTP Proxy:                
    HTTP Proxy Policy: global_default_http_proxy
Product:                   
    Id:   129
    Name: docker
GPG Key:                   

Sync:                      
    Status:         Success
    Last Sync Date: 16 minutes
Created:                   2024/01/25 16:43:26
Updated:                   2024/01/25 17:02:37
Content Counts:            
    Container Image Manifest Lists: 20
    Container Image Manifests:      36
    Container Image Tags:           49

Comment 11 errata-xmlrpc 2024-04-23 17:17:08 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.15.0 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-2024:2010