Bug 1475405 - Unable to provision against vmware with "multiple parents found" error
Summary: Unable to provision against vmware with "multiple parents found" error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.7.0
Hardware: All
OS: All
unspecified
high
Target Milestone: GA
: 5.9.0
Assignee: Adam Grare
QA Contact: Alex Newman
URL:
Whiteboard:
: 1465612 (view as bug list)
Depends On:
Blocks: 1477722 1479805
TreeView+ depends on / blocked
 
Reported: 2017-07-26 15:04 UTC by Felix Dewaleyne
Modified: 2020-12-14 09:15 UTC (History)
8 users (show)

Fixed In Version: 5.9.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1477722 1479805 (view as bug list)
Environment:
Last Closed: 2018-03-06 14:33:15 UTC
Category: ---
Cloudforms Team: VMware
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Felix Dewaleyne 2017-07-26 15:04:12 UTC
Description of problem:
When provisioning certain templates against vmware the error "multiple parents found" stops the provision entirely

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

How reproducible:
all the time

Steps to Reproduce:
1. provision the affected template
2.
3.

Actual results:
[----] E, [2017-07-24T11:25:08.095293 #857:b9b130] ERROR -- : <AutomationEngine> The following error occurred during instance method <parent_blue_folder_1_name> for AR object <#<ManageIQ::Providers::Vmware::InfraManager::Template id: 21000000004868, vendor: "vmware", format: nil, version: nil, name: "rhel_6.7_64_STD_V170720", description: nil, location: "rhel_6.7_64_STD_V170720/rhel_6.7_64_STD_V170720.vm...", config_xml: nil, autostart: nil, host_id: 21000000000402, last_sync_on: nil, created_on: "2017-07-21 11:50:29", updated_on: "2017-07-21 11:53:59", storage_id: 21000000001822, guid: "cb1c93c8-6e0a-11e7-a617-0050568355de", ems_id: 21000000000013, last_scan_on: nil, last_scan_attempt_on: nil, uid_ems: "422094e8-e248-4731-d7fa-c58ec3118156", retires_on: nil, retired: nil, boot_time: nil, tools_status: "toolsNotRunning", standby_action: "checkpoint", power_state: "never", state_changed_on: "2017-07-21 11:50:31", previous_state: "poweredOff", connection_state: "connected", last_perf_capture_on: nil, registered: nil, busy: nil, smart: nil, memory_reserve: 0, memory_reserve_expand: false, memory_limit: -1, memory_shares: 40960, memory_shares_level: "normal", cpu_reserve: 0, cpu_reserve_expand: false, cpu_limit: -1, cpu_shares: 2000, cpu_shares_level: "normal", cpu_affinity: nil, ems_created_on: nil, template: true, evm_owner_id: nil, ems_ref_obj: "--- !ruby/string:VimString\nstr: vm-59862\nxsiType: ...", miq_group_id: 21000000000001, linked_clone: false, fault_tolerance: false, type: "ManageIQ::Providers::Vmware::InfraManager::Templat...", ems_ref: "vm-59862", ems_cluster_id: 21000000000140, retirement_warn: nil, retirement_last_warn: nil, vnc_port: nil, flavor_id: nil, availability_zone_id: nil, cloud: false, retirement_state: nil, cloud_network_id: nil, cloud_subnet_id: nil, cloud_tenant_id: nil, raw_power_state: "never", publicly_available: nil, orchestration_stack_id: nil, retirement_requester: nil, tenant_id: 21000000000001, resource_group_id: nil, deprecated: nil, storage_profile_id: nil>>
[----] E, [2017-07-24T11:25:08.095736 #857:b9b130] ERROR -- : <AutomationEngine> MiqAeServiceModelBase.ar_method raised: <RuntimeError>: <Multiple parents found.>
[----] E, [2017-07-24T11:25:08.095930 #857:b9b130] ERROR -- : <AutomationEngine> /var/www/miq/vmdb/app/models/mixins/relationship_mixin.rb:158:in `parent'
/var/www/miq/vmdb/app/models/vm_or_template.rb:743:in `block in parent_blue_folder'
/var/www/miq/vmdb/app/models/mixins/relationship_mixin.rb:84:in `with_relationship_type'
/var/www/miq/vmdb/app/models/vm_or_template.rb:742:in `parent_blue_folder'
/var/www/miq/vmdb/app/models/vm_or_template.rb:749:in `parent_blue_folders'
/var/www/miq/vmdb/app/models/vm_or_template.rb:250:in `block (2 levels) in <class:VmOrTemplate>'
/var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:270:in `public_send'
/var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:270:in `block in object_send'
/var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:289:in `ar_method'
/var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:299:in `ar_method'
/var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:268:in `object_send'
/var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:123:in `block (2 levels) in expose'
(irb):3:in `block in irb_binding'
(irb):1:in `each'
(irb):1:in `irb_binding'
/opt/rh/rh-ruby23/root/usr/share/ruby/irb/workspace.rb:87:in `eval'
/opt/rh/rh-ruby23/root/usr/share/ruby/irb/workspace.rb:87:in `evaluate'
/opt/rh/rh-ruby23/root/usr/share/ruby/irb/context.rb:380:in `evaluate'
/opt/rh/rh-ruby23/root/usr/share/ruby/irb.rb:489:in `block (2 levels) in eval_input'
/opt/rh/rh-ruby23/root/usr/share/ruby/irb.rb:623:in `signal_status'
/opt/rh/rh-ruby23/root/usr/share/ruby/irb.rb:486:in `block in eval_input'
/opt/rh/rh-ruby23/root/usr/share/ruby/irb/ruby-lex.rb:246:in `block (2 levels) in each_top_level_statement'
/opt/rh/rh-ruby23/root/usr/share/ruby/irb/ruby-lex.rb:232:in `loop'
/opt/rh/rh-ruby23/root/usr/share/ruby/irb/ruby-lex.rb:232:in `block in each_top_level_statement'
/opt/rh/rh-ruby23/root/usr/share/ruby/irb/ruby-lex.rb:231:in `catch'
/opt/rh/rh-ruby23/root/usr/share/ruby/irb/ruby-lex.rb:231:in `each_top_level_statement'
/opt/rh/rh-ruby23/root/usr/share/ruby/irb.rb:485:in `eval_input'
/opt/rh/rh-ruby23/root/usr/share/ruby/irb.rb:395:in `block in start'
/opt/rh/rh-ruby23/root/usr/share/ruby/irb.rb:394:in `catch'
/opt/rh/rh-ruby23/root/usr/share/ruby/irb.rb:394:in `start'
/opt/rh/cfme-gemset/gems/railties-5.0.2/lib/rails/commands/console.rb:65:in `start'
/opt/rh/cfme-gemset/gems/railties-5.0.2/lib/rails/commands/console_helper.rb:9:in `start'
/opt/rh/cfme-gemset/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:78:in `console'
/opt/rh/cfme-gemset/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
/opt/rh/cfme-gemset/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'

Expected results:
provision completes

Additional info:

Comment 5 CFME Bot 2017-07-27 21:46:44 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/b1ed3c82bfc7760eeba9464775c636edda23661f

commit b1ed3c82bfc7760eeba9464775c636edda23661f
Author:     Adam Grare <agrare>
AuthorDate: Thu Jul 27 15:09:54 2017 -0400
Commit:     Adam Grare <agrare>
CommitDate: Thu Jul 27 15:28:20 2017 -0400

    Return VMs and Templates for EMS prev_relats
    
    When retrieving vmdb_relats_ems we weren't including templates in the
    list of children for folders.  This isn't an issue for clusters, hosts,
    and resource_pools because templates don't belong to any of these but
    they do belong to folders.
    
    If a VM was marked as a template and moved into a new folder it was not
    being included in the prev_relats which meant that its previous
    resource_pool and folder relat were not being deleted, but we were
    adding a new folder relationship.  This caused the "multiple parents
    found" exception seen occasionally on the UI while provisioning.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1475405

 app/models/ems_refresh/metadata_relats.rb       | 13 ++++++-
 spec/models/ems_refresh/metadata_relats_spec.rb | 51 +++++++++++++++----------
 2 files changed, 41 insertions(+), 23 deletions(-)

Comment 6 Adam Grare 2017-07-28 13:32:23 UTC
I was able to reproduce this by just moving a template into a different folder and running a full refresh, it was not required to mark as a template and move into a new folder so the reproduction steps are a little simpler than originally thought.

Comment 9 Adam Grare 2018-01-02 17:24:57 UTC
*** Bug 1465612 has been marked as a duplicate of this bug. ***


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