Bug 2109490 - regression, backport issue 5353 to RHDS-11 - CLI - dsconf backend export breaks with multiple backends
Summary: regression, backport issue 5353 to RHDS-11 - CLI - dsconf backend export brea...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Directory Server
Classification: Red Hat
Component: 389-ds-base
Version: 11.5
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
: dirsrv-11.6
Assignee: mreynolds
QA Contact: RHDS QE
Zuzana Zoubkova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-21 11:41 UTC by Marc Sauton
Modified: 2022-11-14 08:53 UTC (History)
10 users (show)

Fixed In Version: redhat-ds-11-8070020221019193157-95958119
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-14 08:53:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker IDMDS-2479 0 None None None 2022-08-30 08:25:37 UTC
Red Hat Issue Tracker IDMDS-2482 0 None None None 2022-08-30 08:32:16 UTC
Red Hat Product Errata RHBA-2022:7929 0 None None None 2022-11-14 08:53:41 UTC

Description Marc Sauton 2022-07-21 11:41:21 UTC
Description of problem:

Need to backport fix from issue 5353 - CLI - dsconf backend export breaks with multiple backends
  https://github.com/389ds/389-ds-base/issues/5353
  https://github.com/389ds/389-ds-base/commit/93ff55814ef6a564976aa4c0c5623db0f1a543d8
into RHDS-11.5

"regression" / works in RHDS-11.4


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

RHDS-11.5
389-ds-base-1.4.3.29-3.module+el8dsrv+14615+a86efbbf.x86_64.rpm

fails with RHDS-11.5 / 389-ds-base-1.4.3.29-3.module+el8dsrv+14615+a86efbbf.x86_64
works with RHDS-11.4 / 389-ds-base-1.4.3.27-2.module+el8dsrv+12690+c6df6d1b.x86_64


How reproducible:
on demand


Steps to Reproduce:
1. have RHDS instance with multiple backends, for example, "archive" and a "userRoot" with a capital / upper case R

dn: cn=o\3Darchive,cn=mapping tree,cn=config
objectClass: top
objectClass: extensibleObject
objectClass: nsMappingTree
cn: o=archive
cn: o\=archive
nsslapd-state: backend
nsslapd-backend: archive

dn: cn=o\3Dexample.test,cn=mapping tree,cn=config
objectClass: top
objectClass: extensibleObject
objectClass: nsMappingTree
cn: o=example.test
cn: o\=example.test
nsslapd-state: backend
nsslapd-backend: userRoot


2. dsconf m1 backend export userRoot -U -l /var/lib/dirsrv/slapd-m1/ldif/userRoot.ldif


Actual results:

DEBUG: Allocate <class 'lib389.DirSrv'> with localhost:None
DEBUG: open(): Connecting to uri ldap://localhost
DEBUG: open(): bound as cn=directory manager
DEBUG: Retrieving entry with [('',)]
DEBUG: Retrieved entry [dn: 
vendorVersion: 389-Directory/1.4.3.29 B2022.087.1507

]
DEBUG: list filter = (&(objectclass=nsBackendInstance))
DEBUG: cn=archive,cn=ldbm database,cn=plugins,cn=config getVal('cn')
DEBUG: cn=archive,cn=ldbm database,cn=plugins,cn=config getVal('nsslapd-suffix')
DEBUG: 
Traceback (most recent call last):
  File "/usr/sbin/dsconf", line 138, in <module>
    result = args.func(inst, None, log, args)
  File "/usr/lib/python3.6/site-packages/lib389/cli_conf/backend.py", line 288, in backend_export
    dn = _search_backend_dn(inst, be_name)
  File "/usr/lib/python3.6/site-packages/lib389/cli_conf/backend.py", line 98, in _search_backend_dn
    if cn == del_be_name or str2dn(suffix) == str2dn(del_be_name):
  File "/usr/lib64/python3.6/site-packages/ldap/dn.py", line 52, in str2dn
    return ldap.functions._ldap_function_call(None,_ldap.str2dn,dn,flags)
  File "/usr/lib64/python3.6/site-packages/ldap/functions.py", line 55, in _ldap_function_call
    result = func(*args,**kwargs)
ldap.DECODING_ERROR
ERROR: Error: 


Expected results:


Additional info:

"regression":
fails with RHDS-11.5 / 389-ds-base-1.4.3.29-3.module+el8dsrv+14615+a86efbbf.x86_64
works with RHDS-11.4 / 389-ds-base-1.4.3.27-2.module+el8dsrv+12690+c6df6d1b.x86_64

Comment 7 Akshay Adhikari 2022-10-06 12:57:36 UTC
Build tested: 

Steps:

1) Created two backends

dsconf -D "cn=Directory Manager" ldap://`hostname` backend create --suffix="dc=example,dc=net" --be-name="example"
dsconf -D "cn=Directory Manager" ldap://`hostname` backend create --suffix="dc=example,dc=com" --be-name="userroot"

2) List backends so confirm

# dsconf -D "cn=Directory Manager" ldap://`hostname` backend suffix list

3) Perform an export operation

dsconf test backend export userroot -U -l /var/lib/dirsrv/slapd-test/ldif/userRoot.ldif
The export task has finished successfully

dsconf is not breaking, Marking it as VERIFIED.

Comment 8 Akshay Adhikari 2022-10-06 12:58:30 UTC
Build Tested: 389-ds-base-1.4.3.31-5.module+el8dsrv+16686+3df5ff63.x86_64

Comment 9 mreynolds 2022-10-13 15:30:30 UTC
Regression found when enabling replication, fixed upstream via https://github.com/389ds/389-ds-base/pull/5485

Comment 11 Jamie Chapman 2022-11-07 15:15:16 UTC
Verified bug with the following parameters:

RHDS 11 package
389-ds-base-1.4.3.31-6.module+el8dsrv+16980+c4b9cd33
https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=2217285

Steps:
1) Created multiple  backends
dsconf -D "cn=Directory Manager" -w password  ldap://`hostname` backend create --suffix="dc=example,dc=net" --be-name="example"
dsconf -D "cn=Directory Manager" -w password  ldap://`hostname` backend create --suffix="dc=example,dc=com" --be-name="userroot"
dsconf -D "cn=Directory Manager" -w password  ldap://`hostname` backend create --suffix="dc=example,dc=test" --be-name="testRoot""

2) List backends to confirm
dsconf -D "cn=Directory Manager" -w password ldap://`hostname` backend suffix list
dc=example,dc=com (userroot)
dc=example,dc=net (example)
dc=example,dc=test (testroot)

3) Perform an export operation on each be
dsconf localhost  backend export userroot -U -l /var/lib/dirsrv/slapd-localhost/ldif/userRoot.ldif
The export task has finished successfully

dsconf localhost  backend export example -U -l /var/lib/dirsrv/slapd-localhost/ldif/example.ldif
The export task has finished successfully

dsconf localhost  backend export testRoot  -U -l /var/lib/dirsrv/slapd-localhost/ldif/testRoot.ldif
The export task has finished successfully

Setting to verified

Comment 13 errata-xmlrpc 2022-11-14 08:53:14 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 (redhat-ds:11 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:7929


Note You need to log in before you can comment on or make changes to this bug.