Bug 1405614
Summary: | System does not get registered because {"network.hostname-override":""} in /etc/rhsm/facts/katello.facts is empty due `hostname -f` | |||
---|---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Marcelo Moreira de Mello <mmello> | |
Component: | Registration | Assignee: | Justin Sherrill <jsherril> | |
Status: | CLOSED ERRATA | QA Contact: | Lukas Pramuk <lpramuk> | |
Severity: | urgent | Docs Contact: | ||
Priority: | urgent | |||
Version: | 6.2.5 | CC: | abalakht, bbuckingham, cdonnell, chrobert, dhill, egolov, ehelms, fgarciad, greartes, isaac.freeman, jcallaha, jtudelag, lpramuk, marcus.oliphant, mmello, nitthoma, nshaik, prsharma, wrichter | |
Target Milestone: | Unspecified | Keywords: | PrioBumpGSS, Triaged | |
Target Release: | Unused | |||
Hardware: | All | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | katello-installer-base-3.0.0.73-1,rubygem-katello-3.0.0.100-1 | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1417068 (view as bug list) | Environment: | ||
Last Closed: | 2017-03-06 08:36:20 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: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1417068 |
Description
Marcelo Moreira de Mello
2016-12-16 20:52:13 UTC
Connecting redmine issue http://projects.theforeman.org/issues/17721 from this bug Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17721 has been resolved. so, the fix is introducing another problem. The override is in fact now overriding my fqdn. The katello.facts file being static is not a good idea. I spent hours trying to figure out why all of my hostname settings were not being reflected during registration. I agree that caching the hostname in a static file is a bad idea. I've run in to the issue where "hostname -f" fails and an empty string is cached in the file, but I've also recently run in to an issue where a registered RHEL VM is cloned, and when you change the hostname and IP, reboot, and try to re-register the new system, it just overwrites the registration in Satellite of the original VM because it's still using the original VM's cached hostname. I don't see how there is any sense is caching the hostname in a separate file when it's available easily in the HOSTNAME environment variable or the "hostname" command for any applications running on the system. Its a temporary measure to work around differences in how puppet and subscription-manager report the hostname. It is obsoleted by: https://bugzilla.redhat.com/show_bug.cgi?id=1367126 and by installing the newest katello-agent (which will provide the fqdn fact if its not present). VERIFIED. @satellite-6.2.8-1.0.el7sat.noarch (snap3) katello-installer-base-3.0.0.77-1.el7sat.noarch tfm-rubygem-katello-3.0.0.103-1.el7sat.noarch by following manual reproducer: 1. Create a VM that SAT (6.2.7) is not aware of (preferably behind NAT) 2. Simulate that `hostname -f` fails for on the VM # cat > /usr/bin/hostname <<<'exit 1' 3. Install CA consumer certs # rpm -Uvh http://$SAT/pub/katello-ca-consumer-latest.noarch.rpm 4. Check contents of /etc/rhsm/facts/katello.facts # cat /etc/rhsm/facts/katello.facts {"network.hostname-override":""} 5. Try to register to 6.2.7 # subscription-manager register --force --username admin --password changeme Registering to: <SATFQDN>:443/rhsm Validation failed: Name can't be blank, Name is invalid >>> REPRODUCED 6. Upgrade SAT to 6.2.8 7. Check contents of /etc/rhsm/facts/katello.facts # cat /etc/rhsm/facts/katello.facts {"network.hostname-override":""} 8. Register to 6.2.8 # subscription-manager register --force --username admin --password changeme Registering to: <SATFQDN>:443/rhsm The system has been registered with ID: f4c33c48-34a2-4b0b-8df4-05a3a0e8b4e4 >>> VERIFIED that though network.hostname-override is empty the VM registers >>> re-registration of already (before the fix) registered client succeeds 9. Simulate brand new registration # subscription-manager unregister # rpm -e $(rpm -qa katello-ca-consumer-*) # rm -f /etc/rhsm/facts/katello.facts 10. Install CA consumer certs # rpm -Uvh http://$SAT/pub/katello-ca-consumer-latest.noarch.rpm 11. Check contents of /etc/rhsm/facts/katello.facts # cat /etc/rhsm/facts/katello.facts cat: /etc/rhsm/facts/katello.facts: No such file or directory 12. Register new (not yet registered) client # subscription-manager register --force --username admin --password changeme Registering to: <SATFQDN>:443/rhsm The system has been registered with ID: 094873f8-3972-4879-9452-fc8af730ea11 >>> VERIFIED that though /etc/rhsm/facts/katello.facts is no longer generated by /usr/bin/katello-rhsm-consumer the VM registers >>> the new client registration succeeds 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, 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-2017:0447 This is good information as we hit this with virt-customize on a minimal kickstart image. |