Bug 1800658

Summary: oc adm catalog build fails if just one of the image in the catalog is missing
Product: OpenShift Container Platform Reporter: Simone Tiraboschi <stirabos>
Component: OLMAssignee: Evan Cordell <ecordell>
OLM sub component: OLM QA Contact: Jian Zhang <jiazha>
Status: CLOSED DUPLICATE Docs Contact:
Severity: unspecified    
Priority: unspecified CC: aos-bugs, ecordell, jiazha, jokerman, mfojtik
Version: 4.3.z   
Target Milestone: ---   
Target Release: 4.3.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-11 04:48:39 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 Simone Tiraboschi 2020-02-07 16:33:07 UTC
Description of problem:
see: https://bugzilla.redhat.com/1797804 for details

oc adm catalog build is designed to mirror the whole catalog but if just one of the images founds on the catalog, for any reasons, is missing/invalid/corrupted the tool will complete fail:

Example:

oc adm catalog build --appregistry-endpoint https://quay.io/cnr --appregistry-org redhat-operators --to=localhost:5000/my/catalog:4 --auth-token="$QUAY_TOKEN"

Uploading ... 6.967MB/s
Pushed sha256:909e71757eaf64c4d3fe952b51671a2e87e621fe6051d0501d3a16cbfafd45cd to localhost:5000/my/catalog:4
 
oc adm catalog mirror --dry-run --to-manifests manifests localhost:5000/my/catalog:4 localhost:5000

error: unable to retrieve source image registry.redhat.io/container-native-virtualization/virt-operator manifest sha256:c14ce478337b4fb57e65217ac956572db4619bf405d63d8f860ff1b53699b2fb: error parsing HTTP 404 response body: invalid character 'F' looking for beginning of value: "File not found.\""
...
W0131 22:51:32.755612    5638 mirror.go:227] errors during mirroring. the full contents of the catalog may not have been mirrored: mirroring failed: an error occurred during planning
I0131 22:51:32.789577    5638 mirror.go:298] wrote mirroring manifests to manifests
 

Version-Release number of selected component (if applicable):
oc version
Client Version: 4.3.0-0.nightly-2020-01-31-100500
Server Version: 4.3.0-0.nightly-2020-01-31-100500

How reproducible:
Always


Steps to Reproduce:
1. try to mirror a catalog with oc adm catalog build while one of the image in the catalog is missing
2.
3.

Actual results:
W0131 22:51:32.755612    5638 mirror.go:227] errors during mirroring. the full contents of the catalog may not have been mirrored: mirroring failed: an error occurred during planning
I0131 22:51:32.789577    5638 mirror.go:298] wrote mirroring manifests to manifests

Expected results:
1. the tool should provide an option to ignore errors on missing images and continue with what's available
2. the tool should provide an option to let the user blacklist broken images or packages

Additional info:

Comment 2 Red Hat Bugzilla 2023-09-14 05:52:06 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days