Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2124088

Summary: Installation\Re-installation of katello-pull-transport-migrate can fix an incorrect yggdrasil configuration but does not restarts the yggdrasild service on the target host.
Product: Red Hat Satellite Reporter: Sayan Das <saydas>
Component: Remote ExecutionAssignee: Adam Ruzicka <aruzicka>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.12.0CC: aruzicka, pcreech
Target Milestone: 6.12.0Keywords: Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: foreman-3.3.0.13-1,katello-pull-transport-migrate-1.0.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-16 13:44:48 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 Sayan Das 2022-09-04 16:33:36 UTC
Description of problem:

If there was an existing /etc/yggdrasil/config.toml configuration present and someone manually changed it, We will expect that installing\re-installing katello-pull-transport-migrate will correct the configuration based on latest rhsm.conf details and will restart the yggdrasild service as well.

But it tries to only start the service, not restart.


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

Satellite 6.12


How reproducible:

Always


Steps to Reproduce:
1. Have a Satellite and Capsule 6.12 up and running with pull-mqtt enabled.

2. Open SSH terminals for each system and leave this command runing:

   # journalctl -fu mosquitto

3. Register a system with the satellite server with "REX pull mode" set to yes. Preferably use Global Registration method. 

4. Confirm that yggdrasild on host is communicating with Satellite and you can run a simple uptime command via REX from Satellite on that host.

5. Change the Content Source of the Host using the UI feature of the Satellite, to the external capsule.

6. Check the /etc/yggdrasil/config.toml file on host.

7. Install\re-install the katello-pull-transport-migrate package on the host and check back on /etc/yggdrasil/config.toml file.

8. Try running a REX job from Satellite on the host.



Actual results:


Step 4: Success

Step 6: Even though rhsm.conf points to capsule, the /etc/yggdrasil/config.toml points to satellite and the host is still connected with satellite or trying to connect with satellite via yggdrasild.

Step 7.  The /etc/yggdrasil/config.toml config is correct now i.e. shows correct broker url but the Host is still connected with\trying to connect with satellite.


Step 8: The job remains in hung state ( assuming Satellite deligated the job properly to the capsule )


Expected results:

The package katello-pull-transport-migrate or its underlying script /usr/sbin/katello-pull-transport-migrate needs to be improved to restart the yggdrasild service after any sort of modifications on /etc/yggdrasil/config.toml.


Additional info:

A manual "systemctl restart yggdrasild" fixes the issue.

Comment 1 Sayan Das 2022-09-04 16:44:50 UTC
I have katello-pull-transport-migrate-1.0.1-1.el8sat.noarch installed and it has the following code:

# start the yggdrasild service
echo "Starting yggdrasild..."
systemctl enable --now yggdrasild



Whereas https://github.com/theforeman/katello-pull-transport-migrate/blob/develop/katello-pull-transport-migrate#L59-L62 has the following:

# start the yggdrasild service
echo "Starting yggdrasild..."
systemctl try-restart yggdrasild
systemctl enable --now yggdrasild


And this "systemctl try-restart yggdrasild" fixes the issue if it is part of the script. As i can't see any new RPM version for katello-pull-transport-migrate, Please have the updated script from github pushed into a new version of katello-pull-transport-migrate RPM and that should fix the issue.

Comment 2 Adam Ruzicka 2022-09-05 06:50:54 UTC
There is an overlap between this and https://bugzilla.redhat.com/show_bug.cgi?id=2115229 .

Comment 4 Peter Ondrejka 2022-10-04 19:51:18 UTC
Verified on Sat 6.12 sn 13. Re-registration now restarts the yggdrasil service and updates configuration, tested both with manual changes to /etc/yggdrasil/config.toml as well as with changed content source

Comment 9 errata-xmlrpc 2022-11-16 13:44:48 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 (Satellite 6 Satellite Client 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/RHBA-2022:8507