Bug 1994985 - Web console crashes when a MigPlan custom resource is created with an empty namespaces list
Summary: Web console crashes when a MigPlan custom resource is created with an empty n...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Migration Toolkit for Containers
Classification: Red Hat
Component: UI
Version: 1.6.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 1.6.0
Assignee: Ian
QA Contact: Xin jiang
Avital Pinnick
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-18 09:07 UTC by Sergio
Modified: 2021-09-29 14: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
Github konveyor mig-ui pull 1285 0 None None None 2021-08-24 13:44:05 UTC
Red Hat Product Errata RHSA-2021:3694 0 None None None 2021-09-29 14:35:12 UTC

Description Sergio 2021-08-18 09:07:36 UTC
Description of problem:
If we make a mistake when creating a migplan resource via CLI and the "namespaces" list is not defined in the migplan, the MTC UI crashes and it becomes blank. The backend, nevertheless, can handle the issue and create a CriticalCondition for the migplan.


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

It has been found in 1.6.0, but it is probably present in previous releases too.

How reproducible:
Always

Steps to Reproduce:
1. Using the CLI create a migplan resource without a ‘namespaces’ list defined

[Use the right values for source cluster, destination cluster and migstorage names]

apiVersion: migration.openshift.io/v1alpha1
kind: MigPlan
metadata:
  name:  mig-plan-name
  namespace: openshift-migration
spec:
  destMigClusterRef:
    name: host
    namespace: openshift-migration
  migStorageRef:
    name: automatic
    namespace: openshift-migration
  srcMigClusterRef:
    name: source-cluster
    namespace: openshift-migration


2. Open the "plans" screen in the MTC UI.


Actual results:
The MTC UI crashes and cannot show the plans. It becomes blank.

In the browser's console we can see this error:

TypeError: Cannot read property 'length' of undefined
    at Object.t.getPlanInfo (app.bundle.js:2)
    at app.bundle.js:2
    at app.bundle.js:2
    at Array.sort (<anonymous>)
    at Object.t.useSortState (app.bundle.js:2)
    at t.default (app.bundle.js:2)
    at ci (app.bundle.js:2)
    at jr (app.bundle.js:2)
    at bs (app.bundle.js:2)
    at Ms (app.bundle.js:2)


The migplan status shows this CriticalCondition:

status:
  conditions:
  - category: Critical
    lastTransitionTime: "2021-08-17T11:07:39Z"
    message: The `namespaces` list may not be empty.
    reason: NotFound
    status: "True"
    type: NamespaceListEmpty



Expected results:
The UI should not crash, and it should report all existing migration plans, as well as this misconfigured migration plan as "Not Ready".


Additional info:

Comment 7 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


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