Bug 1856837 - undefined method '#httpboot' for NilClass::Jail (NilClass) when creating an IPv6 only host
Summary: undefined method '#httpboot' for NilClass::Jail (NilClass) when creating an I...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts
Version: 6.8.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: 6.8.0
Assignee: Lukas Zapletal
QA Contact: tstrych
URL:
Whiteboard:
Depends On: 1858289
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-14 14:31 UTC by Radovan Drazny
Modified: 2020-10-27 13:04 UTC (History)
3 users (show)

Fixed In Version: foreman-2.1.0.1-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 13:04:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 30431 0 Normal Closed Grub2 template no longer works with IPv6 only hosts 2021-01-28 13:09:03 UTC
Red Hat Product Errata RHSA-2020:4366 0 None None None 2020-10-27 13:04:35 UTC

Description Radovan Drazny 2020-07-14 14:31:54 UTC
Description of problem:
When creating an IPv6 only host, the process will fail with the following error:
  Unable to render PXEGrub2 template 'Kickstart default PXEGrub2': undefined method '#httpboot' for NilClass::Jail (NilClass)

Version-Release number of selected component (if applicable):
Sat 6.8 Snap 8

How reproducible:
always

Steps to Reproduce:
Same steps as in BZ1848535. 

Actual results:
The host is not created.

Expected results:
The host is created.

Additional info:
This issue was discovered while verifying the fix for BZ1848535. The workaround is similar - create the host with only an IPv4 network assigned. It will be created successfully, and then you can remove the IPv4 network from it, and assign an IPv6 network instead. It seems the issue in BZ1848535 was actually fixed, the creation process proceeds to a next phase, and fails there.

production.log contains following output: 

2020-07-14T10:17:52 [I|app|0c0276d2] Started GET "/notification_recipients" for 127.0.0.1 at 2020-07-14 10:17:52 -0400
2020-07-14T10:17:52 [I|app|0c0276d2] Processing by NotificationRecipientsController#index as JSON
2020-07-14T10:17:52 [I|app|0c0276d2] Completed 200 OK in 12ms (Views: 0.1ms | ActiveRecord: 1.7ms | Allocations: 2169)
2020-07-14T10:17:52 [I|app|2b8c1a75] Started POST "/hosts" for 127.0.0.1 at 2020-07-14 10:17:52 -0400
2020-07-14T10:17:52 [I|app|2b8c1a75] Processing by HostsController#create as */*
2020-07-14T10:17:52 [I|app|2b8c1a75]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"vua0iJFdp5TZFloh9YpGxLPU1S4V5XT9k9iDZC6xbAidBjuf6zVYhlALPvw/keWlqwQi6kiK6Ya24AcOpXgL7g==", "host"=>{"name"=>"kerri-petiet", "organization_id"=>"1", "location_id"=>"2", "hostgroup_id"=>"", "compute_resource_id"=>"", "content_facet_attributes"=>{"lifecycle_environment_id"=>"1", "content_view_id"=>"1", "content_source_id"=>"1", "kickstart_repository_id"=>"7"}, "environment_id"=>"", "puppet_proxy_id"=>"", "puppet_ca_proxy_id"=>"", "openscap_proxy_id"=>"", "ansible_role_ids"=>[""], "managed"=>"true", "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "type"=>"Nic::Managed", "mac"=>"52:54:00:47:05:9a", "identifier"=>"", "name"=>"kerri-petiet", "domain_id"=>"2", "subnet_id"=>"", "subnet6_id"=>"1", "ip"=>"", "ip6"=>"fd00:aaaa:bbbb:cc:5054:ff:fe47:59a", "managed"=>"1", "primary"=>"1", "provision"=>"1", "execution"=>"1", "virtual"=>"0", "tag"=>"", "attached_to"=>""}}, "architecture_id"=>"1", "operatingsystem_id"=>"3", "provision_method"=>"build", "build"=>"1", "medium_id"=>"", "ptable_id"=>"116", "pxe_loader"=>"Grub2 UEFI HTTP", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"4-Users", "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "media_selector"=>"synced_content"}
2020-07-14T10:17:53 [I|app|2b8c1a75] Deploying TFTP PXELinux configuration for kerri-petiet.example.com
2020-07-14T10:17:53 [W|app|2b8c1a75] Unable to render PXEGrub2 template 'Kickstart default PXEGrub2': undefined method '#httpboot' for NilClass::Jail (NilClass)
2020-07-14T10:17:53 [I|app|2b8c1a75] Skipping TFTP PXEGrub2 configuration for kerri-petiet.example.com
2020-07-14T10:17:53 [I|app|2b8c1a75] Deploying TFTP PXEGrub configuration for kerri-petiet.example.com
2020-07-14T10:17:53 [I|app|2b8c1a75] Deploying TFTP iPXE configuration for kerri-petiet.example.com
2020-07-14T10:17:53 [I|app|2b8c1a75] Fetching required TFTP boot files for kerri-petiet.example.com
2020-07-14T10:17:54 [W|app|2b8c1a75] Rolling back due to a problem: []
2020-07-14T10:17:54 [I|app|2b8c1a75] Delete the TFTP configuration for kerri-petiet.example.com
2020-07-14T10:17:54 [I|app|2b8c1a75] Delete the TFTP configuration for kerri-petiet.example.com
2020-07-14T10:17:54 [I|app|2b8c1a75] Delete the TFTP configuration for kerri-petiet.example.com
2020-07-14T10:17:54 [I|app|2b8c1a75] Delete the TFTP configuration for kerri-petiet.example.com
2020-07-14T10:17:54 [I|app|2b8c1a75] Processed 5 tasks from queue 'Host::Managed Main', completed 0/5
2020-07-14T10:17:54 [E|app|2b8c1a75] Task 'Deploy TFTP PXELinux config for kerri-petiet.example.com' *rollbacked*
2020-07-14T10:17:54 [E|app|2b8c1a75] Task 'Deploy TFTP PXEGrub2 config for kerri-petiet.example.com' *rollbacked*
2020-07-14T10:17:54 [E|app|2b8c1a75] Task 'Deploy TFTP PXEGrub config for kerri-petiet.example.com' *rollbacked*
2020-07-14T10:17:54 [E|app|2b8c1a75] Task 'Deploy TFTP iPXE config for kerri-petiet.example.com' *rollbacked*
2020-07-14T10:17:54 [E|app|2b8c1a75] Task 'Fetch TFTP boot files for kerri-petiet.example.com' *rollbacked*
2020-07-14T10:17:54 [E|app|2b8c1a75] Failed to save: Unable to render PXEGrub2 template 'Kickstart default PXEGrub2': undefined method '#httpboot' for NilClass::Jail (NilClass)
2020-07-14T10:17:54 [I|app|2b8c1a75]   Rendering hosts/new.html.erb within layouts/application
2020-07-14T10:17:54 [I|app|2b8c1a75]   Rendered hosts/_progress.html.erb (Duration: 4.6ms | Allocations: 7116)
2020-07-14T10:17:54 [I|app|2b8c1a75]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.rc4/app/views/overrides/activation_keys/_host_environment_select.html.erb (Duration: 15.8ms | Allocations: 10758)
2020-07-14T10:17:54 [I|app|2b8c1a75]   Rendered hosts/puppet/_main_tab_fields.html.erb (Duration: 13.3ms | Allocations: 9454)

Comment 1 Lukas Zapletal 2020-07-17 14:16:31 UTC
This is an overlook in the template, if you can confirm this template change fixes it that would be great:

https://github.com/theforeman/foreman/pull/7828

Comment 2 Radovan Drazny 2020-07-22 08:50:37 UTC
I have tested the patch provided in the comment #1. Saving the new template into /usr/share/foreman/app/views/unattended/provisioning_templates/PXEGrub2/pxegrub2_global_default.erb and running 'foreman-maintain service restart' udpated the template, and an IPv6 host was created successfuly.

Comment 3 Lukas Zapletal 2020-07-22 13:05:19 UTC
Upstream patch has been merged: https://github.com/theforeman/foreman/pull/7828

I also filed CP against 2.1: https://github.com/theforeman/foreman/pull/7845 (not sure if we are still rebasing downstream)

Comment 5 tstrych 2020-07-28 11:49:28 UTC
With sat 6.8 snap 10, I was able to successfully create the IPv6 host. 
Package version - foreman-2.1.0.1-1.el7sat.noarch

The host was created the same way as in reproduction steps from - https://bugzilla.redhat.com/show_bug.cgi?id=1848535#c0

Rdrazny, thanks for help. 
Verified.

Comment 8 errata-xmlrpc 2020-10-27 13:04:18 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 (Important: Satellite 6.8 release), 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-2020:4366


Note You need to log in before you can comment on or make changes to this bug.