Bug 1957035

Summary: Promotion content view failed with NoMethodError: undefined method `get_status' for nil:NilClass
Product: Red Hat Satellite Reporter: Rafael Cavalcanti <rcavalca>
Component: Content ViewsAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: Lai <ltran>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.8.0CC: aganbat, ahumbe, alsouza, arahaman, dhjoshi, dmule, jbhatia, jjeffers, ktordeur, lbenedit, pmoravec, rdesouza, smajumda, wclark, wpinheir, zhunting
Target Milestone: 6.10.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-4.1.1.17-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2007358 (view as bug list) Environment:
Last Closed: 2021-11-16 14:10:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rafael Cavalcanti 2021-05-04 21:48:57 UTC
Description of problem:

After publish and promoting a CV, it gives a warning with the following msg under Task -> Click on the Promote task -> Dynflow Console -> Finalize:
~~~
27: Actions::Katello::ContentView::PromoteToEnvironment (skipped) [ 0.03s / 0.03s ]

Error:

NoMethodError

undefined method `get_status' for nil:NilClass

---
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.26/app/models/katello/host/content_facet.rb:230:in
  `update_errata_status'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.26/app/lib/actions/katello/content_view/promote_to_environment.rb:50:in
  `block in finalize'"
~~~

Version-Release number of selected component (if applicable):
6.8

How reproducible:
100%

Steps to Reproduce:
1. Create 2 Locations 'Location_A' and 'Location_B'
2. under Location 'Location_A' create a CV named CV_Test and promote it to the Dev environment
3. Assign the CV and Env to a host under Location_A
4. Assign the host to 'Location_B'
5. Change the Context to 'Location_A'
6. Publish the CV_Test and promote it to Dev

Actual results:
The promotion does not complete with success and ends with the following msg:

~~~
27: Actions::Katello::ContentView::PromoteToEnvironment (skipped) [ 0.03s / 0.03s ]

Error:

NoMethodError

undefined method `get_status' for nil:NilClass

---
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.26/app/models/katello/host/content_facet.rb:230:in
  `update_errata_status'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.16.0.26/app/lib/actions/katello/content_view/promote_to_environment.rb:50:in
  `block in finalize'"
~~~

Expected results:
The promotion finish with success w/o taking the taxonomy into account.


Additional info:

Comment 1 Rafael Cavalcanti 2021-05-04 21:54:40 UTC
Workaround:
1. Change the context to "Any Location"
2. Publish and promote the CV

Comment 2 Partha Aji 2021-05-06 20:15:46 UTC
Connecting redmine issue https://projects.theforeman.org/issues/32556 from this bug

Comment 6 Brad Buckingham 2021-08-23 14:43:36 UTC
*** Bug 1996649 has been marked as a duplicate of this bug. ***

Comment 7 Bryan Kearney 2021-09-03 20:04:46 UTC
Upstream bug assigned to jsherril

Comment 8 Bryan Kearney 2021-09-03 20:04:48 UTC
Upstream bug assigned to jsherril

Comment 10 wclark 2021-09-18 00:15:05 UTC
HOTFIX RPM is available for Satellite 6.8.6.

OBTAINING THE HOTFIX:

The hotfix RPM is too large to be provided as an attachment on Bugzilla. Therefore please contact Red Hat Support to obtain the hotfix.

INSTALL INSTRUCTIONS:

1. Take a complete backup or snapshot of Satellite 6.8.6 server

2. Obtain the hotfix RPM from Red Hat Support and copy it to Satellite server

3. # yum install tfm-rubygem-katello-3.16.0.26-2.HOTFIXRHBZ1957035.el7sat.noarch.rpm --disableplugin=foreman-protector

4. # systemctl restart httpd

Comment 12 Griffin Sullivan 2021-10-04 17:34:10 UTC
Verified in 6.8

Publishing and promoting a CV succeeds after assigning the host to a new location.

Steps to Reproduce:
1. Create 2 Locations 'Location_A' and 'Location_B'
2. Under Location 'Location_A' create a CV named CV_Test and promote it to the Dev environment
3. Assign the CV and Env to a host under Location_A
4. Assign the host to 'Location_B'
5. Change the Context to 'Location_A'
6. Publish the CV_Test and promote it to Dev

Expected Results:
Publishing and promoting CV_Test succeeds in Location_A.

Actual Results:
Publishing and promoting CV_Test succeeds in Location_A.

Comment 13 Griffin Sullivan 2021-10-07 16:53:48 UTC
Accidentally verified this in the wrong Satellite version above.

This has now been verified in 6.10 snap 21.

Steps to reproduce and results are the same as above.

Comment 20 errata-xmlrpc 2021-11-16 14:10:50 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 (Moderate: Satellite 6.10 Release), 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-2021:4702

Comment 24 Red Hat Bugzilla 2023-09-18 00:26:23 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days