Bug #11978
closedSafemode::NoMethodError: undefined method 'facts' for NilClass::Jail (NilClass)
Description
I was trying PXEless discovery. I started the instance via fdi-image-3.0.1.iso and selected "Discover using DHCP". As soon as I gave the foreman-server URL and clicked next. I got following on 'Discovery Status' screen:
Status - Failure - awaiting kexec into installer Server response was 422 with error: Reloading kernel on mac52540093cdda.idmqe.lab.eng.bos.redhat.com task failed with the following error: undefined method 'facts' for NilClass::Jail (NilClass)
production.log filled with error:
| Started POST "/api/v2/discovered_hosts/facts" for 192.168.100.36 at 2015-09-28 02:48:57 -0400 2015-09-28 02:48:57 [app] [I] Processing by Api::V2::DiscoveredHostsController#facts as JSON 2015-09-28 02:48:57 [app] [I] Parameters: {"facts"=>"[FILTERED]", "apiv"=>"v2", "discovered_host"=>{"facts"=>"[FILTERED]"}} 2015-09-28 02:48:57 [app] [I] Import facts for 'mac52540093cdda' completed. Added: 62, Updated: 0, Deleted 0 facts 2015-09-28 02:48:58 [app] [I] Match found for host mac52540093cdda (13) rule rule1 (1) 2015-09-28 02:48:58 [app] [I] Create DHCP reservation for mac52540093cdda.idmqe.lab.eng.bos.redhat.com-52:54:00:93:cd:da/192.168.100.36 2015-09-28 02:48:58 [app] [I] Add DNS PTR record for 192.168.100.36/mac52540093cdda.idmqe.lab.eng.bos.redhat.com 2015-09-28 02:48:58 [app] [W] Reloading kernel on mac52540093cdda.idmqe.lab.eng.bos.redhat.com task failed with the following error: undefined method 'facts' for NilClass::Jail (NilClass) | Safemode::NoMethodError: undefined method 'facts' for NilClass::Jail (NilClass) | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.2/lib/safemode/jail.rb:17:in `method_missing' | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.2/lib/safemode.rb:52:in `bind' | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.2/lib/safemode.rb:51:in `eval' | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.2/lib/safemode.rb:51:in `eval' | /usr/share/foreman/lib/foreman/renderer.rb:16:in `render_safe' | /usr/share/foreman/lib/foreman/renderer.rb:103:in `unattended_render' | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-4.1.0/app/models/host/managed_extensions.rb:45:in `setKexec' | /usr/share/foreman/app/models/concerns/orchestration.rb:168:in `execute' | /usr/share/foreman/app/models/concerns/orchestration.rb:113:in `block in process' | /usr/share/foreman/app/models/concerns/orchestration.rb:105:in `each' | /usr/share/foreman/app/models/concerns/orchestration.rb:105:in `process' | /usr/share/foreman/app/models/concerns/orchestration.rb:39:in `post_commit' | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `_run__1428761446812571380__commit__1453868857134192696__callbacks' | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
Reproducible with version:
---------------------------
tfm-rubygem-foreman_discovery-4.1.0-1.fm1_10.git.56.4380f1d.git.56.4380f1d.git.56.4380f1d.el7.noarch
foreman-release-1.10.0-0.develop.201509171905gitd7b8c7a.el7.noarch
foreman-libvirt-1.10.0-0.develop.201509171905gitd7b8c7a.el7.noarch
foreman-1.10.0-0.develop.201509171905gitd7b8c7a.el7.noarch
discovery image tar fdi-image-3.0.1.iso
Files
Updated by Sachin Ghai over 9 years ago
- Related to Tracker #10294: PXEless discovery feature added
Updated by Sachin Ghai over 9 years ago
Same error if I select "Manual network setup".
Updated by Sachin Ghai over 9 years ago
Another observation, If I do not associate discovery rule or disable auto-provisioning. Then host is discovered successfully with both ways (manual network setup and discover with dhcp). However on manually provisioning them, following error raised in production.log:
2015-09-30 07:34:21 [app] [W] Reloading kernel on mac525400b125c3.idmqe.lab.eng.bos.redhat.com task failed with the following error: undefined method 'facts' for NilClass::Jail (NilClass) | Safemode::NoMethodError: undefined method 'facts' for NilClass::Jail (NilClass) | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.2/lib/safemode/jail.rb:17:in `method_missing'
And host listing removed from "Discovered Hosts" page.
Updated by The Foreman Bot over 9 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman_discovery/pull/221 added
- Pull request deleted (
)
Updated by Anonymous over 9 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset foreman_discovery|ae105ee606aeea91a563e556ff294ba6513fe611.