Bug 1861831 - satellite-change-hostname cannot change the satellite hostname after failing.
Summary: satellite-change-hostname cannot change the satellite hostname after failing.
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: satellite-change-hostname
Version: 6.8.0
Hardware: Unspecified
OS: Unspecified
medium vote
Target Milestone: 6.8.0
Assignee: Jeremy Lenz
QA Contact: Peter Ondrejka
: 1866929 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2020-07-29 16:50 UTC by Rudnei Bertol Jr.
Modified: 2020-10-27 13:05 UTC (History)
8 users (show)

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

Attachments (Terms of Use)

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):


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]
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.


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