Bug 1687009

Summary: When katello-ca-consumer is installed, it is modifying rhsm.conf and is introducing bad syntax in the [rhsm] section.
Product: Red Hat Satellite Reporter: Ivan Windon <iwindon>
Component: UncategorizedAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Lukas Pramuk <lpramuk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: inecas
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-25 16:23:34 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:

Description Ivan Windon 2019-03-08 21:30:36 UTC
I noticed that satellite registration is failing on some servers with older operating systems.
When katello-ca-consumer is installed, it is modifying rhsm.conf and is introducing bad syntax in the [rhsm] section.  It appears that it is supposed to be inserting a newline (\n) but someone typo'd it and it is actually inserting \nn
This specifically is the line that is being inserted:
n#config for on-premise management

This is what the [rhsm] section looks like before anything is done:

[rhsm]
# Content base URL:
baseurl= https://cdn.redhat.com

And this is what it looks like after katello-ca-consumer is installed:

[rhsm]
# Content base URL:
baseurl= https://lnxfwisat.corp.pvt/pulp/repos
n#config for on-premise management
full_refresh_on_yum = 1

I do not see this on any RHEL 7 servers.


I found what is causing the problem in katello-rhsm-consumer.
From lines 284 and 285:

    full_refresh_config="#config for on-premise management\nfull_refresh_on_yum = 1"
    sed -i "/baseurl/a\n$full_refresh_config" $CFG

The "\n" is creating a literal "\n" instead of a new line:

n#config for on-premise management

The sed line should look like this:

sed -i "/baseurl/a $full_refresh_config" $CFG

(The \n is replaced by a space)

I even tested it myself just to be sure it worked as expected.


Any thoughts on to why this would be happening?

Cheers,

Ivan Windon

Comment 3 Brad Buckingham 2019-03-25 16:23:34 UTC
Hi Ivan,

Thanks for creating the bugzilla.  This appears to be a duplicate of bug 1661041.  A solution for it should be available in 6.4.2 (and future releases).

I am going to close this bugzilla as a duplicate; however, if you re-encounter the issue after updating, please do let us know.

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