Bug 1393942 - RHV Host refresh fail on undefined method `detect' for nil:NilClass
Summary: RHV Host refresh fail on undefined method `detect' for nil:NilClass
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.7.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: GA
: 5.9.0
Assignee: Piotr Kliczewski
QA Contact: Ilanit Stein
URL:
Whiteboard: rhev
Depends On:
Blocks: 1460334
TreeView+ depends on / blocked
 
Reported: 2016-11-10 16:50 UTC by Ilanit Stein
Modified: 2018-03-06 14:33 UTC (History)
7 users (show)

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


Attachments (Terms of Use)
cfme_logs (9.09 MB, application/zip)
2016-11-10 16:51 UTC, Ilanit Stein
no flags Details
evm.log (2.93 MB, application/x-gzip)
2017-05-16 19:12 UTC, Ilanit Stein
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github ManageIQ manageiq-providers-ovirt pull 38 0 None None None 2017-05-17 09:37:54 UTC

Description Ilanit Stein 2016-11-10 16:50:42 UTC
Description of problem:
A CFME appliance fail to refresh host, when connected to a RHV-4.0
scale setup with [Clusters 1, Hosts 39, Datastores 12, VMs and Instances 2171,
Templates 1].
The failure is seen in the RHV provider summary page, in "Last Refresh" field:
"Error - 2 Minutes Ago
undefined method `detect' for nil:NilClass"

and it's trace can be seen in evm.log, starting with the following message for example (the ERROR repeats in the evm.log, as there are more refresh trials)
 
"[----] E, [2016-11-10T10:33:56.764153 #25015:feb154] ERROR -- : /var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:50:in `refresh'

Version-Release number of selected component (if applicable):
CFME-5.7.0.10 + https://github.com/ManageIQ/manageiq/pull/12529
RHV-4.0.5.5-0.1.el7ev

Steps to Reproduce:
Just add such a RHV provider to CFME appliance (No changes were made in the CFME appliance).

Comment 2 Ilanit Stein 2016-11-10 16:51:50 UTC
Created attachment 1219461 [details]
cfme_logs

Comment 3 Piotr Kliczewski 2017-02-16 13:16:22 UTC
I checked the logs and it seems that we fail to parse host nics. Is the issue still there? Can I access the environment?

Comment 5 Ilanit Stein 2017-05-16 19:12:50 UTC
Created attachment 1279409 [details]
evm.log

Comment 6 Ilanit Stein 2017-05-16 19:15:46 UTC
Further to comment 4:  
This reproduce occur when running host refresh. The full refreshes ended up successfully.

Comment 7 Piotr Kliczewski 2017-05-17 07:59:43 UTC
Do you see the same issue when using api4?

Comment 8 Ilanit Stein 2017-05-17 09:19:05 UTC
yes.

I changed to V4. 
(by moving config/settings.yml: ovirt_engine_sdk to true, and restart emserverd),d run host refresh.

Host (any host)->Configuration->"Refresh Relationships and Power States"

Fail in CFME UI provider summary page, Last refresh:  
"Error - 27 Minutes Ago
undefined method `detect' for nil:NilClass"

In evm.log:
"
[----] W, [2017-05-17T04:48:58.144470 #5323:3c5140]  WARN -- : MIQ(ManageIQ::Providers::Redhat::InfraManager::Refresh::Parse::Strategies::Api4.host_inv_to_ip) IP lookup by hostname [fake.host100.com]...Failed with the following error: getaddrinfo: Name or service not known
[----] E, [2017-05-17T04:48:58.144971 #5323:3c5140] ERROR -- : MIQ(ManageIQ::Providers::Redhat::InfraManager::Refresh::Strategies::Api4#refresh) EMS: [scale-rhv], id: [1] Refresh failed
[----] E, [2017-05-17T04:48:58.149117 #5323:3c5140] ERROR -- : [NoMethodError]: undefined method `detect' for nil:NilClass  Method:[rescue in block in refresh]
[----] E, [2017-05-17T04:48:58.149683 #5323:3c5140] ERROR -- : /var/www/miq/vmdb/app/models/manageiq/providers/redhat/infra_manager/refresh/parse/strategies/host_inventory.rb:138:in `block in host_inv_to_switch_hashes'
/var/www/miq/vmdb/app/models/manageiq/providers/redhat/infra_manager/refresh/parse/strategies/host_inventory.rb:135:in `each'
/var/www/miq/vmdb/app/models/manageiq/providers/redhat/infra_manager/refresh/parse/strategies/host_inventory.rb:135:in `host_inv_to_switch_hashes'
/var/www/miq/vmdb/app/models/manageiq/providers/redhat/infra_manager/refresh/parse/strategies/host_inventory.rb:44:in `block in host_inv_to_hashes'
/var/www/miq/vmdb/app/models/manageiq/providers/redhat/infra_manager/refresh/parse/strategies/host_inventory.rb:19:in `each'
/var/www/miq/vmdb/app/models/manageiq/providers/redhat/infra_manager/refresh/parse/strategies/host_inventory.rb:19:in `host_inv_to_hashes'
/var/www/miq/vmdb/app/models/manageiq/providers/redhat/infra_manager/refresh/parse/strategies/api4.rb:90:in `host_inv_to_hashes'
/var/www/miq/vmdb/app/models/manageiq/providers/redhat/infra_manager/refresh/parse/parser.rb:11:in `ems_inv_to_hashes'
/var/www/miq/vmdb/app/models/manageiq/providers/redhat/infra_manager/refresh/refresher.rb:39:in `block in parse_targeted_inventory'
/opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-e0f3ea8755bf/lib/gems/pending/util/extensions/miq-benchmark.rb:11:in `realtime_store'
/opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-e0f3ea8755bf/lib/gems/pending/util/extensions/miq-benchmark.rb:30:in `realtime_block'
/var/www/miq/vmdb/app/models/manageiq/providers/redhat/infra_manager/refresh/refresher.rb:38:in `parse_targeted_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:87:in `block in refresh_targets_for_ems'
/opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-e0f3ea8755bf/lib/gems/pending/util/extensions/miq-benchmark.rb:11:in `realtime_store'
/opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-e0f3ea8755bf/lib/gems/pending/util/extensions/miq-benchmark.rb:30:in `realtime_block'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:86:in `refresh_targets_for_ems'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:24:in `block (2 levels) in refresh'
/opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-e0f3ea8755bf/lib/gems/pending/util/extensions/miq-benchmark.rb:11:in `realtime_store'
/opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-e0f3ea8755bf/lib/gems/pending/util/extensions/miq-benchmark.rb:30:in `realtime_block'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:24:in `block in refresh'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:14:in `each'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:14:in `refresh'
/var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:9:in `refresh'
/var/www/miq/vmdb/app/models/ems_refresh.rb:98:in `block in refresh'
/var/www/miq/vmdb/app/models/ems_refresh.rb:97:in `each'
/var/www/miq/vmdb/app/models/ems_refresh.rb:97:in `refresh'
/var/www/miq/vmdb/app/models/miq_queue.rb:347:in `block in deliver'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:91:in `block in timeout'
. . .

Comment 9 Ilanit Stein 2017-05-18 07:10:40 UTC
Tested the fix on CFME-5.8.0.14/RHV-4.1.2

For both api versions 3 & 4, Targeted refresh for the host was done.

In addition, there was also a full refresh, triggered by some VM change:

[----] I, [2017-05-17T11:17:59.695403 #20294:949134]  INFO -- : MIQ(MiqQueue.put) Message id: [108149],  id: [], Zone: [default], Role: [event], Server: [], Ident: [ems], Target id: [1], Instance id: [], Task id: [], Command: [EmsEvent.add], Timeout: [600], Priority: [100], State: [ready], Deliver On: [], Data: [], Args: [{:event_type=>"UNKNOWN", :source=>"RHEVM", :message=>"VM a_vm_scale_3599 on host fake.host184.com was guaranteed 128 MB but currently has 0 MB", :timestamp=>2017-05-17 15:17:38 UTC, :username=>nil, :full_data=>{:id=>"45485", :href=>"/ovirt-engine/api/events/45485", :description=>"VM a_vm_scale_3599 on host fake.host184.com was guaranteed 128 MB but currently has 0 MB", :severity=>"error", :code=>148, :time=>2017-05-17 15:17:38 UTC, :name=>"UNKNOWN"}, :ems_id=>1, :vm_ems_ref=>nil, :host_ems_ref=>nil, :ems_cluster_ems_ref=>nil}]

Comment 11 Ilanit Stein 2017-11-09 13:12:14 UTC
Verified on CFME-5.9.0.4(api V4 set by default)/RHV-4.1.7

RHV had 250 VMs.

Full refresh - successful
Host refresh - successful


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