Bug 2272119

Summary: Getting "undefined method '#name' for NilClass::Jail (NilClass) (Safemode::NoMethodError)" error generating subscription report
Product: Red Hat Satellite Reporter: Odilon Sousa <osousa>
Component: ReportingAssignee: Ian Ballou <iballou>
Status: CLOSED ERRATA QA Contact: David Moore <damoore>
Severity: high Docs Contact:
Priority: high    
Version: 6.14.0CC: ahumbe, chrobert, damoore, iballou, jbhatia, jlenz, pcreech, rlavi, zhunting
Target Milestone: 6.14.4Keywords: Regression, Triaged, UserExperience, WorkAround
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-3.7.0.13-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2256411 Environment:
Last Closed: 2024-04-29 11:23:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 6 Ian Ballou 2024-04-23 14:32:14 UTC
Looks like the wrong backport was used here, we need https://github.com/theforeman/foreman/commit/df546fa83dfa4946e82ceb3d85f37b7b5f45c495 due to older Safemode. I can make an MR.

Comment 7 Ian Ballou 2024-04-23 15:00:48 UTC
Added the proper MR.

Comment 9 David Moore 2024-04-25 12:42:01 UTC
Verified 6.14.4 snap 3.0

Original Issue:
     Error generating "Subscription - Entitlement Report", when one or more entries of the report included a virt-who* hypervisor host.
     Because the hypervisor hosts do not have a lifecycle-environment or content-view.
          Safemode::NoMethodError (undefined method '#name' for NilClass::Jail (NilClass))

Steps:
     1. Disable SCA for the organization, if not already.
     2. Setup RH repo and install virt-who. Create config in "WebUI > Infrastructure > Virt-Who Configurations".
     3. Run the generated command to deploy hypervisor hosts in satellite.
        >> hammer virt-who-config deploy --id 1 --organization-id 1
     4. Attach a valid subscription to the virt-who* hypervisor host(s).
     5. Generate the "Subscription - Entitlement Report".

Expected and Actual Results:
     Report successfully generated without errors and shows expected host entitlements.

Comment 13 errata-xmlrpc 2024-04-29 11:23:54 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 (Satellite 6.14.4 Async Update), 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-2024:2099