Bug 1337931 - Possible regression in rendering Hostgroup Provisioning Templates
Summary: Possible regression in rendering Hostgroup Provisioning Templates
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: WebUI
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: Lukas Pramuk
URL: http://projects.theforeman.org/issues...
Whiteboard:
: 1220728 (view as bug list)
Depends On:
Blocks: 1098183 1126087 1126937
TreeView+ depends on / blocked
 
Reported: 2016-05-20 13:40 UTC by Dylan Gross
Modified: 2019-08-12 14:36 UTC (History)
7 users (show)

Fixed In Version: rubygem-katello-3.0.0.38-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 11:02:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Production log from curl attempt to render hostgroup template at 2016-05-19 12:04:27 (deleted)
2016-05-20 13:40 UTC, Dylan Gross
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 15188 0 High Closed Possible regression in rendering Hostgroup Provisioning Templates 2020-04-23 02:34:27 UTC

Description Dylan Gross 2016-05-20 13:40:40 UTC
Description of problem:

Rendering of Hostgroup provisioning templates fails in Red Hat Satellite 6.2 beta.   The functionality appears to have worked at least as recently as Satellite 6.1.7

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

    Red Hat Satellite 6.2 Beta


How reproducible:

    Reproduced every time for me and for customer

Steps to Reproduce:
1.  Create Hostgroup and Provisioning template assigned to it.
2.  # curl -k https://satellite.example.com/unattended/template/RHEL7_Default/RHEL7_Default

Actual results:

   Curl returns a "500 Internal Server Error".

Expected results:

   The output of the curl should render the kickstart.


Additional info:


   Just a preview of the log error.   Actual log example will be attached as production.log-20160520

2016-05-19 12:04:27 [app] [I] Started GET "/unattended/template/RHEL7_Default/RHEL7_Default" for 192.168.144.130 at 2016-05-19 12:04:27 -0400
2016-05-19 12:04:27 [app] [I] Processing by UnattendedController#hostgroup_template as */*
2016-05-19 12:04:27 [app] [I]   Parameters: {"id"=>"RHEL7_Default", "hostgroup"=>"RHEL7_Default"}
2016-05-19 12:04:27 [app] [W] Action failed
 | NoMethodError: undefined method `content_facet' for #<Hostgroup:0x007f3da2631848>
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activemodel-4.1.5/lib/active_model/attribute_methods.rb:435:in `method_missing'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/attribute_methods.rb:208:in `method_missing'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.24/app/models/katello/concerns/redhat_extensions.rb:47:in `medium_uri_with_content_uri'
 | /usr/share/foreman/app/models/operatingsystems/redhat.rb:11:in `mediumpath'
 | /usr/share/foreman/lib/foreman/renderer.rb:164:in `kickstart_attributes'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.24/app/lib/katello/concerns/renderer_extensions.rb:11:in `kickstart_attributes_with_katello'
 | /usr/share/foreman/lib/foreman/renderer.rb:122:in `load_template_vars'
 | /usr/share/foreman/app/controllers/unattended_controller.rb:40:in `hostgroup_template'

Comment 3 Bryan Kearney 2016-05-23 14:29:52 UTC
Connecting redmine issue http://projects.theforeman.org/issues/12871 from this bug

Comment 4 Justin Sherrill 2016-05-23 14:48:29 UTC
That code change should already be in the beta, i will double check and try to reproduce

Comment 5 Bryan Kearney 2016-05-23 16:17:00 UTC
Upstream bug component is Content Management

Comment 6 Bryan Kearney 2016-05-23 16:17:01 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/12871 has been closed

Comment 7 Justin Sherrill 2016-05-23 16:34:57 UTC
i confirmed this is NOT fixed as part of issue 12871, in fact that is commit was already in the beta.

Comment 9 Justin Sherrill 2016-05-25 19:45:31 UTC
Created redmine issue http://projects.theforeman.org/issues/15188 from this bug

Comment 10 Bryan Kearney 2016-05-25 22:16:46 UTC
Upstream bug component is WebUI

Comment 11 Bryan Kearney 2016-05-26 18:17:16 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/15188 has been closed

Comment 12 Lukas Pramuk 2016-06-06 10:55:52 UTC
*** Bug 1220728 has been marked as a duplicate of this bug. ***

Comment 13 Lukas Pramuk 2016-06-06 10:57:27 UTC
VERIFIED.

@satellite-6.2.0-14.2.el7sat.noarch
tfm-rubygem-katello-3.0.0.42-2.el7sat.noarch

Reproducer:
1. create Hostgroup "My Hostgroup" and associate it to Satellite Kickstart Default
2. Build PXE Default
3. # cat /var/lib/tftpboot/pxelinux.cfg/default
...
LABEL Satellite Kickstart Default - My Hostgroup
     KERNEL boot/RedHat-6.8-x86_64-vmlinuz
     APPEND initrd=boot/RedHat-6.8-x86_64-initrd.img ks=http://<SATFQDN>/unattended/template/Satellite%20Kickstart%20Default/My%20Hostgroup ksdevice=bootif network kssendmac
4. # curl http://<SATFQDN>/unattended/template/Satellite%20Kickstart%20Default/My%20Hostgroup

/var/log/foreman/production.log:

2016-06-06 06:25:02 [app] [I] Started GET "/unattended/template/Satellite%20Kickstart%20Default/My%20Hostgroup" for <CLIENT_IP> at 2016-06-06 06:25:02 -0400
2016-06-06 06:25:02 [app] [I] Processing by UnattendedController#hostgroup_template as HTML
2016-06-06 06:25:02 [app] [I]   Parameters: {"id"=>"Satellite Kickstart Default", "hostgroup"=>"My Hostgroup"}
2016-06-06 06:25:02 [app] [I]   Rendered inline template (71.7ms)
2016-06-06 06:25:02 [app] [W] There was an error rendering the Unnamed template: 
 | ActionView::Template::Error: undefined method 'mac' for Hostgroup::Jail (Hostgroup)
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.3/lib/safemode/jail.rb:17:in `method_missing'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.3/lib/safemode.rb:89:in `bind'


>>> content_facet error was finally fixed, hitting yet another error reported earlier (BZ # is about to be confirmed...)

Comment 14 Lukas Pramuk 2016-06-06 11:32:16 UTC
Let this BZ 1126937 be the bug that will attempt to fix hostgroup provisioning

Comment 15 Lukas Pramuk 2016-06-28 17:08:35 UTC
BZ 1126937 CLOSED - was too old and thus not very relevant one.

Let this BZ 1126087 be the bug that will attempt to fix hostgroup provisioning

Comment 16 Bryan Kearney 2016-07-27 11:02:58 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/RHBA-2016:1501


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