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 1894009

Summary: Generating Red Hat cloud inventory fails if there are foreman_hooks available
Product: Red Hat Satellite Reporter: Anand Agrawal <aagrawal>
Component: RH Cloud - InventoryAssignee: Shimon Shtein <sshtein>
Status: CLOSED ERRATA QA Contact: Mirek Długosz <mzalewsk>
Severity: high Docs Contact:
Priority: medium    
Version: 6.8.0CC: ahumbe, aruzicka, egolov, jjeffers, kkohli, snemeth
Target Milestone: 6.9.0Keywords: Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman_hooks-0.3.17 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1899320 1899325 (view as bug list) Environment:
Last Closed: 2021-04-21 13:18:52 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:

Description Anand Agrawal 2020-11-03 10:07:59 UTC
Description of problem:

Generating Red Hat clound inventory via Web UI or foreman-rake fails as below:

# foreman-rake rh_cloud_inventory:report:generate

API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache.
rake aborted!
NoMethodError: undefined method `name' for "2.0.12":String
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_hooks-0.3.16/lib/foreman_hooks/as_dependencies_hook.rb:6:in `block (2 levels) in 
load_missing_constant'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_rh_cloud-2.0.12/lib/tasks/rh_cloud_inventory.rake:15:in `block (3 levels) in <top (required)>'

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

How reproducible:

Always
Steps to Reproduce:
1. Enable foreman_hooks on Red Hat Satellite
2. Now try to generate Red Hat cloud inventory
3.

Actual results:
rake aborted!
NoMethodError: undefined method `name' for "2.0.12":String
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_hooks-0.3.16/lib/foreman_hooks/as_dependencies_hook.rb:6:in `block (2 levels) in 
load_missing_constant'

Expected results:
It should be successful

Additional info:

After removing the foreman-hooks,  `foreman-rake rh_cloud_inventory:report:generate` works successfully

Comment 3 Adam Ruzicka 2020-11-18 14:21:26 UTC
Fix was merged in upstream and release in tfm-rubygem-foreman_hooks-0.3.17

Comment 8 errata-xmlrpc 2021-04-21 13:18:52 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 (Moderate: Satellite 6.9 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-2021:1313