Bug 1651318 - When trying to publish VM to template screen appears "empty"
Summary: When trying to publish VM to template screen appears "empty"
Keywords:
Status: CLOSED DUPLICATE of bug 1622952
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.10.0
Hardware: All
OS: All
unspecified
high
Target Milestone: GA
: cfme-future
Assignee: Dan Clarizio
QA Contact: Sudhir Mallamprabhakara
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-19 16:51 UTC by Andrés Valero
Modified: 2018-11-21 13:41 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-20 13:03:18 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:


Attachments (Terms of Use)
Steps with screenshots explaining how to reproduce it (286.15 KB, application/pdf)
2018-11-19 16:51 UTC, Andrés Valero
no flags Details

Description Andrés Valero 2018-11-19 16:51:11 UTC
Created attachment 1507306 [details]
Steps with screenshots explaining how to reproduce it

Description of problem:
When trying to publish VM to template screen appears "empty"

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

How reproducible:
Try to publish VM to a Template

Steps to Reproduce:
1. Select a VM
2. Click in Lifecycle
3. Click "Publish VM to a Template"
4. Check tabs in the provisioning screen 
5. You will see empty tabs

Actual results:
Expected tabs are not where they should be

Expected results:
Tabs not empty expected

Additional info:

Comment 2 Tina Fitzgerald 2018-11-19 22:38:47 UTC
The offending code is here:
https://github.com/ManageIQ/manageiq-ui-classic/blob/master/app/controllers/application_controller/miq_request_methods.rb#L31

There are multiple code changes in that method, but this PR introduces the MiqTemplate find: https://github.com/ManageIQ/manageiq-ui-classic/pull/3928
@record = MiqTemplate.find(@edit[:new][:src_vm_id].first)
which causes the failure 

Stack trace from my test appliance:
[----] I, [2018-11-19T16:07:06.477112 #15218:1410734]  INFO -- : Started POST "/miq_request/prov_field_changed?tab_id=requester" for 127.0.0.1 at 2018-11-19 16:07:06 -0500
[----] I, [2018-11-19T16:07:06.479997 #15218:1410734]  INFO -- : Processing by MiqRequestController#prov_field_changed as JS
[----] I, [2018-11-19T16:07:06.480051 #15218:1410734]  INFO -- :   Parameters: {"tab_id"=>"requester"}
[----] F, [2018-11-19T16:07:06.570271 #15218:1410734] FATAL -- : Error caught: [ActiveRecord::RecordNotFound] Couldn't find MiqTemplate with 'id'=135 [WHERE "vms"."type" IN ('MiqTemplate', 'ManageIQ::Providers::CloudManager::Template', 'ManageIQ::Providers::InfraManager::Template', 'ManageIQ::Providers::Amazon::CloudManager::Template', 'ManageIQ::Providers::Azure::CloudManager::Template', 'ManageIQ::Providers::Google::CloudManager::Template', 'ManageIQ::Providers::Openstack::CloudManager::Template', 'ManageIQ::Providers::Openstack::CloudManager::VolumeSnapshotTemplate', 'ManageIQ::Providers::Openstack::CloudManager::VolumeTemplate', 'ManageIQ::Providers::Vmware::CloudManager::Template', 'TemplateXen', 'ManageIQ::Providers::Kubevirt::InfraManager::Template', 'ManageIQ::Providers::Openstack::InfraManager::Template', 'ManageIQ::Providers::Redhat::InfraManager::Template', 'ManageIQ::Providers::Microsoft::InfraManager::Template', 'ManageIQ::Providers::Vmware::InfraManager::Template') AND "vms"."template" = $1]
/opt/rh/cfme-gemset/gems/activerecord-5.0.7/lib/active_record/relation/finder_methods.rb:353:in `raise_record_not_found_exception!'
/opt/rh/cfme-gemset/gems/activerecord-5.0.7/lib/active_record/relation/finder_methods.rb:479:in `find_one'
/opt/rh/cfme-gemset/gems/activerecord-5.0.7/lib/active_record/relation/finder_methods.rb:458:in `find_with_ids'
/opt/rh/cfme-gemset/gems/activerecord-5.0.7/lib/active_record/relation/finder_methods.rb:66:in `find'
/opt/rh/cfme-gemset/gems/activerecord-5.0.7/lib/active_record/querying.rb:3:in `find'
/opt/rh/cfme-gemset/gems/activerecord-5.0.7/lib/active_record/core.rb:151:in `find'
/opt/rh/cfme-gemset/bundler/gems/cfme-ui-classic-c40152cd3d6e/app/controllers/application_controller/miq_request_methods.rb:31:in `prov_field_changed'
/opt/rh/cfme-gemset/gems/actionpack-5.0.7/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
/opt/rh/cfme-gemset/gems/actionpack-5.0.7/lib/abstract_controller/base.rb:188:in `process_action'
/opt/rh/cfme-gemset/gems/actionpack-5.0.7/lib/action_controller/metal/rendering.rb:30:in `process_action'


Since we're publishing a template from a VM, trying to do a find on miq_template fails.
I get the same error in console:
irb(main):001:0> MiqTemplate.find 135
PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0
ActiveRecord::RecordNotFound: Couldn't find MiqTemplate with 'id'=135 [WHERE "vms"."type" IN ('MiqTemplate', 'ManageIQ::Providers::CloudManager::Template', 'ManageIQ::Providers::InfraManager::Template', 'ManageIQ::Providers::Amazon::CloudManager::Template', 'ManageIQ::Providers::Azure::CloudManager::Template', 'ManageIQ::Providers::Google::CloudManager::Template', 'ManageIQ::Providers::Openstack::CloudManager::Template', 'ManageIQ::Providers::Openstack::CloudManager::VolumeSnapshotTemplate', 'ManageIQ::Providers::Openstack::CloudManager::VolumeTemplate', 'ManageIQ::Providers::Vmware::CloudManager::Template', 'TemplateXe


This find works properly:
irb(main):002:0> Vm.find 135
=> #<ManageIQ::Providers::Vmware::InfraManager::Vm id: 135, vendor: "vmware", format: nil, version: nil, name: "billy_reconfig001", description: nil, location: "billy_reconfig001/billy_reconfig001.vmx", config_xml: nil, autostart: nil, host_id: nil, last_sync_on: nil, created_on: "2018-11-19 20:45:14", updated_on: "2018-11-19 20:45:14", storage_id: 2, guid: "f11407e1-d142-4aec-a493-c43958d1d803", ems_id: 2, last_scan_on: nil, last_scan_attempt_on: nil, uid_ems: "420c1e43-d036-895b-47da-2f972ad3cb62", retires_on: nil, retired: nil, boot_time: "2018-08-30 20:47:13", tools_status: "toolsNotInstalled", standby_action: "checkpoint",

Comment 3 John Dupuy 2018-11-20 13:03:18 UTC

*** This bug has been marked as a duplicate of bug 1622952 ***


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