Bug 1684649 - Clicking on Network -> Topology Produces Error 500 Internal Server Error
Summary: Clicking on Network -> Topology Produces Error 500 Internal Server Error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.9.7
Hardware: All
OS: All
high
high
Target Milestone: GA
: 5.11.0
Assignee: Robin Knaur
QA Contact: Matouš Mojžíš
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks: 1692488 1693730
TreeView+ depends on / blocked
 
Reported: 2019-03-01 18:26 UTC by Ryan Spagnola
Modified: 2020-01-06 14:35 UTC (History)
10 users (show)

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


Attachments (Terms of Use)

Description Ryan Spagnola 2019-03-01 18:26:08 UTC
Description of problem:
Navigating to Networks > Topology presents the following error

URL /network_topology/data
Status 500 Internal Server Error
Content-Type text/html; charset=utf-8
Data undefined method `name' for nil:NilClass [network_topology/data]

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

How reproducible:
Everytime 

Steps to Reproduce:
1. In UI go to Networks > Topology
2.
3.

Actual results:
URL /network_topology/data
Status 500 Internal Server Error
Content-Type text/html; charset=utf-8
Data undefined method `name' for nil:NilClass [network_topology/data]

Expected results:
Topology is displayed

Additional info:

Comment 8 Robb Manes 2019-03-13 17:28:00 UTC
This occurs when VM's do not have an ext_management_system present in the record.  We fail here when an object of type ManageIQ::Providers::Amazon::CloudManager::Vm doesn't have said field:

    if entity.kind_of?(Host) || entity.kind_of?(Vm)
      data[:provider] = entity.ext_management_system.name	<---- here
    end

Ostensibly, we could just band-aid this by setting all VM's with nil ext_management_system fields to whatever the proper EMS is (in our case, we only have one AWS provider, so it is easy):

ems = ManageIQ::Providers::Amazon::CloudManager.find_by(:name=>"AWS_PROVIDER_NAME"); ManageIQ::Providers::Amazon::CloudManager::Vm.all.each {|vm| if vm.ext_management_system == nil; vm.ext_management_system = ems; vm.save; end }; 

Is there any problem with doing this?  I would expect every VM to require having an ext_management_system, but is there a valid reason why it might not have it, or why we shouldn't just run the above?

Comment 11 Robb Manes 2019-03-15 16:41:28 UTC
For posterities's sake, if I'm following along correctly, it looks like orphaned VM's without an ext_management_system is supported, and the commit above is to address that.

Comment 12 CFME Bot 2019-03-26 09:27:41 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:

https://github.com/ManageIQ/manageiq-ui-classic/commit/3f4ae4504847dcba8771be01aa2237ac3ce68086
commit 3f4ae4504847dcba8771be01aa2237ac3ce68086
Author:     PanSpagetka <rknaur>
AuthorDate: Thu Mar 14 06:19:16 2019 -0400
Commit:     PanSpagetka <rknaur>
CommitDate: Thu Mar 14 06:19:16 2019 -0400

    Add safeguard for VMs without ext_management_system
    https://bugzilla.redhat.com/show_bug.cgi?id=1684649

 app/services/network_topology_service.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 14 juwatts 2019-07-02 18:15:08 UTC
Verified in 5.11.0.11.20190625161125_392c61e

Verification Steps:
1) Archived a VM by remsoving the provider (can also be achieved by retiring a VM)
2) Navigate to Networks-> Topology

500 Internal Server is not observed, Topology is loaded correctly.

Comment 15 juwatts 2019-07-02 18:16:00 UTC
Verified in 5.11.0.11.20190625161125_392c61e

Verification Steps:
1) Archived a VM by removing the provider (can also be achieved by retiring a VM)
2) Navigate to Networks-> Topology

500 Internal Server is not observed, Topology is loaded correctly.


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