Bug 2184599 - Disabling replication on Consumer crashes server
Summary: Disabling replication on Consumer crashes server
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Directory Server
Classification: Red Hat
Component: cockpit-389-ds
Version: 12.2
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: DS12.3
: dirsrv-12.3
Assignee: Pierre Rogier
QA Contact: LDAP QA Team
URL:
Whiteboard: sync-to-jira
Depends On:
Blocks: 2186259 2186260 2186262
TreeView+ depends on / blocked
 
Reported: 2023-04-05 07:03 UTC by bsmejkal
Modified: 2023-08-15 12:16 UTC (History)
5 users (show)

Fixed In Version: redhat-ds-12-9030020230711000312-1674d57
Doc Type: Bug Fix
Doc Text:
Fixed a Null pointer exception while Disabling a replica
Clone Of:
: 2186259 (view as bug list)
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 5743 0 None open BZ 2184599 - Disabling replication crashes the server 2023-04-27 13:52:08 UTC
Red Hat Issue Tracker IDMDS-2938 0 None None None 2023-04-12 15:13:46 UTC
Red Hat Issue Tracker IDMDS-3538 0 None None None 2023-08-09 10:17:00 UTC

Description bsmejkal 2023-04-05 07:03:35 UTC
Description of problem:
If replication is enabled as Consumer role and disabled after enabling, the server crashes.

Version-Release number of selected component (if applicable):
389-ds-base-2.2.7-1.module+el9dsrv+18376+e226feec.x86_64
cockpit-389-ds-2.2.7-1.module+el9dsrv+18376+e226feec.noarch

How reproducible:
Always

Steps to Reproduce:
1. Create instance with database
2. Enable replication for the suffix and choose Consumer as role
3. Click on Disable button in Replication tab and confirm.

Actual results:
Failed to disable replication for "dc=example,dc=com" - Can't contact LDAP server

Expected results:


Additional info:
Apr 05 02:44:46 rhds12.example.com ns-slapd[10169]: [05/Apr/2023:02:44:46.977437301 -0400] - WARN - NSMMReplicationPlugin - replica_config_delete - The changelog for replica dc=example,dc=com is no longer valid since th…ing the changelog.
Apr 05 02:44:47 rhds12.example.com systemd-coredump[10230]: [🡕] Process 10169 (ns-slapd) of user 389 dumped core.
Apr 05 02:44:47 rhds12.example.com systemd[1]: dirsrv: Main process exited, code=dumped, status=11/SEGV
Apr 05 02:44:47 rhds12.example.com systemd[1]: dirsrv: Failed with result 'core-dump'.
Apr 05 02:44:47 rhds12.example.com systemd[1]: dirsrv: Consumed 1.113s CPU time.

Comment 1 thierry bordaz 2023-04-05 07:39:32 UTC
Easy to reproduce on main:

dsconf standalone1 replication enable --suffix 'dc=example,dc=com' --role consumer 
Replication successfully enabled for "dc=example,dc=com"

dsconf standalone1 replication disable --suffix 'dc=example,dc=com'
Error: -1 - Can't contact LDAP server - [] - delete_ext_s(('cn=replica,cn=dc\\3Dexample\\2Cdc\\3Dcom,cn=mapping tree,cn=config',),{'serverctrls': None, 'clientctrls': None, 'escapehatch': 'i am sure'}) on instance standalone1


(gdb) where
#0  0x00007ffb96565ae2 in cldb_RemoveReplicaDB (replica=0x7ffb46229000) at ldap/servers/plugins/replication/cl5_api.c:368
#1  0x00007ffb965945d8 in replica_config_delete
    (pb=<optimized out>, e=<optimized out>, entryAfter=<optimized out>, returncode=0x7ffb4adfc880, returntext=<optimized out>, arg=<optimized out>)
    at ldap/servers/plugins/replication/repl5_replica_config.c:748
#2  0x00007ffb9819d602 in dse_call_callback.isra.0
    (pb=0x7ffb41e00000, operation=32, flags=1, entryBefore=0x7ffb41e14000, entryAfter=0x0, returncode=0x7ffb4adfc880, returntext=0x7ffb4adfc8d0 "", pdse=<optimized out>, pdse=<optimized out>) at ldap/servers/slapd/dse.c:2714
#3  0x00007ffb9810a0f3 in dse_delete (pb=0x7ffb41e00000) at ldap/servers/slapd/dse.c:2567
#4  0x00007ffb9810345c in op_shared_delete (pb=pb@entry=0x7ffb41e00000) at ldap/servers/slapd/delete.c:338
#5  0x00007ffb981036e8 in do_delete (pb=pb@entry=0x7ffb41e00000) at ldap/servers/slapd/delete.c:97
#6  0x000055d04ea22462 in connection_dispatch_operation (pb=0x7ffb41e00000, op=<optimized out>, conn=<optimized out>) at ldap/servers/slapd/connection.c:643
#7  connection_threadmain (arg=<optimized out>) at ldap/servers/slapd/connection.c:1805
#8  0x00007ffb983e97b4 in _pt_root () at /lib64/libnspr4.so
#9  0x00007ffb97c9f822 in start_thread () at /lib64/libc.so.6
#10 0x00007ffb97c3f450 in clone3 () at /lib64/libc.so.6

Comment 4 Viktor Ashirov 2023-08-15 12:16:09 UTC
Automated tests passed:
=============================================================================================== test session starts ================================================================================================
platform linux -- Python 3.9.17, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
389-ds-base: 2.3.5-1.module+el9dsrv+19320+04706864
nss: 3.90.0-2.el9_2
nspr: 4.35.0-2.el9_2
openldap: 2.6.3-1.el9
cyrus-sasl: not installed
FIPS: disabled
rootdir: /root/ds/dirsrvtests, configfile: pytest.ini
collected 12 items

replica_roles_test.py::test_switching_roles[None-supplier] PASSED                                                                                                                                            [  8%]
replica_roles_test.py::test_switching_roles[None-hub] PASSED                                                                                                                                                 [ 16%]
replica_roles_test.py::test_switching_roles[None-consumer] PASSED                                                                                                                                            [ 25%]
replica_roles_test.py::test_switching_roles[supplier-None] PASSED                                                                                                                                            [ 33%]
replica_roles_test.py::test_switching_roles[supplier-hub] PASSED                                                                                                                                             [ 41%]
replica_roles_test.py::test_switching_roles[supplier-consumer] PASSED                                                                                                                                        [ 50%]
replica_roles_test.py::test_switching_roles[hub-None] PASSED                                                                                                                                                 [ 58%]
replica_roles_test.py::test_switching_roles[hub-supplier] PASSED                                                                                                                                             [ 66%]
replica_roles_test.py::test_switching_roles[hub-consumer] PASSED                                                                                                                                             [ 75%]
replica_roles_test.py::test_switching_roles[consumer-None] PASSED                                                                                                                                            [ 83%]
replica_roles_test.py::test_switching_roles[consumer-supplier] PASSED                                                                                                                                        [ 91%]
replica_roles_test.py::test_switching_roles[consumer-hub] PASSED                                                                                                                                             [100%]

=============================================================================================== 12 passed in 37.06s ================================================================================================

Marking as VERIFIED.


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