Bug 1982026 - Direct image migration fails if the source URI contains a double slash ("//")
Summary: Direct image migration fails if the source URI contains a double slash ("//")
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Migration Toolkit for Containers
Classification: Red Hat
Component: Operator
Version: 1.4.5
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: 1.6.0
Assignee: Pranav Gaikwad
QA Contact: Xin jiang
Avital Pinnick
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-14 02:11 UTC by Vincent Lours
Modified: 2023-09-15 01:35 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-09-29 14:35:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:3694 0 None None None 2021-09-29 14:35:12 UTC

Description Vincent Lours 2021-07-14 02:11:59 UTC
Description of problem:

A running MigPlan with some images failed to migrate part of the image.
Example:
~~~
    - destNamespace: test
      directMigration:
        name: 772df3e0-e2cf-11eb-8c21-f7a857a1d488-vw64j-rhmvv
        namespace: openshift-migration
      errors:
      - 'Invalid source name docker://default-route-openshift-image-registry.apps.example.com//test/java@sha256:4cd6e0506d53cd47a31f594a4b60ae13fecb88a816e132e995bab88a72833419: invalid reference format'
      name: java
      namespace: vision
~~~

Version-Release number of selected component (if applicable):
~~~
mtc-operator.v1.4.5                 Migration Toolkit for Containers Operator   1.4.5      mtc-operator.v1.4.4                 Succeeded
~~~

How reproducible:
N/A in global, but the "invalid reference format" error message can be replicated"

Steps to Reproduce:
1. running a skopeo inspect on a valid URI works: `skopeo inspect docker://registry.fedoraproject.org/fedora:latest | jq -r '.Name'`
2. Adding a second '//' in the URI to create the issue:
~~~
$ skopeo inspect docker://registry.fedoraproject.org//fedora:latest
FATA[0000] Error parsing image name "docker://registry.fedoraproject.org//fedora:latest": invalid reference format
~~~
3.

Actual results:
Part of the images has been transferred. Please advise why this is happening and how to fix it

Expected results:
All images should be transferred whether or not a '//' is part of the URI.

Additional info:

Comment 10 Erik Nelson 2021-07-20 16:43:36 UTC
I'm going to add this to an upcoming release to see some better validation around this and an explicit error message to ensure it's properly formatted.

Comment 11 Vincent Lours 2021-07-21 07:48:14 UTC
The KCS https://access.redhat.com/solutions/6202272 has been created to address this issue until a fix will be deployed.

Comment 13 Vincent Lours 2021-08-01 22:39:06 UTC
Hi Eric,

I've made a Pull Request to automatically solve this error, based on what was done with the "http(s)://" format: https://github.com/konveyor/mig-controller/pull/1158
Please feel free to review/approve/merge it.

I'm not sure about the process for this BZ, as I'm not part of the engineering team.
Could you please advise who should be assigned and follow up on the status.

Cheers,
Vincent

Comment 14 Erik Nelson 2021-08-11 00:53:39 UTC
Thank you for the contribution Vincent! Moving to MODIFIED as it’s shipping with the 1.6.0 release.

Comment 19 Xin jiang 2021-09-01 12:59:30 UTC
Verified with MTC 1.6.0

$ oc get migcluster source-cluster -o yaml | grep exposedRegistryPath
        f:exposedRegistryPath: {}
  exposedRegistryPath: default-route-openshift-image-registry.apps.cam-src-23950.qe.devcluster.openshift.com/

while executing migration, it automaticaly trimmed the `/` if it has '/' at the end of the "Exposed route host to image registry" value. Logs as below

$ oc logs migration-log-reader-b5dcb7974-9z2lf -c plain | grep "default-route-openshift-image-registry.apps.cam-src-23950.qe.devcluster.openshift.com/test1"
openshift-migration migration-controller-6df9dcd9cd-5vtwq mtc {"level":"info","ts":1630476792.44678,"logger":"directimagestream","msg":"[imagecopy] copying from: docker://default-route-openshift-image-registry.apps.cam-src-23950.qe.devcluster.openshift.com/test1/django-psql-persistent@sha256:2e599227f44cd027951f53d1473722004124abec1f2354d89a57f975a85dbe26","dism":"migration-ac55a-gpt7b-kbz6l","migMigration":"migration-ac55a","phase":"MigrateImageStream"}

Comment 21 errata-xmlrpc 2021-09-29 14:35:03 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 (Moderate: Migration Toolkit for Containers (MTC) 1.6.0 security & bugfix 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-2021:3694

Comment 22 Red Hat Bugzilla 2023-09-15 01:35:02 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 365 days


Note You need to log in before you can comment on or make changes to this bug.