Bug 2046341 - dsconf dump-changelog issues.
Summary: dsconf dump-changelog issues.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Directory Server
Classification: Red Hat
Component: 389-ds-base
Version: 11.4
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: DS11.5
: dirsrv-11.5
Assignee: mreynolds
QA Contact: RHDS QE
Marc Muehlfeld
URL:
Whiteboard: sync-to-jira
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-26 16:08 UTC by Têko Mihinto
Modified: 2022-05-11 16:28 UTC (History)
4 users (show)

Fixed In Version: redhat-ds-11-8060020220325145233.fd2afb17
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-11 16:28:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker IDMDS-1987 0 None None None 2022-02-07 13:37:42 UTC
Red Hat Issue Tracker IDMDS-2144 0 None None None 2022-03-25 14:29:09 UTC
Red Hat Product Errata RHSA-2022:2210 0 None None None 2022-05-11 16:28:30 UTC

Description Têko Mihinto 2022-01-26 16:08:25 UTC
Description of problem:
The dsconf command to export the replication changelog is failing due to a missing Python module ( logging ).

Version-Release number of selected component (if applicable):
$  cat /etc/redhat-release
Red Hat Enterprise Linux release 8.5 (Ootpa)
$
$ rpm -qa | grep 389
cockpit-389-ds-1.4.3.27-2.module+el8dsrv+12690+c6df6d1b.noarch
389-ds-base-1.4.3.27-2.module+el8dsrv+12690+c6df6d1b.x86_64
python3-lib389-1.4.3.27-2.module+el8dsrv+12690+c6df6d1b.noarch
389-ds-base-libs-1.4.3.27-2.module+el8dsrv+12690+c6df6d1b.x86_64
$

How reproducible:
Always.

Steps to Reproduce:
1. Run the export command.
Eg:
$ dsconf --verbose -D "cn=Directory Manager" ldaps://localhost:636 replication dump-changelog -o /tmp/changelog.ldif
2. Check the output
3. Add the missing import and retry ==> success

Actual results:
The export command fails.

Expected results:
Command should work.

Additional info:
Hereunder is the list of issues.

1) The "logging" module is missing:

$ dsconf --verbose -D "cn=Directory Manager" ldaps://localhost:636 replication dump-changelog -o /tmp/changelog.ldif
DEBUG: The 389 Directory Server Configuration Tool
...
DEBUG: Retrieved entry [dn:
vendorVersion: 389-Directory/1.4.3.27 B2021.263.1550

]
DEBUG: name 'logging' is not defined
Traceback (most recent call last):
  File "/usr/sbin/dsconf", line 134, in <module>
    result = args.func(inst, None, log, args)
  File "/usr/lib/python3.6/site-packages/lib389/cli_conf/replication.py", line 1082, in dump_cl
    fh = logging.FileHandler(args.output_file, mode='w')
NameError: name 'logging' is not defined
ERROR: Error: name 'logging' is not defined
$


Once the file is edited to import the missing module, the command works fine:

$ dsconf -D "cn=Directory Manager" ldaps://localhost:636 replication dump-changelog -o /tmp/changelog.ldif
Enter password for cn=Directory Manager on ldaps://localhost:636:
...
# Replica Root: dc=example,dc=com
# LDIF File: /var/lib/dirsrv/slapd-<INSTANCE>/changelogdb/XXX.ldif

changetype: add
replgen: 60411dc0000000010000
csn: 60411e8d000000010000
...
$

2) When using the option "-o ", the custom output file will still refer to the default (non-existing) LDIF file(s):

$ dsconf -D "cn=Directory Manager" ldaps://localhost:636 replication dump-changelog -o /tmp/changelog.ldif
...
# LDIF File: /var/lib/dirsrv/slapd-<INSTANCE>/changelogdb/99ead603-7b4b11eb-85ced62f-d1e2ee00.ldif
...
$

$ ll /var/lib/dirsrv/slapd-<INSTANCE>/changelogdb/ |  grep -c ldif
0
$
$ file /tmp/changelog.ldif
/tmp/changelog.ldif: ASCII text
$ wc -l /tmp/changelog.ldif
88 /tmp/changelog.ldif
$
$ grep LDIF /tmp/changelog.ldif
# LDIF File: /var/lib/dirsrv/slapd-<INSTANCE>/changelogdb/99ead603-7b4b11eb-85ced62f-d1e2ee00.ldif
# LDIF File: /var/lib/dirsrv/slapd-<INSTANCE>/changelogdb/43d77b83-f07411eb-a1e8d62f-d1e2ee00.ldif
$

3) The last line in the output file is "Command successful."
I think it should be commented:

$ tail -5 /tmp/changelog.ldif
-

# Replica Root: dc=test,dc=com
# LDIF File: /var/lib/dirsrv/slapd-<INSTANCE>/changelogdb/43d77b83-f07411eb-a1e8d62f-d1e2ee00.ldif
Command successful.
$

Comment 1 mreynolds 2022-03-19 03:35:05 UTC
Upstream ticket:

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

Comment 4 sgouvern 2022-04-20 14:53:50 UTC
With 389-ds-base-1.4.3.29-3.module+el8dsrv+14615+a86efbbf.x86_64

running # dsconf --verbose -D "cn=directory manager" -w secret12 inst1 replication dump-changelog -o /tmp/changelog.ldif

1. No more missing python module, the command works

2. The LDIF file mentionned is the one set with the -o option :  
                  # LDIF File: /tmp/changelog.ldif

3. There is no more 'Command successful' mentionned at the end of the output ldif file


=> marking as verified

Comment 6 errata-xmlrpc 2022-05-11 16:28:24 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: redhat-ds:11 security and bug fix 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-2022:2210


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