Bug 1866929 - Satellite Hostname Change fails due to an error causing incorrect update to /etc/hosts
Summary: Satellite Hostname Change fails due to an error causing incorrect update to /...
Keywords:
Status: CLOSED DUPLICATE of bug 1861831
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Installation
Version: 6.8.0
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: 6.8.0
Assignee: satellite6-bugs
QA Contact: Devendra Singh
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-06 20:32 UTC by Kedar Kulkarni
Modified: 2020-08-10 14:56 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-08-10 14:56:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Kedar Kulkarni 2020-08-06 20:32:02 UTC
Created attachment 1710701 [details]
Log messages when /etc/hosts is modified

Description of problem:
When trying to change hostname of Satellite, it incorrectly modifies /etc/hosts as follows:

Original:
10.1.3.104 dhcp-3-57.vms.sat.rdu2.redhat.com dhcp-3-104.vms.sat.rdu2.redhat.com
Modified: 
10.1.3.104 dhcp-3-104.vms.sat.rdu2.redhat.com dhcp-3-104.vms.sat.rdu2.redhat.com



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

How reproducible:
100%

Steps to Reproduce:
1.Install Satellite 
2.Modify /etc/hosts by hand to include old hostname and new(desired) hostname as shown above in original section above. 
3.Run hostname change command. 

satellite-change-hostname <new-hostname> -u admin -p "changeme" -y

Actual results:

Failure, stderr:

No Match for argument: dhcp-3-140.vms.sat.rdu2.redhat.com-tomcat*
/usr/share/katello/hostname-change.rb:378: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>'

Expected results:
Hostname change should succeed without errors.

Additional info:
As I stated earlier, /etc/hosts file gets modified in the process of hostname change and that seems to be a possible reason for failure or related to failure somehow.

Comment 3 Zach Huntington-Meath 2020-08-10 14:56:35 UTC

*** This bug has been marked as a duplicate of bug 1861831 ***


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