Bug 1123049

Summary: Null pointer when creating/building host with extermal capsule
Product: Red Hat Satellite Reporter: Shannon Hughes <shughes>
Component: WebUIAssignee: Dmitri Dolguikh <dmitri>
WebUI sub component: Foreman QA Contact: Og Maciel <omaciel>
Status: CLOSED WORKSFORME Docs Contact:
Severity: medium    
Priority: unspecified CC: bkearney, dcleal, lzap, mmello, omaciel, shughes, xdmoon
Version: 6.0.3Keywords: Triaged
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/7258
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-04 19:04:53 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:
Bug Depends On:    
Bug Blocks: 1115190    
Attachments:
Description Flags
debug log
none
stack trace for tftp none

Description Shannon Hughes 2014-07-24 17:35:58 UTC
Created attachment 920650 [details]
debug log

Description of problem:

setup a external capsule and included the subnet 192.168.200.1/24 in the host build. when creating the host the following prevents from saving: 

Failed to generate PXELinux template: undefined method `each' for nil:NilClass

This seemed to pop up when adding subnet to the host group. I am including production.log with debug turned on

Comment 1 RHEL Program Management 2014-07-24 17:43:52 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Shannon Hughes 2014-07-25 11:00:36 UTC
additional info...the nilClass issue only happens when I attach a subnet to the Host Group or select manually for each host build.

Comment 4 Lukas Zapletal 2014-07-28 09:07:45 UTC
Hey Shannon,

we do not propagate the exception properly, can you please edit this file:

/usr/share/foreman/app/models/concerns/orchestration/tftp.rb

and on the line 82

81  rescue => e
82    failure _("Failed to...") % { :template_kind => os.template_kind, :e => e }
83  end

add extra parameter e as the second one:

82    failure _("Failed to...") % { :template_kind => os.template_kind, :e => e }, e

Then reproduce and paste the exception backtrace.


Note for assignee: we should fix all "failure" calls when exception is not passed in as a second paramter with this bug.

Comment 5 Shannon Hughes 2014-07-28 13:25:30 UTC
attaching stack as stack.trace

Comment 6 Shannon Hughes 2014-07-28 13:25:55 UTC
Created attachment 921761 [details]
stack trace for tftp

Comment 7 Lukas Zapletal 2014-07-29 09:22:14 UTC
Sorry, the line should be:

82    failure _("Failed to...") % { :template_kind => os.template_kind, :e => e }, e.backtrace

(note the "backtrace" method call).

This stracktrace is useless :-(

Comment 8 Dominic Cleal 2014-08-11 17:11:55 UTC
It's likely the wrong PXELinux template is associated to the operating system.  Ensure you have "Kickstart default PXELinux" associated, *not* "PXELinux global default" or similar.

Comment 10 Lukas Zapletal 2014-08-26 07:17:01 UTC
Created upstream ticket - let's improve error handling for 6.1+.

http://projects.theforeman.org/issues/7258

Comment 11 Dmitri Dolguikh 2015-06-10 15:23:20 UTC
Can't reproduce the original issue in this ticket. Error handling/logging has a dedicated BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1194352

Comment 12 Bryan Kearney 2015-06-10 16:01:55 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/7258 has been closed

Comment 16 Og Maciel 2016-04-04 18:21:56 UTC
I have been able to provision a new host (libvirt installed in the Satellite itself) using an external capsule (complete different system) without any issues. I used the network/subnet associated with my libvirt setup and everything worked fine.

Comment 17 Og Maciel 2016-04-04 19:04:53 UTC
Spoke to @shugues and @Toledo about this issue and we all feel that it is safe to close it as WORKSFORME.