Bug 1890704

Summary: Internal image copy errors aren't logged as failures
Product: Migration Toolkit for Containers Reporter: Scott Seago <sseago>
Component: GeneralAssignee: Scott Seago <sseago>
Status: CLOSED ERRATA QA Contact: Xin jiang <xjiang>
Severity: unspecified Docs Contact: Avital Pinnick <apinnick>
Priority: unspecified    
Version: 1.3.zCC: chezhang, ernelson, rjohnson, sregidor, whu
Target Milestone: ---   
Target Release: 1.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-11-30 08:15:15 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 Scott Seago 2020-10-22 18:41:57 UTC
Description of problem:
In MTC 1.3.0, any failures with internal image copies aren't logged as errors.
In the imagestream plugin, the returned err is assigned to a new err variable scoped to the loop, so the err returned is nil

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

How reproducible:
Always

Steps to Reproduce:
1. Make sure internal image copy will fail (in my case, this happened when my src cluster internal registry wasn't healthy -- the pod was down)
2. Migrate a namespace with at least one internal image
3. Migration is reported as a success, even though the images aren't copied.

Actual results:
Migration reports as a success

Expected results:
Migration should fail

Additional info:

Comment 1 Scott Seago 2020-11-03 16:05:01 UTC
Fixed for 1.3.2 here: https://github.com/konveyor/openshift-velero-plugin/pull/63
A separate fix was previously merged on master as part of a larger refactoring

Comment 5 Sergio 2020-11-17 13:03:49 UTC
Verified using MTC 1.3.2 stage

openshift-migration-rhel7-operator@sha256:2eafc06e24cf1b815906f3eb4ba5ddd3362b607d26605d594a7ef17a51059d7e

    - name: MIG_CONTROLLER_REPO
      value: openshift-migration-controller-rhel8@sha256
    - name: MIG_CONTROLLER_TAG
      value: 2a40d53cfa09c83b8063c3ca3d3acfd7d323b825005c9de3aacf5457ed7029ae
    - name: MIG_UI_REPO
      value: openshift-migration-ui-rhel8@sha256
    - name: MIG_UI_TAG
      value: 44c9be260fcfa6e2a854f58d3498c620483ac6c360e811811401de266e895e43
    - name: MIGRATION_REGISTRY_REPO
      value: openshift-migration-registry-rhel8@sha256
    - name: MIGRATION_REGISTRY_TAG
      value: 980b8ab84e7cf3e8664a052e2fcbda74123a31b674e64f0648d49bcc472ba3a2
    - name: VELERO_REPO
      value: openshift-migration-velero-rhel8@sha256
    - name: VELERO_TAG
      value: 349db22c468b5923e415a88e03a9f14a4df249969a7275b94197bc78f2a0b26c
    - name: VELERO_PLUGIN_REPO
      value: openshift-velero-plugin-rhel8@sha256
    - name: VELERO_PLUGIN_TAG
      value: cff7527e3906dbfc494bbfc9573b645dcaa7b8d5d5777b8d013ccaac211a3dff



In order to verify the BZ we broke the default registry's service

The result was this log in the backup

time="2020-11-17T12:57:40Z" level=info msg="[is-backup] Error copying image: Error initializing source docker://docker-registry.default.svc:5000/ocp-24730-django/django-psql-persistent@sha256:ca602d85c16e060c612b970491d39a0ca01f71675825767f7751e0ee3bdf5fda: error pinging docker registry docker-registry.default.svc:5000: Get \"http://docker-registry.default.svc:5000/v2/\": dial tcp 172.30.141.78:5000: connect: no route to host" backup=openshift-migration/b429f070-28d3-11eb-8c58-fb3de0a84ebc-vckc6 cmd=/plugins/velero-plugins logSource="/go/src/github.com/konveyor/openshift-velero-plugin/velero-plugins/imagestream/backup.go:83" pluginName=velero-plugins
time="2020-11-17T12:57:40Z" level=info msg="1 errors encountered backup up item" backup=openshift-migration/b429f070-28d3-11eb-8c58-fb3de0a84ebc-vckc6 logSource="pkg/backup/backup.go:444" name=django-psql-persistent


And that the migration failed with this error

    errors:
    - 'Backup: openshift-migration/b429f070-28d3-11eb-8c58-fb3de0a84ebc-vckc6 partially
      failed.'
    itinerary: Failed


Moved to VERIFIED

Comment 9 errata-xmlrpc 2020-11-30 08:15:15 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 (Migration Toolkit for Containers (MTC) 1.3.2 Operator metadata image advisory), 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/RHBA-2020:5134