Bug 2232370

Summary: undefined method '#single_content_view' for Katello::Host::ContentFacet::Jail (Katello::Host::ContentFacet) (Safemode::NoMethodError)
Product: Red Hat Satellite Reporter: Evgeni Golov <egolov>
Component: Content ViewsAssignee: Evgeni Golov <egolov>
Status: CLOSED ERRATA QA Contact: David Moore <damoore>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.14.0CC: jlenz, juwatts, pcreech, rlavi, sbible
Target Milestone: 6.14.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-katello-4.9.0.14-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-08 14:20:20 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:

Description Evgeni Golov 2023-08-16 14:17:20 UTC
When trying to render the Ansible Inventory template in Foreman (https://github.com/theforeman/foreman/blob/develop/app/views/unattended/report_templates/ansible_-_ansible_inventory.erb) and you have hosts *with* Content Facets, the rendering fails with the following entry in the logs:

<pre>
2023-08-16T07:07:53 [E|app|24ce8a15] Error performing TemplateRenderJob (Job ID: bcc04f39-c447-47d4-88a2-c5ee717335ed) from Dynflow(default) in 60.85ms: Safemode::NoMethodError (undefined method '#single_content_view' for Katello::
Host::ContentFacet::Jail (Katello::Host::ContentFacet)):
 24ce8a15 | /usr/share/gems/gems/safemode-1.3.7/lib/safemode/jail.rb:22:in `method_missing'
 24ce8a15 | Ansible - Ansible Inventory:88:in `block in bind'
 24ce8a15 | /usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches/batch_enumerator.rb:40:in `block (2 levels) in each_record'
 24ce8a15 | /usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches/batch_enumerator.rb:40:in `each'
 24ce8a15 | /usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches/batch_enumerator.rb:40:in `block in each_record'
 24ce8a15 | /usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches.rb:245:in `block in in_batches'
 24ce8a15 | /usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches.rb:229:in `loop'
 24ce8a15 | /usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches.rb:229:in `in_batches'
 24ce8a15 | /usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches/batch_enumerator.rb:39:in `each'
 24ce8a15 | /usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches/batch_enumerator.rb:39:in `each_record'
 24ce8a15 | /usr/share/gems/gems/safemode-1.3.7/lib/safemode/jail.rb:31:in `method_missing'
 24ce8a15 | Ansible - Ansible Inventory:82:in `bind'
 24ce8a15 | /usr/share/gems/gems/safemode-1.3.7/lib/safemode.rb:51:in `eval'
 24ce8a15 | /usr/share/gems/gems/safemode-1.3.7/lib/safemode.rb:51:in `eval'
 24ce8a15 | /usr/share/foreman/app/services/foreman/renderer/safe_mode_renderer.rb:7:in `render'
 24ce8a15 | /usr/share/foreman/app/services/foreman/renderer/base_renderer.rb:18:in `render'
 24ce8a15 | /usr/share/foreman/app/services/foreman/renderer.rb:46:in `render'
 24ce8a15 | /usr/share/foreman/app/models/template.rb:172:in `render'
 24ce8a15 | /usr/share/foreman/app/models/report_composer.rb:241:in `render'
 24ce8a15 | /usr/share/foreman/app/jobs/template_render_job.rb:12:in `block in perform'
 24ce8a15 | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:108:in `as'
 24ce8a15 | /usr/share/foreman/app/jobs/template_render_job.rb:9:in `perform'
…
2023-08-16T07:07:53 [E|bac|24ce8a15] undefined method '#single_content_view' for Katello::Host::ContentFacet::Jail (Katello::Host::ContentFacet) (Safemode::NoMethodError)
 24ce8a15 | /usr/share/gems/gems/safemode-1.3.7/lib/safemode/jail.rb:22:in `method_missing'
 24ce8a15 | Ansible - Ansible Inventory:88:in `block in bind'
 24ce8a15 | /usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches/batch_enumerator.rb:40:in `block (2 levels) in each_record'
 24ce8a15 | /usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches/batch_enumerator.rb:40:in `each'
 24ce8a15 | /usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches/batch_enumerator.rb:40:in `block in each_record'
 24ce8a15 | /usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches.rb:245:in `block in in_batches'
 24ce8a15 | /usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches.rb:229:in `loop'
 24ce8a15 | /usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches.rb:229:in `in_batches'
 24ce8a15 | /usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches/batch_enumerator.rb:39:in `each'
 24ce8a15 | /usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches/batch_enumerator.rb:39:in `each_record'
 24ce8a15 | /usr/share/gems/gems/safemode-1.3.7/lib/safemode/jail.rb:31:in `method_missing'
 24ce8a15 | Ansible - Ansible Inventory:82:in `bind'
 24ce8a15 | /usr/share/gems/gems/safemode-1.3.7/lib/safemode.rb:51:in `eval'
 24ce8a15 | /usr/share/foreman/app/services/foreman/renderer/safe_mode_renderer.rb:7:in `render'
 24ce8a15 | /usr/share/foreman/app/services/foreman/renderer/base_renderer.rb:18:in `render'
 24ce8a15 | /usr/share/foreman/app/services/foreman/renderer.rb:46:in `render'
 24ce8a15 | /usr/share/foreman/app/models/template.rb:172:in `render'
 24ce8a15 | /usr/share/foreman/app/models/report_composer.rb:241:in `render'
 24ce8a15 | /usr/share/foreman/app/jobs/template_render_job.rb:12:in `block in perform'
 24ce8a15 | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:108:in `as'
 24ce8a15 | /usr/share/foreman/app/jobs/template_render_job.rb:9:in `perform'
</pre>

Comment 1 Evgeni Golov 2023-08-16 14:17:24 UTC
Created from redmine issue https://projects.theforeman.org/issues/36684

Comment 2 Evgeni Golov 2023-08-16 14:17:25 UTC
Upstream bug assigned to egolov

Comment 3 Evgeni Golov 2023-08-16 14:18:35 UTC
This breaks the Ansible Inventory report and thus integration with AAP and friends on 6.14.

Comment 4 Bryan Kearney 2023-08-16 16:03:49 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36684 has been resolved.

Comment 10 errata-xmlrpc 2023-11-08 14:20:20 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 (Important: Satellite 6.14 security and bug fix 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/RHSA-2023:6818