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:
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?
https://github.com/ManageIQ/manageiq-ui-classic/pull/5339
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.
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(-)
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.
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.