Bug 1278732

Summary: Provisioning of a pxe-less discovered host without dhcp failed with error: undefined method `path' for nil:NilClass/
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: Discovery PluginAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Sachin Ghai <sghai>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1.4CC: bbuckingham, lzap, mmccune
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/12414
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-15 13:13:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
discovred host
none
complete logs from production.log
none
discovery debug none

Description Sachin Ghai 2015-11-06 10:14:43 UTC
Created attachment 1090554 [details]
discovred host

Description of problem:
I was trying pxe-less discovery of a host via external capsule and without dhcp feature. DHCP was not available on external capsule. 

Host was discovered successfully, please see the screenshot. However when I tried to provision that host, following error appeared in production.log


2015-11-06 04:58:05 [I] Processing by DiscoveredHostsController#update as */*
2015-11-06 04:58:05 [I]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"JNXwu+fHxu2ibLmy2ERQaXqKaMqjBjdiuYEtCvWdJwE=", "host"=>{"name"=>"mac525400d97eee", "hostgroup_id"=>"4", "environment_id"=>"3", "content_source_id"=>"3", "puppet_ca_proxy_id"=>"3", "puppet_proxy_id"=>"3", "puppetclass_ids"=>[""], "managed"=>"true", "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "domain_id"=>"1", "realm_id"=>"", "mac"=>"52:54:00:d9:7e:ee", "subnet_id"=>"2", "ip"=>"192.168.110.102", "interfaces_attributes"=>{"new_interfaces"=>{"_destroy"=>"false", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"", "domain_id"=>"", "subnet_id"=>"", "ip"=>"", "managed"=>"1", "virtual"=>"0", "tag"=>"", "attached_to"=>""}}, "architecture_id"=>"1", "operatingsystem_id"=>"1", "build"=>"1", "medium_id"=>"", "ptable_id"=>"7", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"3-Users", "enabled"=>"1", "model_id"=>"2", "comment"=>"", "overwrite"=>"false"}, "hostgroup"=>{"lifecycle_environment_id"=>"2", "content_view_id"=>"2"}, "id"=>"mac525400d97eee"}
2015-11-06 04:58:06 [I] Add DNS A record for mac525400d97eee.idmqe.lab.eng.bos.redhat.com/192.168.110.102
2015-11-06 04:58:06 [I] Add DNS PTR record for 192.168.110.102/mac525400d97eee.idmqe.lab.eng.bos.redhat.com
2015-11-06 04:58:06 [I] Add the TFTP configuration for mac525400d97eee.idmqe.lab.eng.bos.redhat.com
2015-11-06 04:58:07 [I] Fetching required TFTP boot files for mac525400d97eee.idmqe.lab.eng.bos.redhat.com
2015-11-06 04:58:07 [I] Redirected to https://cloud-qe-15.idmqe.lab.eng.bos.redhat.com/hosts/mac525400d97eee.idmqe.lab.eng.bos.redhat.com
2015-11-06 04:58:07 [W] Reloading kernel on mac525400d97eee.idmqe.lab.eng.bos.redhat.com task failed with the following error: undefined method `path' for nil:NilClass/opt/rh/ruby193/root/usr/share/gems/gems/foreman_discovery-2.0.0.20/app/models/host/managed_extensions.rb:38:in `boot_url'
/opt/rh/ruby193/root/usr/share/gems/gems/foreman_discovery-2.0.0.20/app/models/host/managed_extensions.rb:44:in `setKexec'
/usr/share/foreman/app/models/concerns/orchestration.rb:137:in `execute'
/usr/share/foreman/app/models/concerns/orchestration.rb:85:in `block in process'
/usr/share/foreman/app/models/concerns/orchestration.rb:77:in `each'
/usr/share/foreman/app/models/concerns/orchestration.rb:77:in `process'
/usr/share/foreman/app/models/concerns/orchestration.rb:22:in `post_commit'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `_run__4382214147711117573__commit__3705098690657248305__callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_commit_callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:263:in `committed!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:372:in `block in commit_transaction_records'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:370:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:370:in `commit_transaction_records'

Version-Release number of selected component (if applicable):
satellite 6.1.4 compose3

on capsule:
rubygem-smart_proxy_discovery-1.0.3-1.el7sat.noarch

on sat6 server:
rubygem-hammer_cli_foreman_discovery-0.0.1.10-1.el7sat.noarch
rubygem-smart_proxy_discovery-1.0.3-1.git.0.3a55100.el7sat.noarch
ruby193-rubygem-foreman_discovery-2.0.0.20-1.el7sat.noarch

Image: fdi-bootable-3.0.4.iso

How reproducible:
always

Steps to Reproduce:
1. install external capsule without enabling dhcp feature
2. discovered a host via external capsule by defining manual network configuration.
3. provision the host

Actual results:
Reloading kernel on mac525400d97eee.idmqe.lab.eng.bos.redhat.com task failed with the following error: undefined method `path' for nil:NilClass

Expected results:
provisioning should work via kexec

Additional info:

Comment 1 Sachin Ghai 2015-11-06 10:17:10 UTC
Created attachment 1090555 [details]
complete logs from production.log

Comment 2 Sachin Ghai 2015-11-06 10:19:46 UTC
Created attachment 1090564 [details]
discovery debug

Comment 4 Sachin Ghai 2015-11-06 10:48:21 UTC
logs from proxy.log

10.16.96.100 - - [06/Nov/2015 04:58:06] "GET /unattended/templateServer HTTP/1.1" 200 73 0.0004
10.16.96.100 - - [06/Nov/2015 04:58:07] "POST /tftp/syslinux/52:54:00:d9:7e:ee HTTP/1.1" 200 - 0.0029
10.16.96.100 - - [06/Nov/2015 04:58:07] "POST /tftp/fetch_boot_file HTTP/1.1" 200 - 0.0045
10.16.96.100 - - [06/Nov/2015 04:58:07] "POST /tftp/fetch_boot_file HTTP/1.1" 200 - 0.0049

Comment 5 Lukas Zapletal 2015-11-09 09:00:28 UTC
Upstream fix provided, workaround available (oneliner change). Hope to merge this today/tomorrow.

Comment 6 Sachin Ghai 2015-11-09 14:40:45 UTC
Setting the blocker flag, since affected functionality is a release blocker.

Comment 7 Lukas Zapletal 2015-11-11 07:49:47 UTC
Definitely a blocker, upstream fix TBM.

Comment 11 Sachin Ghai 2015-11-26 16:57:42 UTC
Verified with Sat 6.1.5 compose2(Satellite-6.1.0-RHEL-7-20151125.0)
and using scratchbuild of discovery image from brew having version: foreman-discovery-image-3.0.5-2.iso

I can provision a pxe-less discovered host.

Comment 12 Bryan Kearney 2015-12-15 13:13:49 UTC
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:2622