Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1860351 - 'Host - compare content hosts packages' report fails with error 'undefined method '#first' for NilClass'
Summary: 'Host - compare content hosts packages' report fails with error 'undefined me...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Reporting
Version: 6.8.0
Hardware: All
OS: All
high
medium
Target Milestone: 6.8.0
Assignee: Shira Maximov
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-24 11:02 UTC by Ranjan Kumar
Modified: 2021-06-01 09:08 UTC (History)
5 users (show)

Fixed In Version: foreman-2.1.2.3-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)
Screen 1 (116.96 KB, image/png)
2020-07-24 11:02 UTC, Ranjan Kumar
no flags Details
Screen 2 (93.10 KB, image/png)
2020-07-24 11:03 UTC, Ranjan Kumar
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 30556 0 Normal Closed 'Host - compare content hosts packages' report fails with error 'undefined method '#first' for NilClass' 2020-12-14 11:34:30 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 11:02:34 UTC
Created attachment 1702332 [details]
Screen 1

Description of problem: Generating 'Host - compare content hosts packages' using wrong host fails with error "undefined method '#first' for NilClass::Jail (NilClass)" in WebUI

Hammer also fails with different error
 #hammer  report-template generate --inputs "Host 1 = host1.example.local,Host 2 = wrong.host.local"  --name 'Host - compare content hosts packages'
Unrecognized status code :internal_error

Production log:
2020-07-24T16:25:53 [I|app|16e87c8c] Started POST "/api/report_templates/243/generate" for 127.0.0.1 at 2020-07-24 16:25:53 +0530
2020-07-24T16:25:53 [I|app|16e87c8c] Processing by Api::V2::ReportTemplatesController#generate as JSON
2020-07-24T16:25:53 [I|app|16e87c8c]   Parameters: {"input_values"=>"[FILTERED]", "apiv"=>"v2", "id"=>"243", "report_template"=>{}}
2020-07-24T16:25:53 [I|app|16e87c8c] Authorized user admin(Admin User)
2020-07-24T16:25:53 [W|app|16e87c8c] Scoped order is ignored, it's forced to be batch order.
2020-07-24T16:25:53 [W|app|16e87c8c] Scoped order is ignored, it's forced to be batch order.
2020-07-24T16:25:54 [W|app|16e87c8c] Action failed
2020-07-24T16:25:54 [I|app|16e87c8c]   Rendering api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout
2020-07-24T16:25:54 [I|app|16e87c8c]   Rendered api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout (Duration: 14.6ms | Allocations: 6560)
2020-07-24T16:25:54 [I|app|16e87c8c] Completed 500 Internal Server Error in 434ms (Views: 21.5ms | ActiveRecord: 69.9ms | Allocations: 198510)


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


How reproducible: Always

Actual results: raise and error


Expected results: Should fail with valid error message


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 Ranjan Kumar 2020-07-24 11:03:20 UTC
Created attachment 1702333 [details]
Screen 2

Comment 2 Brad Buckingham 2020-07-27 21:04:15 UTC
Hi Ranjan,

Thanks for the bugzilla report.

Is this a duplicate of bug 1860430?

Would it be possible to provide the exact reproducer steps in each bugzilla so that we can see what is different?

Thanks!

Comment 3 Ranjan Kumar 2020-07-28 08:43:24 UTC
@Brad

Yes, Its different from BZ#1860430

Easy to reproduce, Just use a hostname that do not exist in satellite. For eg  host_not_exit.local doesn't exist in satellite. This will raise an error. But it should return a valid error message like "404 Host host_not_exit.local not found"

hammer  report-template generate --inputs "Host 1 = host1.example.local,Host 2 = host_not_exit.local"  --name 'Host - compare content hosts packages'
Unrecognized status code :internal_error

Comment 4 Tomer Brisker 2020-08-04 06:44:25 UTC
Created redmine issue https://projects.theforeman.org/issues/30556 from this bug

Comment 5 Bryan Kearney 2020-08-12 12:04:27 UTC
Upstream bug assigned to mshira

Comment 6 Bryan Kearney 2020-08-12 12:04:31 UTC
Upstream bug assigned to mshira

Comment 8 Bryan Kearney 2020-08-25 16:04:28 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/30556 has been resolved.

Comment 12 Lukáš Hellebrandt 2020-09-18 10:11:13 UTC
This is *almost* fixed right, except when I enter the same (valid) hosts in both host fields, I get a misleading error of "At least one of the hosts couldn't be found."

Shira, do you prefer me to fail this BZ or validate it and file a new one about this minor issue?

Comment 13 Shira Maximov 2020-09-21 09:03:28 UTC
Lukas, I would prefer that you validate this BZ  and file a new one, thanks!

Comment 14 Lukáš Hellebrandt 2020-09-21 09:49:32 UTC
Verified as per comment 12 and comment 13. Hosts can now be specified and the results are correct.

Comment 17 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.