Bug 1446822
Summary: | Topology view crashes with container linking in place | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat CloudForms Management Engine | Reporter: | Heiko W. Rupp <hrupp> | ||||
Component: | Providers | Assignee: | Jirka Kremser <jkremser> | ||||
Status: | CLOSED EOL | QA Contact: | Matt Mahoney <mmahoney> | ||||
Severity: | urgent | Docs Contact: | |||||
Priority: | urgent | ||||||
Version: | unspecified | CC: | abonas, cpelland, jdoyle, jfrey, jhardy, jkremser, lavenel, mazz, mithomps, obarenbo, simaishi, theute | ||||
Target Milestone: | GA | Keywords: | TestOnly, Triaged | ||||
Target Release: | 5.9.0 | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | :middleware | ||||||
Fixed In Version: | 5.9.0.1 | Doc Type: | If docs needed, set a value | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | |||||||
: | 1447432 (view as bug list) | Environment: | |||||
Last Closed: | 2018-03-06 15:36:29 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | Middleware | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 1447432 | ||||||
Attachments: |
|
Description
Heiko W. Rupp
2017-04-29 08:12:13 UTC
Created attachment 1275141 [details]
Screenshot of the failure
the important part for whoever can't access pastebin: [----] I, [2017-04-28T19:05:32.731564 #2206:3fe951523850] INFO -- : Started GET "/middleware_topology/data" for 127.0.0.1 at 2017-04-28 19:05:32 +0000 [----] I, [2017-04-28T19:05:32.732644 #2206:3fe951523850] INFO -- : Processing by MiddlewareTopologyController#data as HTML [----] F, [2017-04-28T19:05:32.796056 #2206:3fe951523850] FATAL -- : Error caught: [NoMethodError] undefined method `host' for #<ManageIQ::Providers::Kubernetes::ContainerManager::Container:0x007fd2ad585098> /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/activemodel-5.0.2/lib/active_model/attribute_methods.rb:433:in `method_missing' /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/bundler/gems/manageiq-ui-classic-70ba36ca1c67/app/services/topology_service.rb:69:in `block in map_to_graph' /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/bundler/gems/manageiq-ui-classic-70ba36ca1c67/app/services/topology_service.rb:67:in `each_pair' /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/bundler/gems/manageiq-ui-classic-70ba36ca1c67/app/services/topology_service.rb:67:in `map_to_graph' /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/bundler/gems/manageiq-ui-classic-70ba36ca1c67/app/services/topology_service.rb:36:in `build_topology' /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/bundler/gems/manageiq-ui-classic-70ba36ca1c67/app/services/middleware_topology_service.rb:21:in `build_topology' /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/bundler/gems/manageiq-ui-classic-70ba36ca1c67/app/controllers/topology_controller.rb:51:in `generate_topology' /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/bundler/gems/manageiq-ui-classic-70ba36ca1c67/app/controllers/topology_controller.rb:37:in `data' The issue happens because so far cross linking was to a VM, which in turn was linked to a Host. Due to that, the topology relationship in containers and in middleware topologies assumed the following was always correct: https://github.com/ManageIQ/manageiq-ui-classic/blob/master/app/services/middleware_topology_service.rb#L14 However since cross linking to container was added as well, there is no "host" linked to a container, hence it fails in cases where the cross linking is to container and not to VM because it tries to call container.host The data hierarchy is built here: https://github.com/ManageIQ/manageiq-ui-classic/blob/master/app/services/topology_service.rb#L69 The solution should be: 1. as first measure, check if a method exists before calling it (something like if entity.respond_to?(head.to_s.underscore.downcase)) , so if not able to call "host" on a container object, it won't crash. 2. in addition, the "bigger picture" solution for next version (I'll open a separate issue) - hierarchy for topology (the @included_relations variable present on every provider's topology specific service) should no longer assume there is a single type of "lives_on", and it should support multiple types that are not always linked in the same hierarchy (lives_on could be of type container, VM, some other type, etc) Jiri, please work on it, and seek review&assistance if needed from David Halasz, he rewrote recently a lot of parts in topology, and in particular the parts related to this bug. I wrote this up - I think its related: https://issues.jboss.org/browse/HAWKULAR-1213 The hot-fix that basically doesn't allow to call a method that is not defined is here: https://github.com/ManageIQ/manageiq-ui-classic/pull/1221 However, this only prevents the error pop-up and allows the topology graph to render, but doesn't actually show the linked container in the graph. https://github.com/ManageIQ/manageiq-ui-classic/pull/1223 is the real fix on top of #1221 (In reply to John Mazzitelli from comment #4) > I wrote this up - I think its related: > https://issues.jboss.org/browse/HAWKULAR-1213 John, it is not related to the issue reported in this bug. pr merged https://github.com/ManageIQ/manageiq-ui-classic/pull/1223 and backported by https://github.com/ManageIQ/manageiq/pull/14941 |