Bug 1565489

Summary: Bootdisk Full Host x Image NilClass error
Product: Red Hat Satellite Reporter: Peter Vreman <peter.vreman>
Component: Bootdisk PluginAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Sachin Ghai <sghai>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: ehelms, inecas, lzap, sghai
Target Milestone: 6.4.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/23267
Whiteboard:
Fixed In Version: foreman_bootdisk-12.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 18:53:38 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: 1122832    

Description Peter Vreman 2018-04-10 06:38:30 UTC
Description of problem:
When clicking on in the UI and testing what Bootdisk Full Image will give me i get an NilClass error. This should never happen, even that not when i maybe forgot to enable or install something.

Below is the error when i click on 'Full Host X Image'. When i click on the Host  Image i got a different error already filed in seperate BZ for that issue.

----------------
2018-04-10 06:31:40 65c15b04 [app] [I] Started GET "/bootdisk/disks/full_hosts/li-lc-1008.hag.hilti.com" for 10.2.2.21 at 2018-04-10 06:31:40 +0000
2018-04-10 06:31:40 65c15b04 [app] [I] Processing by ForemanBootdisk::DisksController#full_host as HTML
2018-04-10 06:31:40 65c15b04 [app] [I]   Parameters: {"id"=>"li-lc-1008.hag.hilti.com"}
2018-04-10 06:31:40 65c15b04 [app] [I] Current user: VREMPET-ADMIN (administrator)
2018-04-10 06:31:40 65c15b04 [app] [I] Expire fragment views/tabs_and_title_records-6 (0.1ms)
2018-04-10 06:31:40 65c15b04 [app] [W] Action failed
 | NoMethodError: undefined method `gsub!' for nil:NilClass
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_bootdisk-10.0.2.2/app/services/foreman_bootdisk/iso_generator.rb:24:in `block (2 levels) in generate_full_host'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_bootdisk-10.0.2.2/app/services/foreman_bootdisk/iso_generator.rb:21:in `each'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_bootdisk-10.0.2.2/app/services/foreman_bootdisk/iso_generator.rb:21:in `map'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_bootdisk-10.0.2.2/app/services/foreman_bootdisk/iso_generator.rb:21:in `block in generate_full_host'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_bootdisk-10.0.2.2/app/services/foreman_bootdisk/iso_generator.rb:20:in `map!'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_bootdisk-10.0.2.2/app/services/foreman_bootdisk/iso_generator.rb:20:in `generate_full_host'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_bootdisk-10.0.2.2/app/controllers/foreman_bootdisk/disks_controller.rb:38:in `full_host'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/abstract_controller/base.rb:198:in `process_action'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/action_controller/metal/rendering.rb:10:in `process_action'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/actionpack-4.2.6/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:117:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:505:in `call'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting'
 | /usr/share/foreman/app/controllers/concerns/application_shared.rb:15:in `set_timezone'
----------------

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


How reproducible:


Steps to Reproduce:
1. Enable Build
2. Click Bootdisk 'Full Host x Image'
3.

Actual results:
NilClass error

Expected results:
Either successful bootdisk or an User friendly error what is missing


Additional info:

Comment 7 Satellite Program 2018-05-29 12:22:26 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/23267 has been resolved.

Comment 9 Sachin Ghai 2018-09-12 06:35:49 UTC
Verified with Sat6.4.0 snap21

I can download Full host image without any error from UI. Here are the logs from production.log:

2018-09-12T00:40:40 [I|app|] Started GET "/bootdisk/disks/full_hosts/hoststaticbootdisk.xxx.redhat.com" for 10.xx.xx.xx. at 2018-09-12 00:40:40 -0400
2018-09-12T00:40:40 [I|app|2d02c] Processing by ForemanBootdisk::DisksController#full_host as HTML
2018-09-12T00:40:40 [I|app|2d02c]   Parameters: {"id"=>"hoststaticbootdisk.xxx.redhat.com"}
2018-09-12T00:40:40 [I|app|2d02c] Current user: admin (administrator)
2018-09-12T00:40:40 [I|tem|2d02c] Rendering template 'Kickstart default PXELinux'
2018-09-12T00:40:40 [I|blo|2d02c] Unattended render of 'Kickstart default PXELinux' = 'ef17b9711ee379a90d5e037da3cafa50ed900df16e2b209d2cd6f7852381b6fd'
# This file was deployed via 'Kickstart default PXELinux' template


TIMEOUT 10
DEFAULT Kickstart default PXELinux

LABEL Kickstart default PXELinux
  KERNEL boot/RedHat-7.5-x86_64-vmlinuz
  APPEND initrd=boot/RedHat-7.5-x86_64-initrd.img ks=http://cloud-xxx.redhat.com/unattended/provision?token=58858dd3-c04e-495f-ba89-569073beb7c5  network ksdevice=bootif ks.device=bootif BOOTIF=00-52-54-00-21-c9-44 kssendmac ks.sendmac inst.ks.sendmac ip=192.168.xx.xx:192.168.xx.xx:255.255.248.0:::none nameserver=192.168.xx.xx
  IPAPPEND 2


I was able to provision a host with generated FULL host image.

Comment 10 Bryan Kearney 2018-10-16 18:53:38 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-2018:2927