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 2186713 - Getting "NoMethodError undefined method `get_status' for nil:NilClass" when publishing content view
Summary: Getting "NoMethodError undefined method `get_status' for nil:NilClass" when ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Views
Version: 6.12.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: 6.14.0
Assignee: Hao Chang Yu
QA Contact: Sam Bible
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-04-14 07:47 UTC by Hao Chang Yu
Modified: 2024-02-08 20:06 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2190473 (view as bug list)
Environment:
Last Closed: 2023-11-08 14:19:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 36303 0 Normal Closed Getting "NoMethodError undefined method `get_status' for nil:NilClass" when publishing content view 2023-04-14 20:15:49 UTC
Red Hat Issue Tracker SAT-17140 0 None None None 2023-05-11 09:56:09 UTC
Red Hat Issue Tracker SAT-17447 0 None None None 2023-05-11 09:56:11 UTC
Red Hat Product Errata RHSA-2023:6818 0 None None None 2023-11-08 14:19:27 UTC

Description Hao Chang Yu 2023-04-14 07:47:01 UTC
Description of problem:
This issue is similar to bug #1957035. We fixed it for content view promotion but not for content view publish.

If the current location of the user who triggered the content view publish task doesn't match the location of one or more hosts subscribed to the publishing content view, then the error will be raised.


How reproducible:
Easy

Steps to Reproduce:
1. Create a content view and attach a RHEL 7 repo to it. Publish the CV
2. In web UI, subscribe a content host in Organization 'A' and Location 'B' to the CV.
3. In the Web UI, set your current Organization as 'A' and current Location as 'C'.
4. Publish the content view.

Actual results:

47: Actions::Katello::ContentView::Publish (skipped) [ 0.30s / 0.30s ]
Error:

NoMethodError

undefined method `get_status' for nil:NilClass

---
- "/usr/share/gems/gems/katello-4.5.0.24/app/models/katello/host/content_facet.rb:220:in
  `update_errata_status'"
- "/usr/share/gems/gems/katello-4.5.0.24/app/lib/actions/katello/content_view/publish.rb:118:in
  `block in finalize'"
- "/usr/share/gems/gems/activerecord-6.0.6/lib/active_record/relation/delegation.rb:88:in
  `each'"
- "/usr/share/gems/gems/activerecord-6.0.6/lib/active_record/relation/delegation.rb:88:in
  `each'"
- "/usr/share/gems/gems/katello-4.5.0.24/app/lib/actions/katello/content_view/publish.rb:116:in
  `finalize'"
- "/usr/share/gems/gems/dynflow-1.6.4/lib/dynflow/action.rb:604:in `block (2 levels)
  in execute_finalize'"
- "/usr/share/gems/gems/dynflow-1.6.4/lib/dynflow/middleware/stack.rb:27:in `pass'"
- "/usr/share/gems/gems/dynflow-1.6.4/lib/dynflow/middleware.rb:19:in `pass'"
- "/usr/share/gems/gems/foreman-tasks-6.0.3/app/lib/actions/middleware/rails_executor_wrap.rb:20:in
  `block in finalize'"
- "/usr/share/gems/gems/activesupport-6.0.6/lib/active_support/execution_wrapper.rb:91:in
  `wrap'"
- "/usr/share/gems/gems/foreman-tasks-6.0.3/app/lib/actions/middleware/rails_executor_wrap.rb:19:in
  `finalize'"

Expected results:
No error

Additional info:

It is NOT a duplicate of bug #2147579

Comment 3 Samir Jha 2023-04-14 14:03:59 UTC
Created redmine issue https://projects.theforeman.org/issues/36304 from this bug

Comment 4 Hao Chang Yu 2023-04-14 17:07:35 UTC
Hi Samir

Actually, I have created a redmine issue for this bugzilla and created a PR for it but I forgot to link them with this bugzilla. 

https://projects.theforeman.org/issues/36303

Comment 5 Bryan Kearney 2023-04-14 20:03:34 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36303 has been resolved.

Comment 6 Sam Bible 2023-07-06 18:13:13 UTC
Verified on: 6.14 - Snap 5

Steps to Reproduce:
1. Create a content view and attach a RHEL 7 repo to it. Publish the CV
2. In web UI, subscribe a content host in Organization 'A' and Location 'B' to the CV.
3. In the Web UI, set your current Organization as 'A' and current Location as 'C'.
4. Publish the content view.

Actual results:
Content View is successfully published.

Expected results:
Content View is successfully published.

Comment 9 errata-xmlrpc 2023-11-08 14:19:08 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.