Description of problem: when calling the destroy method of a generic object (DRO), the object is removed from VMDB but not removed from the linked service. The service.generic_objects array then have a nil entry wich cause th UI to crash when tryin to display the generic objects of this service. Version-Release number of selected component (if applicable): 5.9.2 How reproducible: every times Steps to Reproduce: 1. create a dro instance: dro_class = $evm.vmdb(:generic_object_definition).find_by(:name => "demo_dro") dro = dro_class.create_object(:name => "First Demo DRO", :is_tired => true, :created => Time.new, :retirement => nil) 2. link this object to a service dro.add_to_service(svc) 3. check the association returns an array with the dro svc.generic_object 4. destroy the object dro.destroy 3. check the association returns an array without the dro svc.generic_object Actual results: the svc.generic_object returns [nil] Expected results: the svc.generic_object returns [] Additional info:
Work-around is to remove the generic object from the service before deleting the object using the remove_from_service method. Patrik - I can see two possible solutions here and both likely make sense to implement. 1. Remove the generic object from all services in a before_destroy callback. 2. Call ".compact" on the services "generic_object" relationship so any nil objects are removed from the return.
solved in PR: https://github.com/ManageIQ/manageiq/pull/17679
Fixed , Verified in 5.10.0.32.20190115185124_c957ada. The object was also removed from service once the generic object was destroyed .
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, 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-2019:0212