Project

General

Profile

Actions

Bug #36182

closed

undefined method `[]' for nil:NilClass" or undefined method `last' for nil:NilClass" when generating Host - applied errata report

Added by Hao Yu over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Difficulty:
easy
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Clone from https://bugzilla.redhat.com/show_bug.cgi?id=2176368

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:

Actions #1

Updated by The Foreman Bot over 1 year ago

  • Status changed from New to Ready For Testing
  • Assignee set to Hao Yu
  • Pull request https://github.com/Katello/katello/pull/10482 added
Actions #2

Updated by Jeremy Lenz over 1 year ago

  • Target version set to Katello 4.8.0
  • Triaged changed from No to Yes
Actions #3

Updated by The Foreman Bot over 1 year ago

  • Fixed in Releases Katello 4.9.0 added
Actions #4

Updated by Hao Yu over 1 year ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF