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.

Bug 2079739

Summary: ipa-healthcheck command should warn for incorrect format in the ipahealthcheck.conf file
Product: Red Hat Enterprise Linux 9 Reporter: Sudhir Menon <sumenon>
Component: ipa-healthcheckAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 9.1CC: fcami, mpolovka, msauton, ssidhaye
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-healthcheck-0.9-7.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-15 10:22:33 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 Sudhir Menon 2022-04-28 07:32:54 UTC
Description of problem: ipa-healthcheck command should warn for incorrect format in the ipahealthcheck.conf file

Version-Release number of selected component (if applicable):
ipa-healthcheck-0.9-5.el9.noarch

How reproducible:
Always

Steps to Reproduce:
1. Install ipa-healthcheck and edit ipahealthcheck.conf file

[root@server ~]# cat /etc/ipahealthcheck/ipahealthcheck.conf 
[default]
output_type:human

2. [root@server ~]# ipa-healthcheck --all

Actual results:
[root@server ~]# ipa-healthcheck --all
Unhandler rdtype 256
Unhandler rdtype 256
Unhandler rdtype 256
Unhandler rdtype 256
SUCCESS: ipahealthcheck.meta.services.certmonger
SUCCESS: ipahealthcheck.meta.services.dirsrv
SUCCESS: ipahealthcheck.meta.services.gssproxy
SUCCESS: ipahealthcheck.meta.services.httpd

Expected results:
Invalid format in the configuration file should be detected or the user should be warned. 
May be we could also include ipa-healthcheck --check command to do this.

Additional info: Logging this bug to check if we can include this change.

Comment 1 Rob Crittenden 2022-04-28 12:45:43 UTC
A colon is a valid delimiter by default in the python ConfigParser class.

class configparser.ConfigParser(defaults=None, dict_type=dict, allow_no_value=False, delimiters='=', ':', comment_prefixes='#', ';', inline_comment_prefixes=None, strict=True, empty_lines_in_values=True, default_section=configparser.DEFAULTSECT, interpolation=BasicInterpolation(), converters={})

I can limit it to match the man page.

An error will look like this (semi-colon):

Unable to parse /etc/ipahealthcheck/ipahealthcheck.conf: Source contains parsing errors: '/etc/ipahealthcheck/ipahealthcheck.conf'
        [line  3]: 'output_type;human\n'

Comment 2 Michal Polovka 2022-05-18 14:24:45 UTC
Pre-verified manually using RHEL9.1 machine with ipa-healthcheck-0.9-7.el9.noarch

# cat /etc/cat /etc/ipahealthcheck/ipahealthcheck.conf
[default]
output_type:human

# ipa-healthcheck --all
Unable to parse /etc/ipahealthcheck/ipahealthcheck.conf: Source contains parsing errors: '/etc/ipahealthcheck/ipahealthcheck.conf'
	[line  2]: 'output_type:human\n'

Therefore marking as pre-verified: tested. Automation pending.

Comment 6 Michal Polovka 2022-05-27 09:14:48 UTC
Verified manually (automation in progress) using HREL9.1 machine with ipa-healthcheck-0.9-8.el9.noarch

# cat /etc/ipahealthcheck/ipahealthcheck.conf 
[default]
output_type;human

# ipa-healthcheck --all

Unable to parse /tmp/tmpubjyxtga: Source contains parsing errors: '/etc/ipahealthcheck/ipahealthcheck.conf'
	[line  2]: 'output_type;human\n'

Therefore marking as verified. Automation in progress

Comment 10 errata-xmlrpc 2022-11-15 10:22:33 UTC
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 (ipa-healthcheck bug fix and enhancement update), 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-2022:8113