Bug #32150
closedHypervisor task failed with NoMethodError: undefined method `split` for nil:NilClass
Description
Cloned from bugzilla 1941443
Description of problem:
When a RHEL based hypervisor is also registered to the Satellite or for any reason that a hypervisor has operating system set. The hypervisor task will fail with the following error:
------------------------------------------------------------
Error:
NoMethodError
undefined method `split' for nil:NilClass
---
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.11/app/models/katello/host/subscription_facet.rb:228:in
`ignore_os?'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.11/app/models/katello/host/subscription_facet.rb:215:in
`update_facts'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.11/app/lib/actions/katello/host/hypervisors_update.rb:179:in
`update_facts'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.11/app/lib/actions/katello/host/hypervisors_update.rb:32:in
`block (2 levels) in run'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.11/app/lib/actions/katello/host/hypervisors_update.rb:31:in
`each'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.11/app/lib/actions/katello/host/hypervisors_update.rb:31:in
`block in run'"
- "/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:108:in `as'"
- "/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:114:in `as_anonymous_admin'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.11/app/lib/actions/katello/host/hypervisors_update.rb:18:in
`run'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/action.rb:571:in
`block (3 levels) in execute_run'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.7/lib/dynflow/middleware/stack.rb:27:in
`pass'"
------------------------------------------------------------
This is because virt-who doesn't report the operating system facts of the hypervisor but Satellite is expecting it.
Steps to Reproduce:
1. Prepare a host running libvirt and register the host to the Satellite.
2. On Satellite, add the virt-who config for this host and deploy the config.
3. Then run "virt-who -do"
Actual results:
Error:
NoMethodError
undefined method `split' for nil:NilClass
Expected results:
Hypvervisor task finishes without error
Updated by Ian Ballou almost 4 years ago
- Target version set to Katello 4.1.0
- Triaged changed from No to Yes
Updated by The Foreman Bot almost 4 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/9252 added
Updated by The Foreman Bot almost 4 years ago
- Fixed in Releases Katello 4.2.0 added
Updated by Lucy Fu almost 4 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|28976c3db591e2cbdbaf1eb2ef36588d4e57b436.
Updated by Jeremy Lenz over 3 years ago
- Subject changed from Hypervisor task failed with NoMethodError: undefined method `split' for nil:NilClass to Hypervisor task failed with NoMethodError: undefined method `split` for nil:NilClass