-
Bug
-
Resolution: Done
-
None
-
6.14.0
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>