Bug #36271
closedIn report template, the host_latest_applicable_rpm_version global method results in error and report to not generate
Description
Example:
Using the method like so ''Latest Available Kernel': host_latest_applicable_rpm_version(host, 'kernel')' causes the error 'undefined method `nvra' for nil:NilClass'
Further information in /var/log/foreman/production.log:
2023-04-03T14:22:14 [E|app|8e502369] Error performing TemplateRenderJob (Job ID: a4be94d9-06f7-401c-9a03-79668dbf7ff3) from Dynflow(default) in 57.76ms: NoMethodError (undefined method `nvra' for nil:NilClass):
/usr/share/gems/gems/katello-4.7.4/app/lib/katello/concerns/base_template_scope_extensions.rb:164:in `host_latest_applicable_rpm_version'
/usr/share/gems/gems/safemode-1.3.7/lib/safemode/scope.rb:37:in `method_missing'
Host - Server compliance report:70:in `block in bind'
/usr/share/gems/gems/activerecord-6.1.7.2/lib/active_record/relation/batches/batch_enumerator.rb:40:in `block (2 levels) in each_record'
/usr/share/gems/gems/activerecord-6.1.7.2/lib/active_record/relation/batches/batch_enumerator.rb:40:in `each'
/usr/share/gems/gems/activerecord-6.1.7.2/lib/active_record/relation/batches/batch_enumerator.rb:40:in `block in each_record'
/usr/share/gems/gems/activerecord-6.1.7.2/lib/active_record/relation/batches.rb:245:in `block in in_batches'
/usr/share/gems/gems/activerecord-6.1.7.2/lib/active_record/relation/batches.rb:229:in `loop'
/usr/share/gems/gems/activerecord-6.1.7.2/lib/active_record/relation/batches.rb:229:in `in_batches'
/usr/share/gems/gems/activerecord-6.1.7.2/lib/active_record/relation/batches/batch_enumerator.rb:39:in `each'
/usr/share/gems/gems/activerecord-6.1.7.2/lib/active_record/relation/batches/batch_enumerator.rb:39:in `each_record'
/usr/share/gems/gems/safemode-1.3.7/lib/safemode/jail.rb:31:in `method_missing'
Updated by Brian Frost over 1 year ago
Problem has been observed in katello 4.7.4 and 4.6.2. Previous version of Katello did not have this issue.
Updated by Partha Aji over 1 year ago
- Status changed from New to Duplicate
Updated by Partha Aji over 1 year ago
- Target version set to Katello Recycle Bin
- Triaged changed from No to Yes
Updated by Ian Ballou over 1 year ago
- Is duplicate of Feature #30664: "Installable Errata" in report template added
Updated by Ian Ballou over 1 year ago
- Target version deleted (
Katello Recycle Bin)
I'm already fixing this bug in the PR associated to https://projects.theforeman.org/issues/30664