#50884 Health check tool DSEldif check fails
Closed: wontfix by mreynolds. Opened by vashirov.

Issue Description

self._instance.serverid is None for some reason:

INFO: Checking DSEldif ...
> /workspace/ds/src/lib389/lib389/dseldif.py(40)__init__()
-> if serverid:
(Pdb) type(serverid)
<class 'NoneType'>

And it fails in DSEldif check:

INFO: Checking DSEldif ...
DEBUG: [Errno 2] No such file or directory: '/etc/dirsrv/slapd-{instance_name}/dse.ldif'
Traceback (most recent call last):
  File "/usr/sbin/dsctl", line 134, in <module>
    result = args.func(inst, log, args)
  File "/workspace/ds/src/lib389/lib389/cli_ctl/health.py", line 88, in health_check_run
    lo_inst = lo(inst)
  File "/workspace/ds/src/lib389/lib389/dseldif.py", line 49, in __init__
    with open(self.path, 'r') as file_dse:
FileNotFoundError: [Errno 2] No such file or directory: '/etc/dirsrv/slapd-{instance_name}/dse.ldif'
ERROR: Error: [Errno 2] No such file or directory: '/etc/dirsrv/slapd-{instance_name}/dse.ldif'

Package Version and Platform

389-ds-base-1.4.3.2-20200205gitfcd6b2e1c.fc31.x86_64

Steps to reproduce

from lib389.topologies import topology_m2
def test_m2(topology_m2):
    breakpoint()
# dsctl master1 healthcheck

Actual results

Checking DSEldif ...
Error: [Errno 2] No such file or directory: '/etc/dirsrv/slapd-{instance_name}/dse.ldif'

Expected results

DSEldif check should not fail.


It also fails in the Replica check if serverid is None:

INFO: Checking Replica ...
DEBUG: list filter = (&(objectclass=nsds5Replica))
DEBUG: list filter = (&(objectclass=nsds5replicationagreement))
DEBUG: cn=replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config getVal('nsDS5ReplicaRoot')
DEBUG: cn=002,cn=replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config getVal('nsDS5ReplicaRoot')
DEBUG: cn=002,cn=replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config getVal('cn')
DEBUG: _gen_selector filter = (&(&(objectclass=nsds5Replica))(|(nsDS5ReplicaRoot=dc=example,dc=com)))
DEBUG: cn=replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config getVal('nsDS5ReplicaRoot')
DEBUG: cn=002,cn=replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config getVal('nsds5replicaLastUpdateStatusJSON')
DEBUG: cn=002,cn=replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config getVal('nsDS5ReplicaHost')
DEBUG: cn=002,cn=replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config getVal('nsDS5ReplicaPort')
DEBUG: cn=002,cn=replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config getVal('nsDS5ReplicaRoot')
DEBUG: cn=002,cn=replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config getVal('nsds5replicatransportinfo')
DEBUG: _gen_selector filter = (&(&(objectclass=nsds5Replica))(|(nsDS5ReplicaRoot=dc=example,dc=com)))
DEBUG: cn=replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config getVal('nsDS5ReplicaRoot')
DEBUG: cn=replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config getVal('nsDS5ReplicaId')
DEBUG: Allocate <class 'lib389.DirSrv'> with None
DEBUG: Allocate <class 'lib389.DirSrv'> with server-f31.example.com:39002
DEBUG: Allocate <class 'lib389.DirSrv'> with server-f31.example.com:39002
DEBUG: open(): Connecting to uri ldap://server-f31.example.com:39002/
DEBUG: Using dirsrv ca certificate /etc/dirsrv/slapd-template
DEBUG: Using external ca certificate /etc/dirsrv/slapd-template
DEBUG: Using external ca certificate /etc/dirsrv/slapd-template
DEBUG: Using certificate policy 1
DEBUG: ldap.OPT_X_TLS_REQUIRE_CERT = 1
DEBUG: open(): bound as cn=Directory manager
DEBUG: Retrieving entry with [('',)]
DEBUG: Retrieved entry [dn: 
vendorVersion: 389-Directory/1.4.3.2.20200205gitfcd6b2e1c B2020.036.1438
]
DEBUG: list filter = (&(objectclass=nsds5Replica))
DEBUG: cn=replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config getVal('nsDS5ReplicaRoot')
DEBUG: list filter = (&(objectclass=ldapsubentry)(nsds5replconflict=*))
DEBUG: replace() argument 2 must be str, not None
Traceback (most recent call last):
  File "/usr/sbin/dsctl", line 134, in <module>
    result = args.func(inst, log, args)
  File "/workspace/ds/src/lib389/lib389/cli_ctl/health.py", line 89, in health_check_run
    result = lo_inst.lint()
  File "/workspace/ds/src/lib389/lib389/_mapped_object.py", line 981, in lint
    for result in fn():
  File "/workspace/ds/src/lib389/lib389/replica.py", line 1175, in _lint_conflicts
    report['fix'] = report['fix'].replace('YOUR_INSTANCE', self._instance.serverid)
TypeError: replace() argument 2 must be str, not None
ERROR: Error: replace() argument 2 must be str, not None

Metadata Update from @vashirov:
- Custom field origin adjusted to None
- Custom field reviewstatus adjusted to None

I can not reproduce this. I ran ./replcheck_test.py to create two replicas, and healthcheck runs fine on master1 and master2. I have other instances installed as well and they also work. Is this systematic for you @vashirov ?

I can not reproduce this. I ran ./replcheck_test.py to create two replicas, and healthcheck runs fine on master1 and master2. I have other instances installed as well and they also work. Is this systematic for you @vashirov ?

Is this in a container by any chance? If it is, does it still reproduce for you outside of a container?

Metadata Update from @mreynolds:
- Issue set to the milestone: 1.4.3

It could be reproduced systematically with 389-ds-base-1.4.2.8-2, when using ~/.dsrc :
Having installed instances with py.test and created a ~/.dsrc file :

[standalone2]
uri = ldap://localhost:38902
basedn = dc=example,dc=com
binddn = cn=Directory Manager
# dsctl standalone2 healthcheck
Enter password for cn=Directory Manager on ldap://localhost:38902: 
Beginning lint report, this could take a while ...
Checking Backends ...
Checking Config ...
Checking Encryption ...
Checking FSChecks ...
Checking ReferentialIntegrityPlugin ...
Checking MonitorDiskSpace ...
Checking Replica ...
Checking Changelog5 ...
Checking DSEldif ...
Error: [Errno 2] No such file or directory: '/etc/dirsrv/slapd-{instance_name}/dse.ldif'

Metadata Update from @mreynolds:
- Issue assigned to mreynolds

https://pagure.io/389-ds-base/pull-request/50911

Metadata Update from @mreynolds:
- Issue priority set to: major
- Issue tagged with: Healthcheck

Commit 07a1080c relates to this ticket

Commit 07a1080 relates to this ticket

f479c2043..610d2f5c6 389-ds-base-1.4.2 -> 389-ds-base-1.4.2

3af86a083..74046abb8 389-ds-base-1.4.1 -> 389-ds-base-1.4.1

Metadata Update from @mreynolds:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/3937

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: fixed)

Metadata
Related Pull Requests