Bug 1780510

Summary: Source 'ipahealthcheck.ipa.topology' not found is displayed when ipactl service is stopped
Product: Red Hat Enterprise Linux 8 Reporter: Sudhir Menon <sumenon>
Component: ipa-healthcheckAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.1CC: fcami, ksiddiqu, ndehadra, ssidhaye
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-healthcheck-0.7-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 15:47:50 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 2019-12-06 09:03:20 UTC
Description of problem: Source 'ipahealthcheck.ipa.topology' not found is displayed when ipactl stop is run.


Version-Release number of selected component (if applicable):
ipa-server-4.8.0-11.module+el8.1.0+4247+9f3fd721.x86_64


How reproducible: Always

Steps to Reproduce:
1. Install ipa-server and then do ipactl stop.
2. Now run the command #ipa-healthcheck --source ipahealthcheck.ipa.topology
3. Run the command #ipa-healthcheck --source ipahealthcheck.meta.services

Actual results:
2. "ipa-healthcheck --source ipahealthcheck.ipa.topology" displays an error 
[root@master ~]# ipa-healthcheck --source ipahealthcheck.ipa.topology
Source 'ipahealthcheck.ipa.topology' not found

When ipa-healthcheck --source ipahealthcheck.ipa.topology --debug is run we can see a traceback.

stderr=
Calling check <ipahealthcheck.meta.services.pki_tomcatd object at 0x7f0103e33518>
Loading StateFile from '/var/lib/ipa/sysrestore/sysrestore.state'
Loading Index file from '/var/lib/ipa/sysrestore/sysrestore.index'
request POST http://master.rhel81.test:8080/ca/admin/ca/getStatus
request body ''
httplib request failed:
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/ipapython/dogtag.py", line 230, in _httplib_request
    conn.request(method, path, body=request_body, headers=headers)
  File "/usr/lib64/python3.6/http/client.py", line 1254, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1300, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1249, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1036, in _send_output
    self.send(msg)
  File "/usr/lib64/python3.6/http/client.py", line 974, in send
    self.connect()
  File "/usr/lib64/python3.6/http/client.py", line 946, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/lib64/python3.6/socket.py", line 724, in create_connection
    raise err
  File "/usr/lib64/python3.6/socket.py", line 713, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
Failed to check CA status: cannot connect to 'http://master.rhel81.test:8080/ca/admin/ca/getStatus': [Errno 111] Connection refused
Calling check <ipahealthcheck.meta.services.sssd object at 0x7f0103e70128>
Starting external process
args=['/bin/systemctl', 'is-active', 'sssd.service']
Process finished, return code=0
stdout=active

stderr=
Calling check <ipahealthcheck.ipa.topology.IPATopologyDomainCheck object at 0x7f0103e90748>
Skipping ipahealthcheck.ipa.topology:IPATopologyDomainCheck because dirsrv service(s) not running
Source 'ipahealthcheck.ipa.topology' not found

3. ipa-healthcheck --source ipahealthcheck.meta.services command runs without displaying Source ipahealthcheck.meta.services not found.

Expected results:
Source 'ipahealthcheck.ipa.topology' not found is misleading and should be replaced with the proper output.

Additional info:

Comment 1 Sudhir Menon 2019-12-06 09:14:30 UTC
The behaviour seems to be the same  when dirsrv instance is not running and the checks require the service to be running.

[root@master ~]# ipa-healthcheck --source ipahealthcheck.dogtag.ca --check DogtagCertsConnectivityCheck --debug
Loading Index file from '/var/lib/ipa/sysrestore/sysrestore.index'
Failed to connect to LDAP: cannot connect to 'ldapi://%2Fvar%2Frun%2Fslapd-RHEL81-TEST.socket': Connection refused
Skipping ipahealthcheck.dogtag.ca:DogtagCertsConnectivityCheck because dirsrv service(s) not running
Check 'DogtagCertsConnectivityCheck' not found in Source 'ipahealthcheck.dogtag.ca'

Comment 3 Rob Crittenden 2020-11-03 21:19:25 UTC
Fixed in upstream: 
1fedf08a6de405b87897c4b7ed30f62cae88cd47

Comment 9 Sumedh Sidhaye 2020-12-18 03:28:20 UTC
Build used for verification:

ipa-client-4.9.0-0.5.rc3.module+el8.4.0+9124+ced20601.x86_64
ipa-client-common-4.9.0-0.5.rc3.module+el8.4.0+9124+ced20601.noarch
ipa-common-4.9.0-0.5.rc3.module+el8.4.0+9124+ced20601.noarch
ipa-healthcheck-0.7-3.module+el8.4.0+9007+5084bdd8.noarch
ipa-healthcheck-core-0.7-3.module+el8.4.0+9007+5084bdd8.noarch
ipa-selinux-4.9.0-0.5.rc3.module+el8.4.0+9124+ced20601.noarch
ipa-server-4.9.0-0.5.rc3.module+el8.4.0+9124+ced20601.x86_64
ipa-server-common-4.9.0-0.5.rc3.module+el8.4.0+9124+ced20601.noarch
ipa-server-dns-4.9.0-0.5.rc3.module+el8.4.0+9124+ced20601.noarch
ipa-server-trust-ad-4.9.0-0.5.rc3.module+el8.4.0+9124+ced20601.x86_64

test_integration/test_ipahealthcheck.py::TestIpaHealthCheck::test_ipahealthcheck_topology_with_ipactl_stop PASSED [ 34%]

------------------------------ Captured log setup ------------------------------
transport.py               391 INFO     RUN ['ipactl', 'stop']
transport.py               513 DEBUG    RUN ['ipactl', 'stop']
transport.py               558 DEBUG    ipa: INFO: The ipactl command was successful
transport.py               558 DEBUG    Stopping ipa-dnskeysyncd Service
transport.py               558 DEBUG    Stopping ipa-otpd Service
transport.py               558 DEBUG    Stopping pki-tomcatd Service
transport.py               558 DEBUG    Stopping ipa-custodia Service
transport.py               558 DEBUG    Stopping httpd Service
transport.py               558 DEBUG    Stopping named Service
transport.py               558 DEBUG    Stopping kadmin Service
transport.py               558 DEBUG    Stopping krb5kdc Service
transport.py               558 DEBUG    Stopping Directory Service
transport.py               217 DEBUG    Exit code: 0
------------------------------ Captured log call -------------------------------
transport.py               391 INFO     RUN ['ipa-healthcheck', '--source', 'ipahealthcheck.ipa.topology', '--debug']
transport.py               513 DEBUG    RUN ['ipa-healthcheck', '--source', 'ipahealthcheck.ipa.topology', '--debug']
transport.py               558 DEBUG    Loading StateFile from '/var/lib/ipa/sysrestore/sysrestore.state'
transport.py               558 DEBUG    Loading StateFile from '/var/lib/ipa/sysrestore/sysrestore.state'
transport.py               558 DEBUG    Source 'ipahealthcheck.ipa.topology' is missing one or more requirements 'dirsrv'
transport.py               217 DEBUG    Exit code: 1

Comment 11 errata-xmlrpc 2021-05-18 15:47:50 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 (Moderate: idm:DL1 and idm:client security, 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/RHSA-2021:1846