+++ This bug was initially created as a clone of Bug #2063955 +++ Description of problem: When using the skip-missing or continue-on-error flags, oc-mirror exits with an error when images are not available to be mirrored. Version-Release number of selected component (if applicable): 4.10.3 How reproducible: When associated operator images are not available as specified within an imageset-config. Steps to Reproduce: 1. Annotate a full operator catalog or headsOnly operator catalog within an imageset-config 2. Set '--skip-missing` or `--continue-on-error` on oc-mirror command execution. Actual results: ``` error: unable to retrieve source image registry.redhat.io/rhpam-7/rhpam-kogito-rhel8-operator manifest sha256:7aa5491e5d26b29cd0e271d24996e587a65b50f5a8d871bd004b53da65ee0038: error parsing HTTP 404 response body: invalid character 'N' looking for beginning of value: "Not found\n" error: unable to retrieve source image registry.access.redhat.com/ubi8/openjdk-11 manifest sha256:308113a00212e3b006e0f5a955f4743a1604b39f18aca1bf5e0275ac0aeb7d44: error parsing HTTP 404 response body: invalid character 'N' looking for beginning of value: "Not found\n" ``` Expected results: We expect oc-mirror to generate an imageset absent the unavailable content. Additional info:
checked with latest oc , without the option --continue-on-error, will hit error: more imageset.yaml apiVersion: mirror.openshift.io/v1alpha1 kind: ImageSetConfiguration storageConfig: #registry: # imageURL: fx2-1a.cloud.lab.eng.bos.redhat.com:8443/ocp4/openshift4 # skipTLS: true local: path: /home/ocmirrortest mirror: operators: - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.8 # References entire catalog oc-mirror --config imageset.yaml file:// .... manifests: sha256:6600235d0eabfd36a5815ba29c4f9c089995f58c39e0d79adbf95f7bed496da6 sha256:7af235e60e15603183aec7c244754edee3b87ba601d1b28e999607f372174b0c sha256:9e71857cef213e38b57aedebfbfd89a019c6f370cd0252000576a75e97edf9f2 sha256:abe91ddeb37d230c660cd9d3d2bb90818c5bcb0ee5e7f81c64fb811626f088d7 sha256:6600235d0eabfd36a5815ba29c4f9c089995f58c39e0d79adbf95f7bed496da6 -> 44379bee sha256:abe91ddeb37d230c660cd9d3d2bb90818c5bcb0ee5e7f81c64fb811626f088d7 -> 526bd197 stats: shared=462 unique=4889 size=165.2GiB ratio=0.87 error: unable to retrieve source image registry.access.redhat.com/ubi8/openjdk-11 manifest sha256:03ba993c5d7459eb2d92b4c88ac3561633d05716760e62e5da5f04292ae287b8: error parsing HTTP 404 response body: invalid character 'N' looking for beginning of value: "Not found\n" error: unable to retrieve source image registry.redhat.io/rhpam-7/rhpam-kogito-rhel8-operator manifest sha256:7aa5491e5d26b29cd0e271d24996e587a65b50f5a8d871bd004b53da65ee0038: error parsing HTTP 404 response body: invalid character 'N' looking for beginning of value: "Not found\n" error mirroring image: an error occurred during planning error: image "registry.redhat.io/3scale-amp2/3scale-rhel7-operator-metadata@sha256:55166d313d270ae4740a260149bfb41df1af8214744e9c38abef07add49c95de" is invalid or does not exist
oc-mirror version Client Version: version.Info{Major:"0", Minor:"1", GitVersion:"v0.1.0", GitCommit:"63d070c19e8f5b6c84b0b3339102c307ad1cac05", GitTreeState:"clean", BuildDate:"2022-03-31T17:05:48Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"} oc-mirror --config imageset.yaml file:// --continue-on-error ...... manifests: sha256:6600235d0eabfd36a5815ba29c4f9c089995f58c39e0d79adbf95f7bed496da6 sha256:7af235e60e15603183aec7c244754edee3b87ba601d1b28e999607f372174b0c sha256:9e71857cef213e38b57aedebfbfd89a019c6f370cd0252000576a75e97edf9f2 sha256:abe91ddeb37d230c660cd9d3d2bb90818c5bcb0ee5e7f81c64fb811626f088d7 sha256:6600235d0eabfd36a5815ba29c4f9c089995f58c39e0d79adbf95f7bed496da6 -> 44379bee sha256:abe91ddeb37d230c660cd9d3d2bb90818c5bcb0ee5e7f81c64fb811626f088d7 -> 526bd197 stats: shared=462 unique=4889 size=165.2GiB ratio=0.87 error: unable to retrieve source image registry.access.redhat.com/ubi8/openjdk-11 manifest sha256:03ba993c5d7459eb2d92b4c88ac3561633d05716760e62e5da5f04292ae287b8: error parsing HTTP 404 response body: invalid character 'N' looking for beginning of value: "Not found\n" error: unable to retrieve source image registry.redhat.io/rhpam-7/rhpam-kogito-rhel8-operator manifest sha256:7aa5491e5d26b29cd0e271d24996e587a65b50f5a8d871bd004b53da65ee0038: error parsing HTTP 404 response body: invalid character 'N' looking for beginning of value: "Not found\n" phase 0: rh-sso-7/sso74-openshift-rhel8 blobs=4 mounts=0 manifests=1 shared=0 openshift4/ose-ptp-operator-metadata blobs=2 mounts=0 manifests=1 shared=0 rhmtc/openshift-migration-operator-bundle blobs=6 mounts=0 manifests=3 shared=0 quay/quay-container-security-operator-bundle blobs=6 mounts=0 manifests=3 shared=0 rhosdt/opentelemetry-operator-bundle blobs=2 mounts=0 manifests=1 shared=0 quay/quay-openshift-bridge-rhel8-operator-metadata blobs=2 mounts=0 manifests=1 shared=0 ...... with the option --continue-on-error, the oc-mirror could continue works well , so will move to verified status.
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: OpenShift Container Platform 4.10.8 bug fix and security update), 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:1162