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 1861831 - satellite-change-hostname cannot change the satellite hostname after failing.
Summary: satellite-change-hostname cannot change the satellite hostname after failing.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: satellite-change-hostname
Version: 6.8.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: 6.8.0
Assignee: Jeremy Lenz
QA Contact: Peter Ondrejka
URL:
Whiteboard:
: 1866929 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-29 16:50 UTC by Rudnei Bertol Jr.
Modified: 2023-12-15 18:37 UTC (History)
8 users (show)

Fixed In Version: katello-3.16.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 13:04:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:4366 0 None None None 2020-10-27 13:05:14 UTC

Description Rudnei Bertol Jr. 2020-07-29 16:50:28 UTC
Description of problem:

Satellite hostname change command fails to run on the second time, if the command failed for some reason on the first attempt.

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

6.8.0-beta

How reproducible:

Try to change the satellite hostname using the satellite-change-hostname after a failing on the first attempt.

Steps to Reproduce:
1. perform the satellite-change-hostname causing the failure, i.e. change for a hostname that cannot be resolved.
2. re-run the same command.


Actual results:

We cannot re-run the satellite-change-hostname if it has failed previsouly.

Expected results:

We should be able to re-run after fixing the previous error.

Additional info:

Following a reproducer for the error.

~~~ 
[root@dhcp181-132 ~]# satellite-change-hostname acme.gsslab.rdu2.redhat.com -u admin -p password
 
Checking hostname validity
 
Checking overall health of server
 
Checking credentials
 
***WARNING*** This script will modify your system.
You will need to re-register any foreman clients registered to this system after script completion.
Capsules will have to be re-registered and reinstalled. If you are using custom certificates,
you will have to run the foreman-installer again with custom certificate options after this script completes.
 Have you taken the necessary precautions (backups, snapshots, etc...)?
Proceed with changing your hostname? [y/n]
y
Precheck passed
updating hostname in /etc/hostname
setting hostname
checking if hostname was changed
 
Updating default Capsule
Updating installation media paths
stopping services
removing old cert rpms
No Match for argument: dhcp181-132.gsslab.rdu2.redhat.com-tomcat*
deleting old certs
backed up /var/www/html/pub to /var/www/html/pub/dhcp181-132.gsslab.rdu2.redhat.com-20200729100741.backup
updating hostname in /etc/hosts
updating hostname in foreman installer scenarios
updating hostname in hammer configuration
backing up last_scenario.yaml
removing last_scenario.yaml
re-running the installer
foreman-installer --scenario satellite -v --disable-system-checks --certs-regenerate=true --foreman-proxy-register-in-foreman true
Unable to resolve forward DNS for acme.gsslab.rdu2.redhat.com
restoring last_scenario.yaml
/usr/share/katello/hostname-change.rb:382:in `restore_last_scenario_yaml': undefined method `path' for nil:NilClass (NoMethodError)
        from /usr/share/katello/hostname-change.rb:533:in `block in run'
        from /usr/share/katello/helper.rb:59:in `run_cmd'
        from /usr/share/katello/hostname-change.rb:530:in `run'
        from /usr/sbin/satellite-change-hostname:23:in `<main>'
 
[root@dhcp181-132 ~]# satellite-change-hostname acme.gsslab.rdu2.redhat.com -u admin -p password
This utility can't run on a non-katello system.
~~~

Comment 1 Zach Huntington-Meath 2020-08-10 14:56:35 UTC
*** Bug 1866929 has been marked as a duplicate of this bug. ***

Comment 3 Peter Ondrejka 2020-09-03 08:51:22 UTC
Verified on Sat 6.8 snap 13, an unsuccessful attempt to change hostname with s-c-h no longer blocks subsequent attemtps

Comment 6 errata-xmlrpc 2020-10-27 13:04: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 (Important: Satellite 6.8 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-2020:4366


Note You need to log in before you can comment on or make changes to this bug.