Bug 2176368 - undefined method `[]' for nil:NilClass" or undefined method `last' for nil:NilClass" when generating Host - applied errata report
Summary: undefined method `[]' for nil:NilClass" or undefined method `last' for nil:Ni...
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Reporting
Version: 6.11.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: 6.14.0
Assignee: Hao Chang Yu
QA Contact: Cole Higgins
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-08 07:15 UTC by Hao Chang Yu
Modified: 2023-08-10 17:08 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2211969 (view as bug list)
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 36182 0 Normal Closed undefined method `[]' for nil:NilClass" or undefined method `last' for nil:NilClass" when generating Host - applied erra... 2023-06-02 15:02:56 UTC
Github Katello katello pull 10482 0 None Merged Fixes #36182 - Error generating host applied errata report 2023-06-02 15:03:17 UTC
Red Hat Issue Tracker SAT-16368 0 None None None 2023-05-11 09:52:26 UTC
Red Hat Issue Tracker SAT-17444 0 None None None 2023-05-11 09:52:28 UTC

Description Hao Chang Yu 2023-03-08 07:15:36 UTC
Description of problem:
Getting one of the following errors while generating the Host - Applied Errata report.

- undefined method `[]' for nil:NilClass"
- undefined method `last' for nil:NilClass"

The first error is caused by task input returns nil because the code is fetching it the wrong way.
The second error will happen if an erratum that user tried to apply to the hosts doesn't exist in the database or is invalid. E.g. typo error.


Steps to reproduce:
1. In the "Run Job" page, use Katello SSH to apply errata to one or more hosts. In the errata field, simply enter any invalid errata.
2. Wait for the job to finish.
3. Generate the Host - Applied Errata report.

Actual results:
undefined method `last' for nil:NilClass"

Expected results:
Report can be generated successfully.

Additional info:

Comment 2 Bryan Kearney 2023-03-10 16:03:17 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36182 has been resolved.


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