Bug 2211690

Summary: ds-replcheck is failing to retrieve RUV data.
Product: Red Hat Directory Server Reporter: Têko Mihinto <tmihinto>
Component: 389-ds-baseAssignee: mreynolds
Status: MODIFIED --- QA Contact: LDAP QA Team <idm-ds-qe-bugs>
Severity: medium Docs Contact: Evgenia Martynyuk <emartyny>
Priority: high    
Version: 11.7CC: bsmejkal, idm-ds-dev-bugs, mreynolds, musoni, progier
Target Milestone: DS11.8Keywords: Triaged
Target Release: dirsrv-11.8   
Hardware: x86_64   
OS: Linux   
Whiteboard: sync-to-jira
Fixed In Version: redhat-ds-11-8090020230808123031.4a0d6ab8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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 Têko Mihinto 2023-06-01 14:05:47 UTC
Description of problem:

The ds-replcheck tool is reporting the error "Supplier does not have an RUV entry":

$ ds-replcheck --verbose state -D "cn=Directory Manager" -w ... -m ldap://<SUPPLIER> -r ldap://<CONSUMER> -b "<REPLICATED_SUFFIX>"
Connecting to servers...
Validating suffix ...
Gathering Supplier's RUV...
Error: Supplier does not have an RUV entry
$

Nonetheless a direct search on the replica configuration entry is showing RUV data:

$ ldapsearch -xLLL -H ldap://<SUPPLIER>:389 -D "cn=Directory Manager" -W -b "cn=replica,cn=<REPLICATED_SUFFIX>,cn=mapping tree,cn=config" -s base nsds50ruv
Enter LDAP Password:
dn: cn=replica,cn=<REPLICATED_SUFFIX>,cn=mapping tree,cn=config
nsds50ruv: {replicageneration} 6422a5240000000d0000
nsds50ruv: {replica 13 ldap://<HOST_1>:389} 6422afe20000000d
 0000 6476fc570000000d0000
nsds50ruv: {replica 23 ldap://<HOST_2>:389} 6447e18100000017
 0000 647866c2000100170000

$

The same goes for the consumer.

Version-Release number of selected component (if applicable):

$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.6 (Ootpa)
$
$ rpm -qa | grep 389-ds
cockpit-389-ds-1.4.3.29-3.module+el8dsrv+14615+a86efbbf.noarch
389-ds-base-libs-1.4.3.29-3.module+el8dsrv+14615+a86efbbf.x86_64
389-ds-base-1.4.3.29-3.module+el8dsrv+14615+a86efbbf.x86_64
$

How reproducible:

Always at a customer site.

Steps to Reproduce:
Was a customer deployment.

Actual results:
The ds-replcheck tool is reporting an error ( Supplier does not have an RUV entry ).

Expected results:
ds-replcheck should provide the replication state.

Additional info:

Comment 3 mreynolds 2023-06-05 18:55:00 UTC
Upstream ticket:

https://github.com/389ds/389-ds-base/issues/5789

Comment 4 Têko Mihinto 2023-06-08 14:47:47 UTC
Things look better with RHEL 8.7. Customer was running RHEL 8.6 with 389-ds-base-1.4.3.29-3.

# cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.7 (Ootpa)
#

# rpm -qa 389-ds*
389-ds-base-1.4.3.31-11.module+el8dsrv+17815+4f95348d.x86_64
389-ds-base-legacy-tools-1.4.3.31-11.module+el8dsrv+17815+4f95348d.x86_64
389-ds-base-libs-1.4.3.31-11.module+el8dsrv+17815+4f95348d.x86_64
389-ds-base-debuginfo-1.4.3.31-11.module+el8dsrv+17815+4f95348d.x86_64
389-ds-base-debugsource-1.4.3.31-11.module+el8dsrv+17815+4f95348d.x86_64
#

Tested scenarios:
==================

1) Empty suffix:
# ds-replcheck --verbose state -D "cn=Directory Manager" -W -m ldap://localhost:2389 -r ldap://localhost:1389 -b "o=test"
Enter password: 
Connecting to servers...
Validating suffix ...
Error: Failed to validate suffix in localhost. o=test does not exist.
#

2) Created suffix top entry but did not reinitialize:
# ds-replcheck --verbose state -D "cn=Directory Manager" -W -m ldap://localhost:2389 -r ldap://localhost:1389 -b "o=test"
Enter password: 
Connecting to servers...
Validating suffix ...
Gathering Supplier's RUV...
Gathering Replica's RUV...
Getting Supplier's replica ID
Replication State: Replica ID (3000) not found in Replica's RUV (not initialized?)
#

3) Initialized one supplier from the other one:
# ds-replcheck --verbose state -D "cn=Directory Manager" -W -m ldap://localhost:2389 -r ldap://localhost:1389 -b "o=test"
Enter password: 
Connecting to servers...
Validating suffix ...
Gathering Supplier's RUV...
Gathering Replica's RUV...
Getting Supplier's replica ID
Replication State: Replica ID (3000) not found in Replica's RUV (not initialized?)
#

4) Changed the order in the CLI ( swapped values for options "-m" and "-r" )

# ds-replcheck --verbose state -D "cn=Directory Manager" -W -m ldap://localhost:1389 -r ldap://localhost:2389 -b "o=test"
Enter password: 
Connecting to servers...
Validating suffix ...
Gathering Supplier's RUV...
Gathering Replica's RUV...
Getting Supplier's replica ID
Replication State: Replica is behind Supplier by: 158 seconds
#

Comment 5 mreynolds 2023-06-08 15:51:56 UTC
Move improvements were to the logging/error handling.  Fixed upstream