Description of problem: Due to known bug in 5.5.3.something our retirement command in Heat template was not working. So we updated to 5.5.4.2.20160517154712_629f93b, but since than we totally lost control over OpenStack, "Refresh relationships" is not working, machines are not able to be managed Version-Release number of selected component (if applicable): 5.5.4.2.20160517154712_629f93b THIS IS A NON RH PRODUCT! OpenStack is Kilo release by TCPCloud (now Openstack Salt) How reproducible: We did full reinstallation, PoC instance in version 5.5.2.4.20160127105142_395c086 is still behaving well against the same OpenStack. Steps to Reproduce: 1. 2. 3. Actual results: [----] E, [2016-06-22T10:57:59.880107 #29309:4cb990] ERROR -- : MIQ(ManageIQ::Providers::Openstack::CloudManager::Refresher#refresh) EMS: [TietoOS-EC], id: [2000000000001] Refresh failed [----] E, [2016-06-22T10:57:59.880272 #29309:4cb990] ERROR -- : [NoMethodError]: undefined method `[]' for nil:NilClass Method:[rescue in block in refresh] [----] E, [2016-06-22T10:57:59.880423 #29309:4cb990] ERROR -- : /var/www/miq/vmdb/app/models/ems_refresh/save_inventory.rb:62:in `block (2 levels) in save_vms_inventory' Expected results: A working refresh of the provider Additional info:
Hi, did small investigation: - added .to_yaml for problematic object to _log.debug message: ( _log.debug "#{log_header} LOOOOOOOO: #{key_backup.to_yaml}” ) - differ object, which not causing issue and one that did and here is differences: correct one contains non-empty cloud_tenants structure: :cloud_tenants: - :type: ManageIQ::Providers::Openstack::CloudManager::CloudTenant :name: demo-cfme :description: Development of OpenStack CloudForms integration. Resp. Lubomír Moric :enabled: true :ems_ref: 4dc9995bdb804c4184372e4043de92d3 :id: 2000000000001 :_object: !ruby/object:ManageIQ::Providers::Openstack::CloudManager::CloudTenant raw_attributes: ems_id: '2000000000001' ems_ref: 4dc9995bdb804c4184372e4043de92d3 id: '2000000000001' name: demo-cfme description: Development of OpenStack CloudForms integration. Resp. Lubomír Moric enabled: true created_at: '2016-06-22 08:55:51.832354' updated_at: '2016-06-22 08:55:51.832354' type: ManageIQ::Providers::Openstack::CloudManager::CloudTenant attributes: !ruby/object:ActiveRecord::AttributeSet attributes: !ruby/object:ActiveRecord::LazyAttributeHash types: *8 values: id: '2000000000001' name: demo-cfme description: Development of OpenStack CloudForms integration. Resp. Lubomír Moric enabled: t ems_ref: 4dc9995bdb804c4184372e4043de92d3 ems_id: '2000000000001' created_at: '2016-06-22 08:55:51.832354' updated_at: '2016-06-22 08:55:51.832354' type: ManageIQ::Providers::Openstack::CloudManager::CloudTenant additional_types: *9 materialized: true …. …. object, on which we fails: :cloud_tenants: - *8 - cloud_tenants is empty structure. Attached part of log with one valid and non valid object.
Fix is here https://github.com/ManageIQ/manageiq/pull/9378 I believe this occurs when Image have a tenant_id, that ManageIQ doesn't have rights for, therefore it's not able to connect it to tenant in ManageIQ. Which produces nils in array of the tenants. So, this is actual bug, not related to OpenStack version or distribution.
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/53eaebf4b8a7a9d65ade83c59e7f1f78f6273eb4 commit 53eaebf4b8a7a9d65ade83c59e7f1f78f6273eb4 Author: Ladislav Smola <lsmola> AuthorDate: Thu Jun 23 11:17:42 2016 +0200 Commit: Ladislav Smola <lsmola> CommitDate: Thu Jun 23 11:19:34 2016 +0200 Handle gracefully a missing tenant relationship Handle gracefully a missing tenant relationship, missing relationship can be caused by seeing tenant id on Image, while not having rights to read the actual tenant. Fixes BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1349310 app/models/ems_refresh/save_inventory.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
https://github.com/ManageIQ/manageiq/pull/9370
Verified on 5.7.0.11 refresh works