Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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.
When configuration options in camelCase are removed from the /etc/rhsm/rhsm.conf file and then restored with the "subscription-manager config" command, they are restored in lowercase. For example, the "subscription-manager config --rhsmcertd.autoattachinterval" command fails to restore the "autoAttachInterval" option in camelCase and, as a consequence, the entry is ignored by the rhsmcertd daemon. However, an existing value can be successfully changed by using such a command. With this update, the "subscription-manager config --remove" command no longer deletes the option from the configuration file but restores its default value instead. As a result, the described problem occurs only when configuration options are manually deleted from /etc/rhsm/rhsm.conf and not reset with the "--remove" option, which is recommended.
Description of problem:
If autoAttachInterval is absent from /etc/rhsm/rhsm.conf, The following command adds a configuration parameter to the /etc/rhsm/rhsm.conf that is ignored by the daemon, presumably due to the case of the argument.
# subscription-manager config --rhsmcertd.autoattachinterval=<n>
Version-Release number of selected component (if applicable):
subscription-manager-1.12.14-7.el6.x86_64
How reproducible: Always.
Steps to Reproduce:
1. First Verify the correct behaviour: observe the default interval in a setup where /etc/rhsm/rhsm.conf already contains an autoAttachInterval=1440 parameter
# grep -i autoAttachInterval /etc/rhsm/rhsm.conf
autoAttachInterval = 1440
Change the argument using the man-page-documented config option (using absurd values here for reproduction).
# subscription-manager config --rhsmcertd.autoattachinterval=2
Parameter has changed....
# grep -i autoAttachInterval /etc/rhsm/rhsm.conf
autoAttachInterval = 2
And the service obeys...
# service rhsmcertd restart ; tail -10 /var/log/rhsm/rhsmcertd.log | grep "Auto-attach interval"
Stopping rhsmcertd... [ OK ]
Starting rhsmcertd... [ OK ]
Thu May 21 14:33:12 2015 [INFO] Auto-attach interval: 2.0 minute(s) [120 second(s)]
2. Now .. Remove or comment any explicit "autoAttachInterval" settings in /etc/rhsm/rhsm.conf
# grep -i autoAttachInterval /etc/rhsm/rhsm.conf
#
... observe that the rhsmcertd service is using the built in 1440 default
# service rhsmcertd restart ; tail -10 /var/log/rhsm/rhsmcertd.log | grep "Auto-attach interval"
Stopping rhsmcertd... [ OK ]
Starting rhsmcertd... [ OK ]
Thu May 21 14:35:24 2015 [INFO] Auto-attach interval: 1440.0 minute(s) [86400 second(s)]
3. Add the configuration using the subscription-manager config command
# subscription-manager config --rhsmcertd.autoattachinterval=2
... Notice that the case is not as it was before: autoattachinterval versus autoAttachInterval
# grep -i autoAttachInterval /etc/rhsm/rhsm.conf
autoattachinterval = 2
... See the service ignore the new setting and continue using the default
# service rhsmcertd restart ; tail -10 /var/log/rhsm/rhsmcertd.log | grep "Auto-attach interval"
Stopping rhsmcertd... [ OK ]
Starting rhsmcertd... [ OK ]
Thu May 21 14:38:23 2015 [INFO] Auto-attach interval: 1440.0 minute(s) [86400 second(s)]
Actual results:
Expect the "subscription-manager config --rhsmcertd.autoattachinterval=<n>" to add the parameter to the /etc/rhsm/rhsm.conf file with the case matching: autoAttachInterval
Expected results:
The command adds the parameter to the case with all lower-case as autoattachinterval.
Additional info:
The help command has the command as all lower case:
# subscription-manager config --help | grep -i autoattach
--rhsmcertd.autoattachinterval=RHSMCERTD.AUTOATTACHINTERVAL
Section: rhsmcertd, Name: autoattachinterval
And attempts to specify it with a different case fail because it is unrecognized....
# subscription-manager config --rhsmcertd.autoAttachInterval=2
Usage: subscription-manager config [OPTIONS]
subscription-manager: error: no such option: --rhsmcertd.autoAttachInterval
I have not discovered why the autoAttachInterval would be absent yet, as this is only reported to be a small percentage of the customer's server population.
I suspect the fix would be just for the config tool to add the parameter with the correct case, as opposed to making the rhsmcertd case-agnostic, but others may certainly know better.
One more note: if the /etc/rhsm/rhsm.conf file already contains the correct formatted argument, the config command will update it appropriately.
# grep -i autoAttachInterval /etc/rhsm/rhsm.conf
autoAttachInterval = 1440
# subscription-manager config --rhsmcertd.autoattachinterval=2
# grep -i autoAttachInterval /etc/rhsm/rhsm.conf
autoAttachInterval = 2
# subscription-manager config --help | grep -i autoattach
--rhsmcertd.autoattachinterval=RHSMCERTD.AUTOATTACHINTERVAL
Section: rhsmcertd, Name: autoattachinterval
And attempts to specify it with a different case fail because it is unrecognized....
# subscription-manager config --rhsmcertd.autoAttachInterval=2
Usage: subscription-manager config [OPTIONS]
subscription-manager: error: no such option: --rhsmcertd.autoAttachInterval
As shown, the casing for the config flag is all lower. You did not use that. The rhsm.conf file is in camel case, but the config tool help shows the casing to use here.
Re: Comment #4
I apologize if my initial comment was confusing or unclear.
The example of the CLI attempt using CamelCase was mostly just an example to illustrate that it was not a problem with the "subscription-manager config --help" documentation.
The problem is just with the resulting config when the valid case is used on the CLI, but it puts the incorrect case in the config file.
Please disregard Comment 1
The issue in general is that the config --remove command takes the entry out of the config file. The entry cannot be replaced in the original casing because the .ini parser will only deal in lowercase.
If the entry has been previously removed, it must be manually inserted into the file. Going forward with the code change associated, the entry will not be removed when the --remove command is called. The entry will be set to the default in the file.
Before verifying, I just want to make it clear that using the "subscription-manager config --remove=SECTION.NAME" function was causing trouble when trying to restore the configuration for the camelCased config parameters...
productCertDir
entitlementCertDir
consumerCertDir
pluginDir
pluginConfDir
certCheckInterval
autoAttachInterval
As stated in comment 6, the problem was that once the camelCased configurations are removed and then restored, they are restored in lowercase which caused problems because the C-based rhsmcertd tools are looking for the camelCase configurations. If not found, then a default value is used.
The patch that Will implemented in comment 6 was to write the default configurations to /etc/rhsm/rhsm.conf rather than an absolute delete when the remove option is specified.
Beware that if you manually edit /etc/rhsm/rhsm.conf to remove a camelCased configuration, you will resurrect the situation reported in comment 1. Therefore, do not manually remove configurations from /etc/rhsm/rhsm.conf. Only use the "subscription-manager config --remove=SECTION.NAME" function.
Verifying Version....
[root@jsefler-os6 RHEL-6]# rpm -q subscription-manager
subscription-manager-1.14.8-1.el6.x86_64
STARTING CONFIG
[root@jsefler-os6 RHEL-6]# subscription-manager config | grep -B1 -i autoAttachInterval
[rhsmcertd]
autoattachinterval = [1440]
[root@jsefler-os6 RHEL-6]# grep autoAttachInterval /etc/rhsm/rhsm.conf
autoAttachInterval = 1440
SETTING A DIFFERENT CONFIG
[root@jsefler-os6 RHEL-6]# subscription-manager config --rhsmcertd.autoattachinterval=100
[root@jsefler-os6 RHEL-6]# subscription-manager config | grep -B1 -i autoAttachInterval
[rhsmcertd]
autoattachinterval = 100
[root@jsefler-os6 RHEL-6]# grep autoAttachInterval /etc/rhsm/rhsm.conf
autoAttachInterval = 100
REMOVING THE CONFIG (RESTORES THE DEFAULT)
[root@jsefler-os6 RHEL-6]# subscription-manager config --remove=rhsmcertd.autoattachinterval
You have removed the value for section rhsmcertd and name autoattachinterval.
The default value for autoattachinterval will now be used.
[root@jsefler-os6 RHEL-6]# subscription-manager config | grep -B1 -i autoAttachInterval
[rhsmcertd]
autoattachinterval = [1440]
[root@jsefler-os6 RHEL-6]# grep autoAttachInterval /etc/rhsm/rhsm.conf
autoAttachInterval = 1440
Remember, DO NOT MANUALLY EDIT /etc/rhsm/rhsm.conf to remove parameters.
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://rhn.redhat.com/errata/RHBA-2015-1345.html
Description of problem: If autoAttachInterval is absent from /etc/rhsm/rhsm.conf, The following command adds a configuration parameter to the /etc/rhsm/rhsm.conf that is ignored by the daemon, presumably due to the case of the argument. # subscription-manager config --rhsmcertd.autoattachinterval=<n> Version-Release number of selected component (if applicable): subscription-manager-1.12.14-7.el6.x86_64 How reproducible: Always. Steps to Reproduce: 1. First Verify the correct behaviour: observe the default interval in a setup where /etc/rhsm/rhsm.conf already contains an autoAttachInterval=1440 parameter # grep -i autoAttachInterval /etc/rhsm/rhsm.conf autoAttachInterval = 1440 Change the argument using the man-page-documented config option (using absurd values here for reproduction). # subscription-manager config --rhsmcertd.autoattachinterval=2 Parameter has changed.... # grep -i autoAttachInterval /etc/rhsm/rhsm.conf autoAttachInterval = 2 And the service obeys... # service rhsmcertd restart ; tail -10 /var/log/rhsm/rhsmcertd.log | grep "Auto-attach interval" Stopping rhsmcertd... [ OK ] Starting rhsmcertd... [ OK ] Thu May 21 14:33:12 2015 [INFO] Auto-attach interval: 2.0 minute(s) [120 second(s)] 2. Now .. Remove or comment any explicit "autoAttachInterval" settings in /etc/rhsm/rhsm.conf # grep -i autoAttachInterval /etc/rhsm/rhsm.conf # ... observe that the rhsmcertd service is using the built in 1440 default # service rhsmcertd restart ; tail -10 /var/log/rhsm/rhsmcertd.log | grep "Auto-attach interval" Stopping rhsmcertd... [ OK ] Starting rhsmcertd... [ OK ] Thu May 21 14:35:24 2015 [INFO] Auto-attach interval: 1440.0 minute(s) [86400 second(s)] 3. Add the configuration using the subscription-manager config command # subscription-manager config --rhsmcertd.autoattachinterval=2 ... Notice that the case is not as it was before: autoattachinterval versus autoAttachInterval # grep -i autoAttachInterval /etc/rhsm/rhsm.conf autoattachinterval = 2 ... See the service ignore the new setting and continue using the default # service rhsmcertd restart ; tail -10 /var/log/rhsm/rhsmcertd.log | grep "Auto-attach interval" Stopping rhsmcertd... [ OK ] Starting rhsmcertd... [ OK ] Thu May 21 14:38:23 2015 [INFO] Auto-attach interval: 1440.0 minute(s) [86400 second(s)] Actual results: Expect the "subscription-manager config --rhsmcertd.autoattachinterval=<n>" to add the parameter to the /etc/rhsm/rhsm.conf file with the case matching: autoAttachInterval Expected results: The command adds the parameter to the case with all lower-case as autoattachinterval. Additional info: The help command has the command as all lower case: # subscription-manager config --help | grep -i autoattach --rhsmcertd.autoattachinterval=RHSMCERTD.AUTOATTACHINTERVAL Section: rhsmcertd, Name: autoattachinterval And attempts to specify it with a different case fail because it is unrecognized.... # subscription-manager config --rhsmcertd.autoAttachInterval=2 Usage: subscription-manager config [OPTIONS] subscription-manager: error: no such option: --rhsmcertd.autoAttachInterval I have not discovered why the autoAttachInterval would be absent yet, as this is only reported to be a small percentage of the customer's server population. I suspect the fix would be just for the config tool to add the parameter with the correct case, as opposed to making the rhsmcertd case-agnostic, but others may certainly know better.