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: VERIFIED
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: 2020-10-19 14:05 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:
Target Upstream Version:


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 Priority Status Summary Last Updated
Foreman Issue Tracker 30556 Normal Closed 'Host - compare content hosts packages' report fails with error 'undefined method '#first' for NilClass' 2020-10-12 11:42:06 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@redhat.com

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

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.


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