Project

General

Profile

Actions

Bug #36303

closed

Getting "NoMethodError undefined method `get_status' for nil:NilClass" when publishing content view

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

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

Description

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

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

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/10517 added
Actions #2

Updated by The Foreman Bot over 1 year ago

  • Fixed in Releases Katello 4.9.0 added
Actions #3

Updated by Hao Yu over 1 year ago

  • Status changed from Ready For Testing to Closed
Actions #4

Updated by Samir Jha over 1 year ago

  • Target version set to Katello 4.8.1
  • Triaged changed from No to Yes
Actions #5

Updated by Ewoud Kohl van Wijngaarden over 1 year ago

  • Fixed in Releases Katello 4.8.1 added
Actions

Also available in: Atom PDF