Bug 1691992 - [v2v] : Migration shows blank page if provider is removed from CFME
Summary: [v2v] : Migration shows blank page if provider is removed from CFME
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: V2V
Version: 5.10.2
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.11.0
Assignee: Fabien Dupont
QA Contact: Shveta
Red Hat CloudForms Documentation
URL:
Whiteboard: V2V
Depends On:
Blocks: 1696421
TreeView+ depends on / blocked
 
Reported: 2019-03-23 03:43 UTC by Shveta
Modified: 2020-06-30 18:23 UTC (History)
8 users (show)

Fixed In Version: 5.11.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1696421 (view as bug list)
Environment:
Last Closed: 2019-12-13 15:08:46 UTC
Category: Bug
Cloudforms Team: V2V
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
blank migration page (50.69 KB, image/png)
2019-03-23 03:43 UTC, Shveta
no flags Details
Screenshot (24.17 KB, image/png)
2019-07-02 18:52 UTC, Kedar Kulkarni
no flags Details

Description Shveta 2019-03-23 03:43:06 UTC
Created attachment 1547188 [details]
blank migration page

Description of problem: If provider is removed from CFME, migration plan page shows blank . Guess the plan is referencing to null provider in db .


Version-Release number of selected component (if applicable):
5.10.2.2.20190319204241_4304a7d

How reproducible:


Steps to Reproduce:
1. Add OSP and vmware provider .
2. Create infrastructure mapping and migration plan.
3. Remove Provider . 

Actual results:
Migration starts showing blank page . Even after provider is added back , blank page is shown 

Expected results:


Additional info:
Appliance : https://10.8.198.237
 Logs do not show any error .

Comment 2 Shveta 2019-03-23 03:50:44 UTC
BY provider I mean OSP provider . I removed OSP provider to recreate the BZ.

Comment 4 dmetzger 2019-03-25 16:29:24 UTC
Did this work correctly in 5.10.1, or more generally what was the last known working release?

Comment 5 Shveta 2019-03-25 18:45:57 UTC
I see it last working on 5.10.0.24.20181113213923_03b81fd.

Comment 6 Sudhir Mallamprabhakara 2019-03-25 20:03:18 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=1672702

fixed/Verified in 5.10.1

Comment 7 Sudhir Mallamprabhakara 2019-03-25 20:06:44 UTC
FYI: That is a related BZ.. not following the same exact steps as this BZ.

Comment 8 dmetzger 2019-03-26 12:23:03 UTC
Targeting 5.10.3

Comment 9 vconzola 2019-03-28 17:27:23 UTC
@shveta

Comment 10 vconzola 2019-03-28 17:32:13 UTC
@sshveta Can you provide more details? How was the migration started - scheduled or manual click of Migrate button? Which page is supposed to be displayed in the screenshot - Migration Plans? If the provider has been removed the infra mapping should become invalid and the Migrate button for any plans using that mapping should be disabled.

Comment 11 Shveta 2019-03-28 17:48:17 UTC
1) Created Infrastructure mapping.
2) Created Migration plan and started immediately .
3) Once the plan starts , I deleted OSP.
4) Navigated to Compute - Migration Plans - Blank page

Comment 12 Milan Zázrivec 2019-03-29 11:16:30 UTC
The relevant error here is:

...
react-dom.production.min.js:171 TypeError: Cannot read property 'ems_id' of undefined

...

The failing code in particular:

$ cat app/javascript/react/screens/App/Overview/helpers.js
...
export const attachTargetProvider = (plan, providers, clusters, targetProviderType) => {
  if (!plan.transformation_mapping) {
    return plan;
  }

  const {
    transformation_mapping: { transformation_mapping_items }
  } = plan;
  const clusterMapping = transformation_mapping_items.find(
    item => item.destination_type === TRANSFORMATION_MAPPING_ITEM_DESTINATION_TYPES[targetProviderType].cluster
  );
  const targetCluster = clusters.find(cluster => cluster.id === clusterMapping.destination_id);
  const targetProvider = providers.find(provider => provider.id === targetCluster.ems_id);

  return { ...plan, targetProvider };
};

Comment 13 Milan Zázrivec 2019-03-29 11:28:02 UTC
Pasting the full error stack here:

vendor-340c92bee2eeaef68d4f.js:sourcemap:619 TypeError: Cannot read property 'ems_id' of undefined
    at helpers.js:33
    at Array.find (<anonymous>)
    at t.attachTargetProvider (helpers.js:33)
    at OverviewSelectors.js:75
    at Array.map (<anonymous>)
    at Array.<anonymous> (vendor-340c92bee2eeaef68d4f.js:sourcemap:13)
    at t.attachTargetProviderToOspPlans (OverviewSelectors.js:69)
    at Function.mapToProps (index.js:29)
    at o (vendor-340c92bee2eeaef68d4f.js:sourcemap:166)
    at vendor-340c92bee2eeaef68d4f.js:sourcemap:230
si @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
n.callback @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
io @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
oo @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
pa @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
fa @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
da @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
ji @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
enqueueSetState @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
b.setState @ vendor-340c92bee2eeaef68d4f.js:sourcemap:627
o.onStateChange @ vendor-340c92bee2eeaef68d4f.js:sourcemap:166
y @ vendor-340c92bee2eeaef68d4f.js:sourcemap:138
(anonymous) @ vendor-340c92bee2eeaef68d4f.js:sourcemap:504
(anonymous) @ vendor-340c92bee2eeaef68d4f.js:sourcemap:504
(anonymous) @ vendor-340c92bee2eeaef68d4f.js:sourcemap:504
dispatch @ vendor-340c92bee2eeaef68d4f.js:sourcemap:138
(anonymous) @ vendor-340c92bee2eeaef68d4f.js:sourcemap:504
Promise.then (async)
(anonymous) @ vendor-340c92bee2eeaef68d4f.js:sourcemap:504
(anonymous) @ vendor-340c92bee2eeaef68d4f.js:sourcemap:504
(anonymous) @ vendor-340c92bee2eeaef68d4f.js:sourcemap:504
dispatch @ vendor-340c92bee2eeaef68d4f.js:sourcemap:138
(anonymous) @ OverviewActions.js:123
(anonymous) @ vendor-340c92bee2eeaef68d4f.js:sourcemap:504
(anonymous) @ vendor-340c92bee2eeaef68d4f.js:sourcemap:504
(anonymous) @ vendor-340c92bee2eeaef68d4f.js:sourcemap:230
(anonymous) @ Overview.js:45
Promise.then (async)
value @ Overview.js:44
pa @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
fa @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
da @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
ji @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
ba @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
_a @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
xa.render @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
(anonymous) @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
ya @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
Ta @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
render @ vendor-340c92bee2eeaef68d4f.js:sourcemap:619
n @ application-common-e00a08200dbdb5bf73ff.js:1
create @ application-common-e00a08200dbdb5bf73ff.js:1
f @ application-common-e00a08200dbdb5bf73ff.js:1
t.componentFactory @ application-common-e00a08200dbdb5bf73ff.js:1
(anonymous) @ plans:1480
helpers.js:33 Uncaught (in promise) TypeError: Cannot read property 'ems_id' of undefined
    at helpers.js:33
    at Array.find (<anonymous>)
    at t.attachTargetProvider (helpers.js:33)
    at OverviewSelectors.js:75
    at Array.map (<anonymous>)
    at Array.<anonymous> (vendor-340c92bee2eeaef68d4f.js:sourcemap:13)
    at t.attachTargetProviderToOspPlans (OverviewSelectors.js:69)
    at Function.mapToProps (index.js:29)
    at o (vendor-340c92bee2eeaef68d4f.js:sourcemap:166)
    at vendor-340c92bee2eeaef68d4f.js:sourcemap:230

Comment 14 Milan Zázrivec 2019-03-29 12:43:15 UTC
https://github.com/ManageIQ/manageiq-v2v/pull/923

Comment 15 Mike Turley 2019-04-03 14:50:55 UTC
The PR is now merged. Fabien, do you mind moving this to POST?

Comment 16 CFME Bot 2019-04-03 14:53:53 UTC
New commits detected on ManageIQ/manageiq-v2v/master:

https://github.com/ManageIQ/manageiq-v2v/commit/eef8437db69db455db389b26e19f4c2c749d8dac
commit eef8437db69db455db389b26e19f4c2c749d8dac
Author:     Milan Zazrivec <mzazrivec>
AuthorDate: Fri Mar 29 08:39:07 2019 -0400
Commit:     Milan Zazrivec <mzazrivec>
CommitDate: Fri Mar 29 08:39:07 2019 -0400

    Migration Plans in Progress page: fix error with deleted target provider

    https://bugzilla.redhat.com/show_bug.cgi?id=1691992

 app/javascript/react/screens/App/Overview/helpers.js | 3 +
 1 file changed, 3 insertions(+)


https://github.com/ManageIQ/manageiq-v2v/commit/5fbab3104dea1e52591450ac2f0dc7588e6d6887
commit 5fbab3104dea1e52591450ac2f0dc7588e6d6887
Author:     Mike Turley <mturley>
AuthorDate: Wed Apr  3 10:22:48 2019 -0400
Commit:     Mike Turley <mturley>
CommitDate: Wed Apr  3 10:22:48 2019 -0400

    Guard against plan.targetProvider being undefined

    https://bugzilla.redhat.com/show_bug.cgi?id=1691992

 app/javascript/react/screens/App/Overview/components/Migrations/MigrationsInProgressCard.js | 3 +-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comment 18 Kedar Kulkarni 2019-07-02 18:52:33 UTC
On CFME Version 5.11.0.11 I do not see page going blank. Please see attached screenshot with the UI that shows "Missing Providers" message as expected.

Comment 19 Kedar Kulkarni 2019-07-02 18:52:58 UTC
Created attachment 1586838 [details]
Screenshot


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