Bug 1341164 - app/lib/actions/fusor/configure_host_groups.rb, the access_insights_client puppet class can't be found with the find() method
Summary: app/lib/actions/fusor/configure_host_groups.rb, the access_insights_client pu...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Quickstart Cloud Installer
Classification: Red Hat
Component: Installation - Satellite
Version: 1.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ga
: 1.0
Assignee: John Matthews
QA Contact: Tasos Papaioannou
Dan Macpherson
URL:
Whiteboard:
Depends On:
Blocks: qci-sprint-17
TreeView+ depends on / blocked
 
Reported: 2016-05-31 12:03 UTC by Jean-Francois Saucier
Modified: 2016-09-13 16:29 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-13 16:29:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
foreman production log (15.19 KB, text/plain)
2016-05-31 12:03 UTC, Jean-Francois Saucier
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:1862 0 normal SHIPPED_LIVE Red Hat Quickstart Installer 1.0 2016-09-13 20:18:48 UTC

Description Jean-Francois Saucier 2016-05-31 12:03:47 UTC
Created attachment 1163195 [details]
foreman production log

Description of problem:

When trying to do a RHEV deployment, content sync as usual but fail at the end with the error : Couldn't find Puppetclass with 'id'=access_insights_client (ActiveRecord::RecordNotFound)


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

QCI-1.2-RHEL-7-20160527.t.0-QCI-x86_64-dvd1 ISO file.


How reproducible:

Always. I tried with my own Satellite application which contains "Employee SKU" subscriptions and I also tried with the rhci-test login with "QCI test" Satellite application. Both result in the same error.


Steps to Reproduce:
1. Install QCI with the ISO.
2. Start a new deployment.
3. Wait for content to finish syncing and see the error.


Actual results:

Fail with the error and stop the deployment.


Expected results:

Work and continue the deployment.


Additional info:

Comment 1 Tasos Papaioannou 2016-06-02 19:38:52 UTC
In /opt/theforeman/tfm/root/usr/share/gems/gems/fusor_server-1.0.0/app/lib/actions/fusor/configure_host_groups.rb, the access_insights_client puppet class can't be found with the find() method:


            # this host group is the deployment group
            # add access insights class, will get inherited by all machine nodes
            if deployment.enable_access_insights
              # Puppetclass names are unique, there is only one access insights
              # puppet class regardless of how many environments or orgs there are
              insights_class = Puppetclass.find("access_insights_client")
              hostgroup_params[:puppetclass_ids] = [insights_class.id]
            end


If I change it to look up by name with where(), then the task completes successfully:


# diff -pruN /opt/theforeman/tfm/root/usr/share/gems/gems/fusor_server-1.0.0/app/lib/actions/fusor/configure_host_groups.rb.bak /opt/theforeman/tfm/root/usr/share/gems/gems/fusor_server-1.0.0/app/lib/actions/fusor/configure_host_groups.rb
--- /opt/theforeman/tfm/root/usr/share/gems/gems/fusor_server-1.0.0/app/lib/actions/fusor/configure_host_groups.rb.bak	2016-06-02 15:16:02.883152810 -0400
+++ /opt/theforeman/tfm/root/usr/share/gems/gems/fusor_server-1.0.0/app/lib/actions/fusor/configure_host_groups.rb	2016-06-02 15:31:35.315715814 -0400
@@ -113,8 +113,9 @@ module Actions
             if deployment.enable_access_insights
               # Puppetclass names are unique, there is only one access insights
               # puppet class regardless of how many environments or orgs there are
-              insights_class = Puppetclass.find("access_insights_client")
-              hostgroup_params[:puppetclass_ids] = [insights_class.id]
+              # insights_class = Puppetclass.find("access_insights_client")
+              insights_class = Puppetclass.where(:name => 'access_insights_client').try(:first)
+              hostgroup_params[:puppetclass_ids] = [insights_class.try(:id)]
             end
 
             default_capsule_id = ::Katello::CapsuleContent.default_capsule.try(:capsule).try(:id)

Comment 2 Jean-Francois Saucier 2016-06-06 14:44:37 UTC
I can confirm that the patch proposed by Tasos fix the problem and the deployment complete successfully.

Comment 3 John Matthews 2016-06-09 20:08:51 UTC
https://github.com/fusor/fusor/pull/940

Comment 4 John Matthews 2016-06-23 20:02:11 UTC
Addressed in ISO Set:
QCI-1.2-RHEL-7-20160623.t.0-QCI-x86_64-dvd1.iso
QCIOOO-8.0-RHEL-7-20160623.t.0-QCIOOO-x86_64-dvd1.iso

Comment 5 Tasos Papaioannou 2016-06-28 17:32:05 UTC
Verified on QCI-1.2-RHEL-7-20160627.t.0.

Comment 11 errata-xmlrpc 2016-09-13 16:29:33 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/RHEA-2016:1862


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