Project

General

Profile

Actions

Bug #36684

closed

undefined method '#single_content_view' for Katello::Host::ContentFacet::Jail (Katello::Host::ContentFacet) (Safemode::NoMethodError)

Added by Evgeni Golov over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Content Views
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

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:

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'

Related issues 1 (0 open1 closed)

Related to Foreman - Feature #35660: Update report templates for multi-CVClosedJeremy LenzActions
Actions #1

Updated by Evgeni Golov over 1 year ago

  • Related to Feature #35660: Update report templates for multi-CV added
Actions #2

Updated by The Foreman Bot over 1 year ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/10699 added
Actions #3

Updated by The Foreman Bot over 1 year ago

  • Fixed in Releases Katello 4.10.0 added
Actions #4

Updated by Jeremy Lenz over 1 year ago

  • Target version set to Katello 4.8.5

Evgeni is requesting this be backported to 4.8 and 4.9: https://github.com/Katello/katello/pull/10699#issuecomment-1680601338

Actions #5

Updated by Evgeni Golov over 1 year ago

  • Status changed from Ready For Testing to Closed
Actions #6

Updated by Evgeni Golov over 1 year ago

  • Bugzilla link set to 2232370
Actions #7

Updated by Jeremy Lenz over 1 year ago

  • Triaged changed from No to Yes
Actions #8

Updated by William Clark over 1 year ago

  • Fixed in Releases Katello 4.9.2 added
Actions #9

Updated by William Clark over 1 year ago

  • Target version changed from Katello 4.8.5 to Katello 4.9.2
Actions #10

Updated by The Foreman Bot over 1 year ago

  • Pull request https://github.com/Katello/katello/pull/10754 added
Actions #11

Updated by The Foreman Bot over 1 year ago

  • Pull request deleted (https://github.com/Katello/katello/pull/10699, https://github.com/Katello/katello/pull/10754)
Actions

Also available in: Atom PDF