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.
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
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.