openshift / oc-mirror

Lifecycle manager for internet-disconnected OpenShift environments
Apache License 2.0
88 stars 80 forks source link

OCPBUGS-33098: fix: generates a file with errors during mirroring #843

Closed aguidirh closed 5 months ago

aguidirh commented 5 months ago

Description

This PR generates a file with all the errors that happened during the mirroring process. In this way customers can audit their target registry to check if the errors really happened or they were only flake errors.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Using the following ImageSetConfiguration:

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v2alpha1
mirror:
  platform:
    channels:
    - name: stable-4.13
      minVersion: 4.13.10
      maxVersion: 4.13.10
    graph: true
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
      packages:
       - name: aws-load-balancer-operator
       - name: 3scale-operator
       - name: node-observability-operator
  additionalImages: 
   - name: registry.redhat.io/ubi8/ubi:latest
   - name: registry.redhat.io/ubi9/ubi@sha256:20f695d2a91352d4eaa25107535126727b5945bff38ed36a3e59590f495046f0

Step 1 - mirror to disk:

./bin/oc-mirror -c ./alex-tests/alex-isc/isc.yaml file:///home/aguidi/go/src/github.com/aguidirh/oc-mirror/alex-tests/ocpbugs-33098 --v2

Step 2 - disk to mirror and stopped the target registry in the middle of the mirroring:

./bin/oc-mirror -c ./alex-tests/alex-isc/isc.yaml --from file:///home/aguidi/go/src/github.com/aguidirh/oc-mirror/alex-tests/ocpbugs-33098 docker://localhost:6000 --v2
podman stop local-registry

Expected Outcome

Errors on the log output and also a file generated with all errors occurred under working-dir/logs/

2024/04/30 17:05:12  [ERROR]  : [Worker] some errors happened during the mirroring - refer to /home/aguidi/go/src/github.com/aguidirh/oc-mirror/alex-tests/ocpbugs-33098/working-dir/logs/mirroring_errors_20240430_170512.txt for more details 

The file looks like this (trimmed with only 3 lines for example purposes):

error mirroring image docker://registry.redhat.io/redhat/redhat-operator-index:v4.15 error: copying image 1/4 from manifest list: trying to reuse blob sha256:3059f6068401e6b82194cb486bf75573bd18356796e1010a73d575704723cc31 at destination: pinging container registry localhost:6000: Get "http://localhost:6000/v2/": dial tcp [::1]:6000: connect: connection refused
error mirroring image registry.redhat.io/ubi8/ubi:latest error: copying image 1/4 from manifest list: trying to reuse blob sha256:2efec45cd878dd2784f6aa8338e6f4a788be9a65fd288fe555bc971308f70615 at destination: pinging container registry localhost:6000: Get "http://localhost:6000/v2/": dial tcp [::1]:6000: connect: connection refused
error mirroring image registry.redhat.io/ubi9/ubi@sha256:20f695d2a91352d4eaa25107535126727b5945bff38ed36a3e59590f495046f0 error: copying image 1/4 from manifest list: trying to reuse blob sha256:31aa511859523410c08f48a15c0c0d84b738c8c9e46d980549917b822e7449fa at destination: pinging container registry localhost:6000: Get "http://localhost:6000/v2/": dial tcp [::1]:6000: connect: connection refused
openshift-ci-robot commented 5 months ago

@aguidirh: This pull request references Jira Issue OCPBUGS-33098, which is invalid:

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to [this](https://github.com/openshift/oc-mirror/pull/843): ># Description > >This PR generates a file with all the errors that happened during the mirroring process. In this way customers can audit their target registry to check if the errors really happened or they were only flake errors. > >Fixes # (issue) > >## Type of change > >Please delete options that are not relevant. > >- [x] Bug fix (non-breaking change which fixes an issue) >- [ ] New feature (non-breaking change which adds functionality) >- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) >- [ ] This change requires a documentation update > ># How Has This Been Tested? > >Using the following ImageSetConfiguration: > >``` >kind: ImageSetConfiguration >apiVersion: mirror.openshift.io/v2alpha1 >mirror: > platform: > channels: > - name: stable-4.13 > minVersion: 4.13.10 > maxVersion: 4.13.10 > graph: true > operators: > - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15 > packages: > - name: aws-load-balancer-operator > - name: 3scale-operator > - name: node-observability-operator > additionalImages: > - name: registry.redhat.io/ubi8/ubi:latest > - name: registry.redhat.io/ubi9/ubi@sha256:20f695d2a91352d4eaa25107535126727b5945bff38ed36a3e59590f495046f0 >``` > >Step 1 - mirror to disk: > >``` >./bin/oc-mirror -c ./alex-tests/alex-isc/isc.yaml file:///home/aguidi/go/src/github.com/aguidirh/oc-mirror/alex-tests/ocpbugs-33098 --v2 >``` > >Step 2 - disk to mirror and stopped the target registry in the middle of the mirroring: > >``` >./bin/oc-mirror -c ./alex-tests/alex-isc/isc.yaml --from file:///home/aguidi/go/src/github.com/aguidirh/oc-mirror/alex-tests/ocpbugs-33098 docker://localhost:6000 --v2 >``` >``` >podman stop local-registry >``` > >## Expected Outcome >Errors on the log output and also a file generated with all errors occurred under working-dir/logs/ > >``` >2024/04/30 17:05:12 [ERROR] : [Worker] some errors happened during the mirroring - refer to /home/aguidi/go/src/github.com/aguidirh/oc-mirror/alex-tests/ocpbugs-33098/working-dir/logs/mirroring_errors_20240430_170512.txt for more details >``` > >The file looks like this (trimmed with only 3 lines for example purposes): >``` >error mirroring image docker://registry.redhat.io/redhat/redhat-operator-index:v4.15 error: copying image 1/4 from manifest list: trying to reuse blob sha256:3059f6068401e6b82194cb486bf75573bd18356796e1010a73d575704723cc31 at destination: pinging container registry localhost:6000: Get "http://localhost:6000/v2/": dial tcp [::1]:6000: connect: connection refused >error mirroring image registry.redhat.io/ubi8/ubi:latest error: copying image 1/4 from manifest list: trying to reuse blob sha256:2efec45cd878dd2784f6aa8338e6f4a788be9a65fd288fe555bc971308f70615 at destination: pinging container registry localhost:6000: Get "http://localhost:6000/v2/": dial tcp [::1]:6000: connect: connection refused >error mirroring image registry.redhat.io/ubi9/ubi@sha256:20f695d2a91352d4eaa25107535126727b5945bff38ed36a3e59590f495046f0 error: copying image 1/4 from manifest list: trying to reuse blob sha256:31aa511859523410c08f48a15c0c0d84b738c8c9e46d980549917b822e7449fa at destination: pinging container registry localhost:6000: Get "http://localhost:6000/v2/": dial tcp [::1]:6000: connect: connection refused >``` > Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Foc-mirror). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-ci[bot] commented 5 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aguidirh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/openshift/oc-mirror/blob/main/OWNERS)~~ [aguidirh] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
aguidirh commented 5 months ago

/jira refresh

openshift-ci-robot commented 5 months ago

@aguidirh: This pull request references Jira Issue OCPBUGS-33098, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug * bug is open, matching expected state (open) * bug target version (4.16.0) matches configured target version for branch (4.16.0) * bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact: /cc @zhouying7780

In response to [this](https://github.com/openshift/oc-mirror/pull/843#issuecomment-2085620549): >/jira refresh Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Foc-mirror). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-ci[bot] commented 5 months ago

@aguidirh: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
lmzuccarelli commented 5 months ago

/lgtm

openshift-ci-robot commented 5 months ago

@aguidirh: Jira Issue OCPBUGS-33098: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-33098 has been moved to the MODIFIED state.

In response to [this](https://github.com/openshift/oc-mirror/pull/843): ># Description > >This PR generates a file with all the errors that happened during the mirroring process. In this way customers can audit their target registry to check if the errors really happened or they were only flake errors. > >Fixes # (issue) > >## Type of change > >Please delete options that are not relevant. > >- [x] Bug fix (non-breaking change which fixes an issue) >- [ ] New feature (non-breaking change which adds functionality) >- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) >- [ ] This change requires a documentation update > ># How Has This Been Tested? > >Using the following ImageSetConfiguration: > >``` >kind: ImageSetConfiguration >apiVersion: mirror.openshift.io/v2alpha1 >mirror: > platform: > channels: > - name: stable-4.13 > minVersion: 4.13.10 > maxVersion: 4.13.10 > graph: true > operators: > - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15 > packages: > - name: aws-load-balancer-operator > - name: 3scale-operator > - name: node-observability-operator > additionalImages: > - name: registry.redhat.io/ubi8/ubi:latest > - name: registry.redhat.io/ubi9/ubi@sha256:20f695d2a91352d4eaa25107535126727b5945bff38ed36a3e59590f495046f0 >``` > >Step 1 - mirror to disk: > >``` >./bin/oc-mirror -c ./alex-tests/alex-isc/isc.yaml file:///home/aguidi/go/src/github.com/aguidirh/oc-mirror/alex-tests/ocpbugs-33098 --v2 >``` > >Step 2 - disk to mirror and stopped the target registry in the middle of the mirroring: > >``` >./bin/oc-mirror -c ./alex-tests/alex-isc/isc.yaml --from file:///home/aguidi/go/src/github.com/aguidirh/oc-mirror/alex-tests/ocpbugs-33098 docker://localhost:6000 --v2 >``` >``` >podman stop local-registry >``` > >## Expected Outcome >Errors on the log output and also a file generated with all errors occurred under working-dir/logs/ > >``` >2024/04/30 17:05:12 [ERROR] : [Worker] some errors happened during the mirroring - refer to /home/aguidi/go/src/github.com/aguidirh/oc-mirror/alex-tests/ocpbugs-33098/working-dir/logs/mirroring_errors_20240430_170512.txt for more details >``` > >The file looks like this (trimmed with only 3 lines for example purposes): >``` >error mirroring image docker://registry.redhat.io/redhat/redhat-operator-index:v4.15 error: copying image 1/4 from manifest list: trying to reuse blob sha256:3059f6068401e6b82194cb486bf75573bd18356796e1010a73d575704723cc31 at destination: pinging container registry localhost:6000: Get "http://localhost:6000/v2/": dial tcp [::1]:6000: connect: connection refused >error mirroring image registry.redhat.io/ubi8/ubi:latest error: copying image 1/4 from manifest list: trying to reuse blob sha256:2efec45cd878dd2784f6aa8338e6f4a788be9a65fd288fe555bc971308f70615 at destination: pinging container registry localhost:6000: Get "http://localhost:6000/v2/": dial tcp [::1]:6000: connect: connection refused >error mirroring image registry.redhat.io/ubi9/ubi@sha256:20f695d2a91352d4eaa25107535126727b5945bff38ed36a3e59590f495046f0 error: copying image 1/4 from manifest list: trying to reuse blob sha256:31aa511859523410c08f48a15c0c0d84b738c8c9e46d980549917b822e7449fa at destination: pinging container registry localhost:6000: Get "http://localhost:6000/v2/": dial tcp [::1]:6000: connect: connection refused >``` > Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Foc-mirror). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-bot commented 5 months ago

[ART PR BUILD NOTIFIER]

This PR has been included in build oc-mirror-plugin-container-v4.16.0-202405021917.p0.gb8d11cd.assembly.stream.el9 for distgit oc-mirror-plugin. All builds following this will include this PR.

openshift-merge-robot commented 5 months ago

Fix included in accepted release 4.16.0-0.nightly-2024-05-03-091818