Bug 1687009 - When katello-ca-consumer is installed, it is modifying rhsm.conf and is introducing bad syntax in the [rhsm] section.
Summary: When katello-ca-consumer is installed, it is modifying rhsm.conf and is intro...
Keywords:
Status: CLOSED DUPLICATE of bug 1661041
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Uncategorized
Version: 6.4
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-08 21:30 UTC by Ivan Windon
Modified: 2019-08-12 19:32 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-03-25 16:23:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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 ***


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