Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ns-slapd - Crash when using bak2db.pl to restore a single database. #3122

Closed
389-ds-bot opened this issue Sep 13, 2020 · 6 comments
Closed
Labels
closed: fixed Migration flag - Issue

Comments

@389-ds-bot
Copy link

Cloned from Pagure issue: https://pagure.io/389-ds-base/issue/50063


Ticket was cloned from Red Hat Bugzilla (product Red Hat Enterprise Linux 7): Bug 1601241

Description of problem:

RHDS is crashing when trying to use bak2db.pl to restore a single database.


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

# rpm -qa | grep 389-ds-base
389-ds-base-libs-1.3.7.5-24.el7_5.x86_64
389-ds-base-debuginfo-1.3.7.5-24.el7_5.x86_64
389-ds-base-1.3.7.5-24.el7_5.x86_64
#

How reproducible:

Always.

Steps to Reproduce:

1. Start the RHDS instance
# ulimit -c unlimited ; systemctl start dirsrv@<INSTANCE_NAME>

2. Try to restore a single database using bak2db.pl:
# bak2db.pl -Z <INSTANCE_NAME> -D "cn=Directory Manager" -w <PASSWORD> -P LDAP
-a
/var/lib/dirsrv/slapd-<INSTANCE_NAME>/bak/<INSTANCE_NAME>-2018_7_13_15_48_40/
-n userRoot
Successfully added task entry "cn=restore_2018_7_13_18_13_18, cn=restore,
cn=tasks, cn=config"
#


RHDS errors log:
++++++++++++++++++++++++++++++++++++++++++++++++
[13/Jul/2018:18:13:18.414783645 +0200] - INFO - task_restore_thread - Beginning
restore to 'ldbm database'
[13/Jul/2018:18:13:18.418211871 +0200] - INFO - ldbm_back_archive2ldbm -
Bringing userRoot offline...
...
[13/Jul/2018:18:13:18.427815303 +0200] - INFO - dblayer_pre_close - Waiting for
4 database threads to stop
[13/Jul/2018:18:13:18.980252957 +0200] - INFO - dblayer_pre_close - All
database threads now stopped
[13/Jul/2018:18:13:18.994927840 +0200] - NOTICE - dblayer_delete_database_ex -
Skipping instance TekoData
...
++++++++++++++++++++++++++++++++++++++++++++++++


3. A search will fail indicating that the server is down:
# ldapsearch -o ldif-wrap=no -xLLL  -p <PORT> -h <HOST> -b "dc=TekoSoft,dc=com"
-D"cn=Directory Manager" -w <PASSWORD> -sbase 1.1
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
#


Actual results:

ns-slapd crashed.

Stack trace is:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/usr/sbin/ns-slapd -D /etc/dirsrv/slapd-<INSTANCE> -i
/var/run/dirsrv/slapd-inst'.
Program terminated with signal 11, Segmentation fault.
0  __opendirat (dfd=dfd@entry=-100, name=name@entry=0x0) at
../sysdeps/posix/opendir.c:90
90      if (__builtin_expect (name[0], '\1') == '\0')
(gdb)
(gdb) where
0  0x00007fcedff6ca10 in __opendirat (dfd=dfd@entry=-100, name=name@entry=0x0)
at ../sysdeps/posix/opendir.c:90
1  0x00007fcedff6ca6d in __opendir (name=name@entry=0x0) at
../sysdeps/posix/opendir.c:159
2  0x00007fcee0f5c81c in PR_OpenDir (name=0x0) at
../../../nspr/pr/src/pthreads/ptio.c:3840
3  0x00007fced6c54754 in dblayer_delete_database_ex
(li=li@entry=0x55970f1d5900, instance=instance@entry=0x55970f595ee0 "userRoot",
cldir=0x0) at ldap/servers/slapd/back-ldbm/dblayer.c:5228
4  0x00007fced6c54e57 in dblayer_restore (li=0x55970f1d5900,
src_dir=0x55970faff270
"/var/lib/dirsrv/slapd-<INSTANCE>/bak/<INSTANCE>-2018_7_13_15_48_40",
task=0x55970fb31ea0, bename=0x55970f595ee0 "userRoot")
    at ldap/servers/slapd/back-ldbm/dblayer.c:6525
5  0x00007fced6c468dd in ldbm_back_archive2ldbm (pb=0x55970f59ec60) at
ldap/servers/slapd/back-ldbm/archive.c:165
6  0x00007fcee31cea86 in task_restore_thread (arg=0x55970f59ec60) at
ldap/servers/slapd/task.c:1622
7  0x00007fcee0f5dbab in _pt_root (arg=0x55970fb27680) at
../../../nspr/pr/src/pthreads/ptthread.c:201
8  0x00007fcee08fddd5 in start_thread (arg=0x7fceb439d700) at
pthread_create.c:308
9  0x00007fcedffaab3d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:113
(gdb)


Expected results:

ns-slapd should not crash.

Additional info:

The script bak2db.pl should not be used to restore a single database, but it also should not crash the server

@389-ds-bot 389-ds-bot added the closed: fixed Migration flag - Issue label Sep 13, 2020
@389-ds-bot
Copy link
Author

Comment from mreynolds (@mreynolds389) at 2018-11-30 17:44:43

Metadata Update from @mreynolds389:

@389-ds-bot
Copy link
Author

Comment from mreynolds (@mreynolds389) at 2018-11-30 18:26:10

Metadata Update from @mreynolds389:

  • Issue assigned to mreynolds389

@389-ds-bot
Copy link
Author

389-ds-bot commented Sep 13, 2020

Comment from mreynolds (@mreynolds389) at 2018-11-30 18:26:25

#3123

@389-ds-bot
Copy link
Author

Comment from mreynolds (@mreynolds389) at 2018-11-30 18:26:26

Metadata Update from @mreynolds389:

  • Custom field component adjusted to None
  • Custom field origin adjusted to None
  • Custom field reviewstatus adjusted to None
  • Custom field type adjusted to None
  • Custom field version adjusted to None

@389-ds-bot
Copy link
Author

Comment from mreynolds (@mreynolds389) at 2018-12-20 17:53:40

Metadata Update from @mreynolds389:

  • Issue close_status updated to: fixed
  • Issue status updated to: Closed (was: Open)

@389-ds-bot
Copy link
Author

Comment from vashirov (@vashirov) at 2020-02-12 17:33:42

Metadata Update from @vashirov:

  • Issue set to the milestone: None (was: 0.0 NEEDS_TRIAGE)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: fixed Migration flag - Issue
Projects
None yet
Development

No branches or pull requests

1 participant