Bug 1860430 - 'Host - compare content hosts packages' report: Safemode doesn't allow to access 'version'...
Summary: 'Host - compare content hosts packages' report: Safemode doesn't allow to acc...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Reporting
Version: 6.8.0
Hardware: All
OS: All
unspecified
low
Target Milestone: 6.8.0
Assignee: Lukas Zapletal
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-24 14:18 UTC by Ranjan Kumar
Modified: 2021-06-01 09:08 UTC (History)
5 users (show)

Fixed In Version: tfm-rubygem-katello-3.16.0.1-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 13:04:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 30510 0 Normal Closed 'Host - compare content hosts packages' report: "Safemode doesn't allow to access 'version' on #<Safemode::ScopeObject>" 2020-10-28 17:44:45 UTC
Foreman Issue Tracker 30561 0 Normal Closed Expose sortable_version as template macro 2020-10-28 17:44:45 UTC
Red Hat Product Errata RHSA-2020:4366 0 None None None 2020-10-27 13:04:49 UTC

Description Ranjan Kumar 2020-07-24 14:18:13 UTC
Description of problem: compare content hosts packages report template fails to render, it raises an error "Safemode doesn't allow to access 'version' on #<Safemode::ScopeObject>"
Production log:
~~~
2020-07-24T19:40:05 [E|app|c42d31ac] Error performing TemplateRenderJob (Job ID: b1a813d5-0ca1-4ea0-8f3c-f26f5df5545f) from Dynflow(default) in 371.9ms: Safemode::SecurityError (Safemode doesn't allow to access 'version' on #<Safemode::ScopeObject>):
/opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.5/lib/safemode/scope.rb:39:in `method_missing'
Host - compare content hosts packages:80:in `block in bind'
/opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.5/lib/safemode/jail.rb:31:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.5/lib/safemode/jail.rb:31:in `method_missing'
Host - compare content hosts packages:69:in `bind'
/opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.5/lib/safemode.rb:51:in `eval'
/opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.5/lib/safemode.rb:51:in `eval'
/usr/share/foreman/lib/foreman/renderer/safe_mode_renderer.rb:7:in `render'
~~~

Version-Release number of selected component (if applicable): Satellite 6.8


How reproducible: Always

Additional info:

Additional info:
[root@dhcp130-171 foreman]# rpm -qa satellite
satellite-6.8.0-0.7.beta.el7sat.noarch
[root@dhcp130-171 foreman]# rpm -qa foreman
foreman-2.1.0.1-1.el7sat.noarch
[root@dhcp130-171 foreman]# rpm -qa katello
katello-3.16.0-0.4.rc4.el7sat.noarch

Comment 1 Marek Hulan 2020-07-28 13:46:40 UTC
It seems this was supposed to be fixed by https://github.com/theforeman/community-templates/pull/711 but it got closed due to the repo merge. lzap, any chance you can reopen this? The key here is, the report today uses `version` macro, but that does not exist. There's `gem_version_compare` instead. Thanks!

Comment 2 Lukas Zapletal 2020-08-05 11:11:01 UTC
Looking into this now, looks like we will have TWO PRs for this BZ.

Comment 3 Bryan Kearney 2020-08-05 12:00:59 UTC
Upstream bug assigned to lzap

Comment 4 Bryan Kearney 2020-08-05 12:01:02 UTC
Upstream bug assigned to lzap

Comment 5 Bryan Kearney 2020-08-11 12:00:55 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/30561 has been resolved.

Comment 9 Lukáš Hellebrandt 2020-09-18 09:45:44 UTC
Verified with Sat 6.8 snap 15.

'Host - compare content hosts packages' report generated successfully and with the correct contents.

Comment 12 errata-xmlrpc 2020-10-27 13:04:32 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.8 release), 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-2020:4366


Note You need to log in before you can comment on or make changes to this bug.