Bug 1303086 - objects copied from a previous deleted domain try to refer to the deleted domain when used
Summary: objects copied from a previous deleted domain try to refer to the deleted dom...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.4.0
Hardware: All
OS: All
high
medium
Target Milestone: GA
: 5.5.3
Assignee: William Fitzgerald
QA Contact: Alex Newman
URL:
Whiteboard:
Depends On: 1301123
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-29 13:59 UTC by Satoe Imaishi
Modified: 2019-09-12 09:52 UTC (History)
9 users (show)

Fixed In Version: 5.5.3.2
Doc Type: Bug Fix
Doc Text:
Methods and instances copied from an older domain into a new one continued to attempt calling the previous domain, even after it was deleted. This occurred due to inheritance retention from the deleted domain. This inheritance has been removed from the code and now only objects from the new domain are called.
Clone Of: 1301123
Environment:
Last Closed: 2016-04-13 18:42:20 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0616 0 normal SHIPPED_LIVE CFME 5.5.3 bug fixes and enhancement update 2016-04-13 22:38:44 UTC

Comment 2 Greg McCullough 2016-02-10 21:18:10 UTC
Update to the suggested query: 
MiqAeClass.where("inherits IS NOT NULL").update_all(:inherits => nil)

Comment 3 CFME Bot 2016-03-03 16:57:19 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=4e39db8bb6d37060ff7e6b7a7d9705e6fe77be50

commit 4e39db8bb6d37060ff7e6b7a7d9705e6fe77be50
Author:     Bill Fitzgerald <wfitzger>
AuthorDate: Tue Feb 23 12:10:03 2016 -0500
Commit:     Bill Fitzgerald <wfitzger>
CommitDate: Thu Mar 3 10:53:50 2016 -0500

    Automate - fix inherits problem.
    
    Removed inheritance check in miq_ae_object.rb
    
    Removed inheritance test from miq_ae_engine_spec.rb
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1303086
    
    Original BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1301123
    
    Original PR: https://github.com/ManageIQ/manageiq/pull/6896

 lib/miq_automation_engine/engine/miq_ae_object.rb  |  2 +-
 .../miq_automation_engine/miq_ae_engine_spec.rb    | 28 ----------------------
 .../miq_automation_engine/miq_ae_object_spec.rb    | 10 ++++++++
 3 files changed, 11 insertions(+), 29 deletions(-)

Comment 4 CFME Bot 2016-03-03 16:57:24 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=0800dce99ffc5c113ef65fc8162c9a8d40a70f3d

commit 0800dce99ffc5c113ef65fc8162c9a8d40a70f3d
Merge: 7d92abd 4e39db8
Author:     Greg McCullough <gmccullo>
AuthorDate: Thu Mar 3 11:55:02 2016 -0500
Commit:     Greg McCullough <gmccullo>
CommitDate: Thu Mar 3 11:55:02 2016 -0500

    Merge branch '5.5.z.fix_inherits_problem' into '5.5.z'
    
    Automate - fix inherits problem.
    
    Removed inheritance check in miq_ae_object.rb
    
    Removed inheritance test from miq_ae_engine_spec.rb
    
    Resolved conflicts in Cherry Pick.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1303086
    
    Original BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1301123
    
    Original PR: https://github.com/ManageIQ/manageiq/pull/6896
    
    See merge request !833

 lib/miq_automation_engine/engine/miq_ae_object.rb  |  2 +-
 .../miq_automation_engine/miq_ae_engine_spec.rb    | 28 ----------------------
 .../miq_automation_engine/miq_ae_object_spec.rb    | 10 ++++++++
 3 files changed, 11 insertions(+), 29 deletions(-)

Comment 8 mkanoor 2016-04-08 15:48:54 UTC
Alex,
If you look in the older versions of CFME they used to have a user selected field called Inherits, which doesn't exist in the newer versions. So if you have an older version of CFME you would select some classes and just set the inherits field to a class name from the drop down list.

You can then export the Automate Model in the older version, which will be in XML.

Convert the XML to YAML model
rake evm:automate:convert DOMAIN=domain_name FILE=<old_xml_file_from_previous_version> EXPORT_DIR=./model_export|ZIP_FILE=filename|YAML_FILE=filename"


Once you have a YAML export files which have the inherits set you can import it into Automate and start using those classes.

If you don't have an older version you would have to set the inherits field manually.


(1) start a rails console
       bin/rails c
(2) Update the REQUEST class inherits field using
    MiqAeClass.find_by_fqname('/ManageIQ/System/Request').update_attributes(:inherits => '/ManageIQ/System/REQ')

    This is basically leaving a remanant from an old XML pointing to a class which we know doesn't exist.

(3) Using the CFME UI go to Automation -> Simulation
    System/Process              Request
    Message                     create
    Request                     InspectMe

Simulation Parameters
   Execute Methods should be checked

(4) Hit Submit Button

Check the log/automation log you should see an error message
ERROR -- : Class [/ManageIQ/System/REQ] not found in MiqAeDatastore

If you run with the new changes you will see us ignoring the inherits field (remnanants from the older databases) and not issuing the error

Comment 9 Alex Newman 2016-04-11 16:37:00 UTC
5.5.3.4.20160407153134_b3e2a83

Comment 11 errata-xmlrpc 2016-04-13 18:42:20 UTC
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/RHBA-2016:0616

Comment 12 mkanoor 2016-04-18 13:46:18 UTC
Provided information in earlier comment

Comment 13 mkanoor 2016-04-25 14:57:50 UTC
Provided information in an earlier comment


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