Bug 1322272

Summary: undefined method `fulltree_arranged' for nil:NilClass [vm_infra/pre_prov]
Product: Red Hat CloudForms Management Engine Reporter: Pavol Kotvan <pakotvan>
Component: ProvidersAssignee: Adam Grare <agrare>
Status: CLOSED NOTABUG QA Contact: Pavol Kotvan <pakotvan>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.5.0CC: hkataria, jfrey, jhardy, mpovolny, obarenbo, pakotvan
Target Milestone: GA   
Target Release: 5.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: ui:provision
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-12 09:48:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Comment 3 Harpreet Kataria 2016-03-31 19:58:08 UTC
Pavol,

I am curious to find out how did you delete Provider that the templates in question belong to, did you delete the provider from CFME UI? Also can you provide access to the appliance where i can see this issue.

Thanks,
~Harpreet

Comment 5 Harpreet Kataria 2016-04-01 13:23:19 UTC
Greg,

It looks like when a provider is deleted from db, it didnt update ems_id column for VM records, VMs that do not belong to a provider should not be returned by eligible_for_provisioning method https://github.com/ManageIQ/manageiq/blob/master/app/models/miq_template.rb#L28, that's being called to display pre provisioning list for user to select a template.

I downloaded a db in question from appliance and confirmed that ems_id column is still populated for the VM records whereas there are no providers in the db.

Let me know if you have questions or need a copy of the database.

Thanks,
~Harpreet

Comment 6 Greg McCullough 2016-04-01 14:04:53 UTC
Sending to Provider group.

The eligible_for_provisioning method relies on the vms.ems_id being nil excluded templates from the list.  In my tests this value is properly nullified when the provider is removed so it is unclear why it did not happen in this instance.

https://github.com/ManageIQ/manageiq/blob/master/app/models/miq_template.rb#L29

Other VmOrTemplate methods like archived? and orphaned? also rely on the nil ems_id.  

Therefore the issue here is understanding why that column is not being reset.

Comment 7 Adam Grare 2016-05-02 14:00:38 UTC
Pavol,

I also tested this and see the ems_id cleared properly, do you have logs from when this happened and/or are you able to reproduce it?

Thanks,
Adam