Bug 2240956

Summary: Registering host through load balancer causes REX not to know what capsule to choose for 'registered_through'
Product: Red Hat Satellite Reporter: jbjornel
Component: Capsule - ContentAssignee: Jeremy Lenz <jlenz>
Status: CLOSED ERRATA QA Contact: Vladimír Sedmík <vsedmik>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.13.4CC: ahumbe, jlenz, lstejska, nalfassi, pmendezh, rlavi, saydas, shwsingh, vsedmik, zhunting
Target Milestone: 6.15.0Keywords: Regression, Triaged, UserExperience
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2257331 (view as bug list) Environment:
Last Closed: 2024-04-23 17:14:46 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 jbjornel 2023-09-27 10:38:46 UTC
Description of problem:
From customer case with failing Remote execution that started after upgrade to 6.13. Troubleshooting resulted in finding that host's Content source gets set to null when re-registering. That resulted in Remote execution not working with error message:
Failed to initialize: RuntimeError - Could not use any Capsule for the ["SSH", "Script"] job. Consider configuring remote_execution_global_proxy, remote_execution_fallback_proxy in settings

Due to network segmentation, setting anything other than:
Fallback to Any Capsule: Yes
Enable Global Capsule: No
will fail for them.

Version-Release number of selected component (if applicable):
[root@jb-rhel8-sat613 ~]# rpm -qa | grep satellite
satellite-installer-6.13.0.7-1.el8sat.noarch
satellite-common-6.13.4-1.el8sat.noarch
ansible-collection-redhat-satellite-3.9.0-2.el8sat.noarch
rubygem-foreman_theme_satellite-11.0.0.5-1.el8sat.noarch
satellite-6.13.4-1.el8sat.noarch
ansible-collection-redhat-satellite_operations-1.3.0-2.el8sat.noarch
satellite-maintain-0.0.1-1.el8sat.noarch
satellite-cli-6.13.4-1.el8sat.noarch

How reproducible:
Always

Steps to Reproduce:
Satellite server: jb-rhel8-sat613.jb.lab
Client: jb-rhel8-test01.jb.lab
Capsules: jb-rhel8-sat613-caps01.jb.lab, jb-rhel8-sat613-caps02.jb.lab
Load balancer: jb-haproxy01.jb.lab

1. Setup satellite and capsules with load balancing according to latest documentation.

2. Register or re-register a host with --serverurl=<loadbalancer-address or ip-address for capsule> sets Content source to null.
   [root@jb-rhel8-test01 ~]# subscription-manager register --serverurl=https://jb-haproxy01.jb.lab --force

3. Register or re-register a host with --serverurl=<capsule hostname> sets the correct Content source.
   [root@jb-rhel8-test01 ~]# subscription-manager register --serverurl=https://jb-rhel8-sat613-caps02.jb.lab --force

Actual results:
[root@jb-rhel8-sat613 ~]# hammer host info --name jb-rhel8-test01.jb.lab | grep -A2 'Content Source'                                                                                                            
    Content Source:                                                                                                                                                                                             
        Id:                                                                                                                                                                                                     
        Name:                                                                                                                                                                                                   

Expected results:
[root@jb-rhel8-sat613 ~]# hammer host info --name jb-rhel8-test01.jb.lab | grep -A2 'Content Source'                                                                                                            
    Content Source:                                                                                                                                                                                             
        Id:   2                                                                                                                                                                                                 
        Name: jb-rhel8-sat613-caps01.jb.lab    


Additional info:
Debug logs attached

When reinstalling katello-ca-consumer-latest.rpm and using registering with no --serverurl, content source is
properly set from value in package.

Comment 5 Brad Buckingham 2023-10-30 11:29:29 UTC
Bulk setting Target Milestone = 6.15.0 where sat-6.15.0+ is set.

Comment 8 Jeremy Lenz 2023-11-16 17:50:29 UTC
Created redmine issue https://projects.theforeman.org/issues/36928 from this bug

Comment 14 Zach Huntington-Meath 2023-12-19 14:15:44 UTC
Moved by mistake, sorry about that.

Comment 15 Vladimír Sedmík 2024-01-17 15:41:55 UTC
Verified in 6.15.0 snap 6 using the load balanced setup (Satellite, 2 Capsules, HAproxy)

After registering or re-registering a host to a load balanced capsule (via global registration and `subscription-manager register --serverurl=...`) the host had the Content Source set properly and the REX commands run against the host succeeded.

Comment 18 errata-xmlrpc 2024-04-23 17:14:46 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.15.0 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-2024:2010