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 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: CLOSED ERRATA
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-11-08 14:19 UTC (History)
4 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: 2023-11-08 14:18:58 UTC
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
Red Hat Product Errata RHSA-2023:6818 0 None None None 2023-11-08 14:19:10 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.

Comment 7 errata-xmlrpc 2023-11-08 14:18:58 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.14 security and bug fix update), 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-2023:6818


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