Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1337931

Summary: Possible regression in rendering Hostgroup Provisioning Templates
Product: Red Hat Satellite Reporter: Dylan Gross <dgross>
Component: WebUIAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: medium Docs Contact:
Priority: high    
Version: 6.2.0CC: bbuckingham, cwelton, ehelms, kbidarka, lpramuk, peter.vreman, xdmoon
Target Milestone: UnspecifiedKeywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/15188
Whiteboard:
Fixed In Version: rubygem-katello-3.0.0.38-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 11:02:58 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: 1098183, 1126087, 1126937    
Attachments:
Description Flags
Production log from curl attempt to render hostgroup template at 2016-05-19 12:04:27 none

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