Bug 1972903 - No error reported when target namespace creation fails during direct volume migration
Summary: No error reported when target namespace creation fails during direct volume m...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Migration Toolkit for Containers
Classification: Red Hat
Component: Controller
Version: 1.4.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 1.5.0
Assignee: Pranav Gaikwad
QA Contact: Xin jiang
Avital Pinnick
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-16 20:31 UTC by Erik Nelson
Modified: 2021-07-28 04:08 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-07-28 04:08:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github konveyor mig-controller pull 1133 0 None open Bug 1972903: Add missing return statement 2021-06-18 15:39:38 UTC
Github konveyor mig-controller pull 1138 0 None open Bug 1972903: Add missing return statement (#1133) 2021-06-22 21:28:19 UTC
Github konveyor mig-controller pull 1142 0 None open Bug 1972903: Fail DVM when itinerary is failed 2021-06-30 15:24:47 UTC
Github konveyor mig-controller pull 1143 0 None open Bug 1972903: fail DVM when itinerary is failed (#1142) 2021-06-30 16:27:10 UTC
Github konveyor mig-controller pull 1146 0 None open Bug 1972903: Fix FailedItinerary for DIM and DISM 2021-07-02 14:06:01 UTC
Github konveyor mig-controller pull 1147 0 None open Bug 1972903: fix failed itinerary in DIM and DISM (#1146) 2021-07-02 14:17:58 UTC
Red Hat Product Errata RHEA-2021:2929 0 None None None 2021-07-28 04:08:22 UTC

Description Erik Nelson 2021-06-16 20:31:13 UTC
Describe the bug
This is created to fix a bug when attempting staging step from source to destination. It was observed that the during CreateDestinationPVCs step , the logs reported namespaces "example" not found.

Release version : 1.4.4

Proposed Fix
Adding return err when an error occurs creating the namespace : https://github.com/konveyor/mig-controller/blob/release-1.4.4/pkg/controller/directvolumemigration/task.go#L232

---

Mirrored from: https://github.com/konveyor/mig-controller/issues/1126

Comment 4 Sergio 2021-06-29 14:47:01 UTC
Verified using MTC 1.5.0

   openshift-migration-rhel7-operator@sha256:00e77706ca22bcb557d13c16822180fc877e6ea1639a72fda8eb9f5488b039a2
    - name: MIG_CONTROLLER_REPO
      value: openshift-migration-controller-rhel8@sha256
    - name: MIG_CONTROLLER_TAG
      value: 7f657df15e9514df4ef42da3431f558a19b8d3233a2ef1222cd8e27793c93816

When the namespace cannot be created in the target cluster we are reporting a failure in the DVM and DIM, but the migration is stuck forever.

We can reproduce it following these steps:

1 create an app with pvc + images. The sample persistent django is enough.
2 map the namespace to a valid namespace (the UI will validate it, so it will not allow you to use an invalid namespace)
3 oc edit the migplan, and set a destination namespace longer that 63 characters (it will be allowed because the bug regarding this validation has not been fixed already)
4 run the migraiton
5 the destination namespace is invalid, so it will always fail



We move the issue to ASSIGNED.

Comment 8 Sergio 2021-07-01 16:36:08 UTC
Verified using MTC 1.5.0
        - name: MIG_CONTROLLER_REPO
          value: openshift-migration-controller-rhel8
        - name: MIG_CONTROLLER_TAG
          value: v1.5.0-6
        - name: MIG_UI_REPO
          value: openshift-migration-ui-rhel8
        - name: MIG_UI_TAG
          value: v1.5.0-12


We can see this error in the DMV when we force a namespace creation failure:
'''
  Errors:
    Namespace "ocp-fixed-django-111111111111111111111111111111111111111111111022222" is invalid: [metadata.name: Invalid value: "ocp-fixed-django-111111111111111111111111111111111111111111111022222": must be no more than 63 characters, metadata.labels: Invalid value: "ocp-fixed-django-111111111111111111111111111111111111111111111022222": must be no more than 63 characters]
'''

But the migration is stuck forever instead of failing.

We move the status to ASSIGNED.

Comment 10 Xin jiang 2021-07-08 03:28:29 UTC
verified with MTC 1.5.0

image:
registry.redhat.io/rhmtc/openshift-migration-controller-rhel8@sha256:bb00be359e7e501cd5e836171a33ed1bdbdb03118d010532e0286817de571c0f


We can reproduce it following these steps:

1 create an app with pvc + images. The sample persistent django is enough.
2 map the namespace to a valid namespace (the UI will validate it, so it will not allow you to use an invalid namespace)
3 oc edit the migplan, and set a destination namespace longer that 63 characters (it will be allowed because the bug regarding this validation has not been fixed already)
4 run the migraiton
5 the destination namespace is invalid, so it will always fail


The result is:

1. We can see this error in the DMV when we force a namespace creation failure:
  errors:
  - 'Namespace "a0e77706ca22bcb557d13c16822180fc877e6ea1639a72fda8eb9f5488b039a2" is invalid: [metadata.name: Invalid value: "a0e77706ca22bcb557d13c16822180fc877e6ea1639a72fda8eb9f5488b039a2": must be no more than 63 characters, metadata.labels: Invalid value: "a0e77706ca22bcb557d13c16822180fc877e6ea1639a72fda8eb9f5488b039a2": must be no more than 63 characters]'
  itinerary: VolumeMigrationFailed

2. The migration completed with warnings

Comment 16 errata-xmlrpc 2021-07-28 04:08:13 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) image release advisory 1.5.0), 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/RHEA-2021:2929


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