389ds / 389-ds-base

The enterprise-class Open Source LDAP server for Linux
https://www.port389.org/
Other
212 stars 91 forks source link

bdb2mdb shows errors #6064

Closed vashirov closed 3 weeks ago

vashirov commented 8 months ago

Issue Description On an instance without replication set up, bdb2mdb shows errors about missing replication_changelog.db:

[root@fedora ~]# dsctl localhost dblib bdb2mdb 
cleanup dbmapdir=/var/lib/dirsrv/slapd-localhost/db dbhome=/dev/shm/slapd-localhost dblib=bdb
Required space for LDIF files is about 24.0 KB
Required space for DBMAP files is about 240.0 KB
Required number of dbi is 128
Backends exportation 0.000000% (userroot)
ldiffile: /var/lib/dirsrv/slapd-localhost/ldif/__dblib-userroot.ldif
run_dbscan failed: cmd is ['/bin/dbscan', '-D', 'bdb', '-f', '/var/lib/dirsrv/slapd-localhost/db/userroot/replication_changelog.db', '-X', '/var/lib/dirsrv/slapd-localhost/ldif/__dblib-userroot.cl5.dbtxt'] return code is 1 output is Can't initialize db plugin: bdb

Command '['/bin/dbscan', '-D', 'bdb', '-f', '/var/lib/dirsrv/slapd-localhost/db/userroot/replication_changelog.db', '-X', '/var/lib/dirsrv/slapd-localhost/ldif/__dblib-userroot.cl5.dbtxt']' returned non-zero exit status 1.
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/lib389/cli_ctl/dblib.py", line 152, in run_dbscan
    output = subprocess.check_output(args, encoding='utf-8', stderr=subprocess.STDOUT)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/bin/dbscan', '-D', 'bdb', '-f', '/var/lib/dirsrv/slapd-localhost/db/userroot/replication_changelog.db', '-X', '/var/lib/dirsrv/slapd-localhost/ldif/__dblib-userroot.cl5.dbtxt']' returned non-zero exit status 1.
Backends exportation 100%
Updating dse.ldif file
Backends importation 0.000000% (userroot)
Backends importation 100%
Error: 97 - 1 - 53 - Server is unwilling to perform - [] - Unauthenticated binds are not allowed

But the instance is actually running:

[root@fedora ~]# dsctl localhost status
Instance "localhost" is running

On an instance with replication enabled the message about unathenticated binds is still displayed:

[root@fedora ~]# dsctl localhost dblib bdb2mdb
cleanup dbmapdir=/var/lib/dirsrv/slapd-localhost/db dbhome=/dev/shm/slapd-localhost dblib=bdb
Required space for LDIF files is about 24.0 KB
Required space for DBMAP files is about 278.4 KB
Required number of dbi is 128
Backends exportation 0.000000% (userroot)
ldiffile: /var/lib/dirsrv/slapd-localhost/ldif/__dblib-userroot.ldif
Backends exportation 100%
Updating dse.ldif file
Backends importation 0.000000% (userroot)
Backends importation 100%
Error: 97 - 1 - 53 - Server is unwilling to perform - [] - Unauthenticated binds are not allowed

Package Version and Platform:

Steps to Reproduce Steps to reproduce the behavior:

  1. Create and instance with BDB
  2. dsctl instance_name dblib bdb2mdb
  3. See error

Expected results Errors about missing files should be handled gracefully, especially in a situation where these files are missing for a reason (replication is not set up). bdb2mdb tool should report about the overall status of migration, if it was successful or not. It's hard to judge from the output, since it shows "scary" errors such as "Server is unwilling to perform" or dbscan failures.

progier389 commented 1 week ago

b0fc4684d..c1b842eaf main -> main f51cd0157..795fd0572 389-ds-base-3.0 -> 389-ds-base-3.0