[Date Prev][Date Next] [Chronological] [Thread] [Top]

slapadd hanging initializing mdb backend



When I try to slapadd initial data into an empty mdb backend, the slapadd hangs:

$ /tmp/openldap-2.4.31/sbin/slapadd -w -S 1 -c -F /tmp/openldap-2.4.31/etc/slapd.d -b dc=example,dc=com -l /tmp/openldap-2.4.31/etc/initdb.ldif
_#################### 100.00% etaÂÂ none elapsedÂÂÂÂÂÂÂÂÂÂÂ none fast!
(does not return to a shell prompt. I have to INT it.)

I add '-d -1' to get some debugging output and I get this after removing the data.mdb and lock.mdb created above:

$ /tmp/openldap-2.4.31/sbin/slapadd -d -1 -w -S 1 -c -F /tmp/openldap-2.4.31/etc/slapd.d -b dc=example,dc=com -l /tmp/openldap-2.4.31/etc/initdb.ldif
(lines removed for brevity but can be submitted if need be)
4f9ea9c0 => str2entry: "dn: ou=Users,dc=example,dc=com
objectClass: organizationalUnit
ou: Users
"
4f9ea9c0 >>> dnPrettyNormal: <ou=Users,dc=example,dc=com>
4f9ea9c0 <<< dnPrettyNormal: <ou=Users,dc=example,dc=com>, <ou=users,dc=example,dc=com>
4f9ea9c0 <= str2entry(ou=Users,dc=example,dc=com) -> 0x6afeba8
4f9ea9c0 oc_check_required entry (ou=Users,dc=example,dc=com), objectClass "organizationalUnit"
4f9ea9c0 oc_check_allowed type "objectClass"
4f9ea9c0 oc_check_allowed type "ou"
4f9ea9c0 oc_check_allowed type "structuralObjectClass"
4f9ea9c0 => mdb_tool_entry_put( -1, "ou=Users,dc=example,dc=com" )
4f9ea9c0 => mdb_dn2id("ou=users,dc=example,dc=com")
4f9ea9c0 <= mdb_dn2id: get failed: MDB_NOTFOUND: No matching key/data pair found (-30798)
4f9ea9c0 => mdb_dn2id_add 0x6: "ou=users,dc=example,dc=com"
4f9ea9c0 <= mdb_dn2id_add 0x6: 0
4f9ea9c0 => index_entry_add( 6, "ou=Users,dc=example,dc=com" )
4f9ea9c0 mdb_idl_insert_keys: 6 [9bee355f]
4f9ea9c0 mdb_idl_insert_keys: 6 [ef1184ca]
4f9ea9c0 mdb_idl_insert_keys: 6
4f9ea9c0 <= index_entry_add( 6, "ou=Users,dc=example,dc=com" ) success
4f9ea9c0 => mdb_entry_encode(0x00000006): ou=Users,dc=example,dc=com
4f9ea9c0 <= mdb_entry_encode(0x00000006): ou=Users,dc=example,dc=com
4f9ea9c0 => mdb_dn2id("dc=example,dc=com")
4f9ea9c0 <= mdb_dn2id: got id=0x1
4f9ea9c0 => mdb_entry_decode:
4f9ea9c0 <= mdb_entry_decode
4f9ea9c0 => mdb_tool_entry_modify( 1, "(null)" )
(it's hung)

Here is the /tmp/openldap-2.4.31/etc/initdb.ldif:

### BEGIN INITDB.LDIF
dn: dc=example,dc=com
objectClass: organization
objectClass: dcObject
dc: example
o: example.com

dn: cn=manager,dc=example,dc=com
objectClass: organizationalRole
objectClass: simpleSecurityObject
cn: manager
userPassword: {SSHA}asif

dn: cn=replicator,dc=example,dc=com
objectClass: organizationalRole
objectClass: simpleSecurityObject
cn: replicator
userPassword: {SSHA}asif

dn: ou=Groups,dc=example,dc=com
objectClass: organizationalUnit
ou: Groups

dn: cn=LDAP Admins,ou=Groups,dc=example,dc=com
objectClass: top
objectClass: groupOfUniqueNames
cn: LDAP Admins
uniqueMember: cn=manager,dc=example,dc=com

dn: ou=Users,dc=example,dc=com
objectClass: organizationalUnit
ou: Users

### END INITDB.LDIF

I used the following slaptest commands to create the initial slapd.d/ directory from a slapd.conf file:
$ /tmp/openldap-2.4.31/sbin/slaptest -u -f /tmp/openldap-2.4.31/etc/slapd.conf -F /tmp/openldap-2.4.31/etc/slapd.d
config file testing succeeded
$ /tmp/openldap-2.4.31/sbin/slaptest -f /tmp/openldap-2.4.31/etc/slapd.conf -F /tmp/openldap-2.4.31/etc/slapd.d
4f9eab15 mdb_db_open: database "dc=example,dc=com" cannot be opened, err 2. Restore from backup!
4f9eab15 backend_startup_one (type=mdb, suffix="dc=example,dc=com"): bi_db_open failed! (2)
slap_startup failed (test would succeed using the -u switch)

Here is the /tmp/openldap-2.4.31/etc/slapd.conf:

### BEGIN SLAPD.CONF
include /tmp/openldap-2.4.31/etc/schema/core.schema
include /tmp/openldap-2.4.31/etc/schema/cosine.schema
include /tmp/openldap-2.4.31/etc/schema/nis.schema
include /tmp/openldap-2.4.31/etc/schema/inetorgperson.schema

argsfile /tmp/openldap-2.4.31/var/run/slapd.args
pidfile /tmp/openldap-2.4.31/var/run/slapd.pid
threads 8
tool-threads 2
idletimeout 0
writetimeout 0
reverse-lookup off
loglevel stats

serverid 1 ldap://boardwalk:2389

modulepath /tmp/openldap-2.4.31/libexec
moduleload back_monitor.la
moduleload back_mdb.la
moduleload syncprov.la

password-hash {SSHA}
sizelimit unlimited

database config
rootdn "cn=manager,dc=example,dc=com"
access to *
 by group="cn=LDAP Admins,ou=Groups,dc=example,dc=com" write
 by users read
 by * none

database monitor
rootdn "cn=manager,dc=example,dc=com"
access to *
 by users read
 by * none

database mdb
suffix "dc=example,dc=com"
rootdn "cn=manager,dc=example,dc=com"
directory /tmp/openldap-2.4.31/var/data

index objectClass eq
index entryCSN eq
index entryUUID eq

syncrepl rid=001
 provider=ldap://boardwalk:2389
 type=refreshAndPersist
 retry="15 +"
 bindmethod=simple
 binddn="cn=replicator,dc=example,dc=com"
 credentials="asif"
 searchbase="dc=example,dc=com"
 starttls=no
 schemachecking=off

syncrepl rid=002
 provider=ldap://chance:2389
 type=refreshAndPersist
 retry="15 +"
 bindmethod=simple
 binddn="cn=replicator,dc=example,dc=com"
 credentials="asif"
 searchbase="dc=example,dc=com"
 starttls=no
 schemachecking=off

syncrepl rid=003
 provider=ldap://freeparking:2389
 type=refreshAndPersist
 retry="15 +"
 bindmethod=simple
 binddn="cn=replicator,dc=example,dc=com"
 credentials="asif"
 searchbase="dc=example,dc=com"
 starttls=no
 schemachecking=off
mirrormode TRUE

overlay syncprov
syncprov-checkpoint 50 10
syncprov-sessionlog 100

access to attrs=userPassword
 by anonymous auth
 by self write
 by dn.exact="cn=replicator,dc=example,dc=com" read
 by * none

access to *
 by group="cn=LDAP Admins,ou=Groups,dc=example,dc=com" write
 by dn.exact="cn=replicator,dc=example,dc=com" read
 by users read
 by * none

limits dn.exact="cn=replicator,dc=example,dc=com"
 time.soft=unlimited time.hard=unlimited
 size.soft=unlimited size.hard=unlimited

### END SLAPD.CONF


I compiled from the following source:
OpenLDAP 2.4.31
OpenSSL 1.0.1b
Cyrus-SASL 2.1.25

I am running in the following environment:
Dell Poweredge 2950; dual-core Intel(R) Xeon(R) CPU 5110Â @ 1.60GHz; 8GB RAM
Scientific Linux 5.7

Am I doing something wrong (besides the ACLs for cn=LDAP Admins,ou=Groups,dc=example,dc=com. I'm still struggling there) ?

Thank you,
Mark