Red Hat Bugzilla – Bug 1277995
NoMethodError during inventory of Satellite 6 without any hostgroups
Last modified: 2015-12-08 08:43:52 EST
Description of problem: Version-Release number of selected component (if applicable): CFME 5.5.0.8 Satellite 6.1.3 How reproducible: Always Steps to Reproduce: 1. Create Satellite 6 Server (create a host or two, but without a hostgroup_ 2. Add Satellite 6 provider to CFME 3. View evm.log output from refresh worker Actual results: NoMethodErrors appear in log file Expected results: Inventory to succeed even if there is not a hostgroup Additional info: It is unlikely that a user will have a Satellite 6 server without a hostgroup. Relevent log lines: [----] I, [2015-11-03T19:23:55.572313 #50290:c1d98c] INFO -- : MIQ(ManageIQ::Providers::Foreman::ConfigurationManager::RefreshWorker::Runner#get_message_via_drb) Message id: [15773], MiqWorker id: [13], Zone: [default], Role: [ems_inventory], Server: [], Ident: [ems_1], Target id: [], Instance id: [], Task id: [], Command: [EmsRefresh.refresh], Timeout: [7200], Priority: [100], State: [dequeue], Deliver On: [], Data: [], Args: [[["ManageIQ::Providers::Foreman::ConfigurationManager", 1]]], Dequeued in: [6.760682734] seconds [----] I, [2015-11-03T19:23:55.572586 #50290:c1d98c] INFO -- : MIQ(MiqQueue#deliver) Message id: [15773], Delivering... [----] I, [2015-11-03T19:23:55.579957 #50290:c1d98c] INFO -- : MIQ(ManageIQ::Providers::Foreman::ConfigurationManager::Refresher#refresh) Refreshing all targets... [----] I, [2015-11-03T19:23:55.580030 #50290:c1d98c] INFO -- : MIQ(ManageIQ::Providers::Foreman::ConfigurationManager::Refresher#refresh) EMS: [satellite6.1-small Configuration Manager], id: [1] Refreshing targets for EMS: [satellite6.1-small Configuration Manager], id: [1]... [----] I, [2015-11-03T19:23:55.580067 #50290:c1d98c] INFO -- : MIQ(ManageIQ::Providers::Foreman::ConfigurationManager::Refresher#refresh) EMS: [satellite6.1-small Configuration Manager], id: [1] ManageIQ::Providers::Foreman::ConfigurationManager [satellite6.1-small Configuration Manager] id [1] [----] I, [2015-11-03T19:23:55.581256 #50290:c1d98c] INFO -- : MIQ(ManageIQ::Providers::Foreman::Provider#with_provider_connection) Connecting through ManageIQ::Providers::Foreman::Provider: [satellite6.1-small] [----] I, [2015-11-03T19:23:55.582761 #50290:c1d98c] INFO -- : ManageiqForeman::Connection#fetch Calling Apipie Resource: :hosts Action: :index Params: {:page=>1, :per_page=>50, "root_pass"=>"<FILTERED>"} [----] I, [2015-11-03T19:23:57.411117 #50290:c1d98c] INFO -- : ManageiqForeman::Connection#fetch Calling Apipie Resource: :hosts Action: :index Params: {:page=>2, :per_page=>50, "root_pass"=>"<FILTERED>"} [----] I, [2015-11-03T19:23:59.245316 #50290:c1d98c] INFO -- : ManageiqForeman::Connection#fetch Calling Apipie Resource: :hostgroups Action: :index Params: {:page=>1, :per_page=>50, "root_pass"=>"<FILTERED>"} [----] E, [2015-11-03T19:23:59.339116 #50290:c1d98c] ERROR -- : MIQ(ManageIQ::Providers::Foreman::ConfigurationManager::Refresher#refresh) EMS: [satellite6.1-small Configuration Manager], id: [1] Refresh failed [----] E, [2015-11-03T19:23:59.339263 #50290:c1d98c] ERROR -- : [NoMethodError]: undefined method `key?' for nil:NilClass Method:[rescue in block in refresh] [----] E, [2015-11-03T19:23:59.339312 #50290:c1d98c] ERROR -- : /var/www/miq/vmdb/gems/manageiq_foreman/lib/manageiq_foreman/inventory.rb:16:in `refresh_configuration' [----] E, [2015-11-03T19:23:59.339351 #50290:c1d98c] ERROR -- : MIQ(ManageIQ::Providers::Foreman::ConfigurationManager::Refresher#refresh) EMS: [satellite6.1-small Configuration Manager], id: [1] Unable to perform refresh for the following targets: [----] E, [2015-11-03T19:23:59.339436 #50290:c1d98c] ERROR -- : MIQ(ManageIQ::Providers::Foreman::ConfigurationManager::Refresher#refresh) --- ManageIQ::Providers::Foreman::ConfigurationManager [satellite6.1-small Configuration Manager] id [1] [----] I, [2015-11-03T19:23:59.383274 #50290:c1d98c] INFO -- : MIQ(ManageIQ::Providers::Foreman::ConfigurationManager::Refresher#refresh) Refreshing all targets...Complete [----] I, [2015-11-03T19:23:59.383535 #50290:c1d98c] INFO -- : MIQ(MiqQueue#delivered) Message id: [15773], State: [ok], Delivered in [3.811041958] seconds
Keenan, can you check on this one. Guessing it's a simple empty set check .. I'm not sure what should be done if there are no hostgroups.
https://github.com/ManageIQ/manageiq/pull/5313
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/9ece643c5146cb45081f5fbefb33c01d510ae57d commit 9ece643c5146cb45081f5fbefb33c01d510ae57d Author: Keenan Brock <kbrock@redhat.com> AuthorDate: Thu Nov 5 13:00:47 2015 -0500 Commit: Keenan Brock <kbrock@redhat.com> CommitDate: Thu Nov 5 13:00:47 2015 -0500 Forman can now collect inventory from system with no hostgroups https://bugzilla.redhat.com/show_bug.cgi?id=1277995 .../lib/manageiq_foreman/inventory.rb | 7 +++- gems/manageiq_foreman/spec/inventory_spec.rb | 45 ++++++++++++++++++++++ 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 gems/manageiq_foreman/spec/inventory_spec.rb
This is in master / 5.6. Does this get cherry-picked back to 5.5? The target version says yes, thought this doesn't seem that hight of a priority. Thoughts?
Yes, this should be back-ported to 5.5.
New commit detected on cfme/5.5.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=081cab498b5693e095a02c1077a6035d739e727b commit 081cab498b5693e095a02c1077a6035d739e727b Author: Keenan Brock <kbrock@redhat.com> AuthorDate: Thu Nov 5 13:00:47 2015 -0500 Commit: Keenan Brock <kbrock@redhat.com> CommitDate: Fri Nov 13 16:16:21 2015 -0500 Forman can now collect inventory from system with no hostgroups https://bugzilla.redhat.com/show_bug.cgi?id=1277995 .../lib/manageiq_foreman/inventory.rb | 7 +++- gems/manageiq_foreman/spec/inventory_spec.rb | 45 ++++++++++++++++++++++ 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 gems/manageiq_foreman/spec/inventory_spec.rb
New commit detected on cfme/5.5.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=0ef7487d1ffb34fd42a4d0275ddcf2e9880a98be commit 0ef7487d1ffb34fd42a4d0275ddcf2e9880a98be Merge: f91817f 081cab4 Author: Greg McCullough <gmccullo@redhat.com> AuthorDate: Fri Nov 13 18:07:28 2015 -0500 Commit: Greg McCullough <gmccullo@redhat.com> CommitDate: Fri Nov 13 18:07:28 2015 -0500 Merge branch 'bz_1277995_mr' into '5.5.z' Forman can now collect inventory from system with no hostgroups This is from [#5313](https://github.com/ManageIQ/manageiq/pull/5313) and was a clean merge. https://bugzilla.redhat.com/show_bug.cgi?id=1277995 See merge request !450 .../lib/manageiq_foreman/inventory.rb | 7 +++- gems/manageiq_foreman/spec/inventory_spec.rb | 45 ++++++++++++++++++++++ 2 files changed, 50 insertions(+), 2 deletions(-)
I retested this since I had a Satellite 6.1 template that I could quickly spawn a new Satellite 6.1 provider from without any host groups. There are no errors inventorying a Satellite 6.1 provider without host groups on 5.5.0.11. [----] I, [2015-11-19T10:42:03.576696 #16957:801998] INFO -- : MIQ(ManageIQ::Providers::Foreman::ConfigurationManager::RefreshWorker::Runner#get_message_via_drb) Message id: [863], MiqWorker id: [11], Zone: [default], Role: [ems_inventory], Server: [], Ident: [ems_1], Target id: [], Instance id: [], Task id: [], Command: [EmsRefresh.refresh], Timeout: [7200], Priority: [100], State: [dequeue], Deliver On: [], Data: [], Args: [[["ManageIQ::Providers::Foreman::ConfigurationManager", 1]]], Dequeued in: [8.545078589] seconds [----] I, [2015-11-19T10:42:03.576934 #16957:801998] INFO -- : MIQ(MiqQueue#deliver) Message id: [863], Delivering... [----] I, [2015-11-19T10:42:03.579500 #16957:801998] INFO -- : MIQ(ManageIQ::Providers::Foreman::ConfigurationManager::Refresher#refresh) Refreshing all targets... [----] I, [2015-11-19T10:42:03.579650 #16957:801998] INFO -- : MIQ(ManageIQ::Providers::Foreman::ConfigurationManager::Refresher#refresh) EMS: [perfcf1 Configuration Manager], id: [1] Refreshing targets for EMS: [perfcf1 Configuration Manager], id: [1]... [----] I, [2015-11-19T10:42:03.579811 #16957:801998] INFO -- : MIQ(ManageIQ::Providers::Foreman::ConfigurationManager::Refresher#refresh) EMS: [perfcf1 Configuration Manager], id: [1] ManageIQ::Providers::Foreman::ConfigurationManager [perfcf1 Configuration Manager] id [1] [----] I, [2015-11-19T10:42:03.581752 #16957:801998] INFO -- : MIQ(ManageIQ::Providers::Foreman::Provider#with_provider_connection) Connecting through ManageIQ::Providers::Foreman::Provider: [perfcf1] [----] I, [2015-11-19T10:42:03.584323 #16957:801998] INFO -- : ManageiqForeman::Connection#fetch Calling Apipie Resource: :hosts Action: :index Params: {:page=>1, :per_page=>50, "root_pass"=>"<FILTERED>"} [----] I, [2015-11-19T10:42:03.714610 #16957:801998] INFO -- : ManageiqForeman::Connection#fetch Calling Apipie Resource: :hostgroups Action: :index Params: {:page=>1, :per_page=>50, "root_pass"=>"<FILTERED>"} [----] I, [2015-11-19T10:42:03.819679 #16957:801998] INFO -- : MIQ(ManageIQ::Providers::Foreman::ConfigurationManager::Refresher#refresh) Refreshing all targets...Complete [----] I, [2015-11-19T10:42:03.820134 #16957:801998] INFO -- : MIQ(MiqQueue#delivered) Message id: [863], State: [ok], Delivered in [0.243232608] seconds
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2015:2551