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.
DescriptionRudnei 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 1Zach Huntington-Meath
2020-08-10 14:56:35 UTC
*** Bug 1866929 has been marked as a duplicate of this bug. ***
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
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. ~~~