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

misplaced entry after slapindex



Hi all,

I had a strange problem yesterday where an entry on the LDAP server
appeared to exist, but didn't always show when it was searched for.
My setup is:
    OpenLDAP 2.2.6
    LDBM backend with GDBM 1.8.3
    OpenSSL 0.9.6g
    Solaris 9 on SPARC

I encountered the problem when a script attempted to add an entry
to the LDAP server. The server replied with 'Already exists'. However,
some searches find the entry and others don't (when they should):


Here I look under ou=ethers,dc=science,dc=uva,dc=nl where the object
should reside:

% ldapsearch -x -b ou=ethers,dc=science,dc=uva,dc=nl 'cn=anton.science.uva.nl'
version: 2

#
# filter: cn=anton.science.uva.nl
# requesting: ALL
#

# search result
search: 2
result: 0 Success

# numResponses: 1



Then I search again, but one step higher in the tree (which happens to
be our suffix as well):

% ldapsearch -x -b dc=science,dc=uva,dc=nl 'cn=anton.science.uva.nl'
version: 2

#
# filter: cn=anton.science.uva.nl
# requesting: ALL
#

# anton.science.uva.nl, ethers, science, uva, nl
dn: cn=anton.science.uva.nl,ou=ethers,dc=science,dc=uva,dc=nl
objectClass: top
objectClass: fnwiCtrObject
objectClass: fnwiEther
objectClass: ieee802Device
objectClass: device
fnwiCtrId: 7710
macAddress: 00:0d:56:89:6c:98
cn: anton.science.uva.nl

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1


Repeating these searches caused the same result, so it was consistent.
I found that I could delete the entry, after which the problem was
gone (and the evidence as well).

I'm not sure what caused this, but shortly before doing this I had
rebuilt the index files as I had added some new index statements to
slapd.conf. I'd done the following:

    /etc/init.d/openldap stop
    /opt/openldap-server/sbin/slapindex -v \
	    -b dc=science,dc=uva,dc=nl \
	    -f /path/to/slapd.conf
    /etc/init.d/openldap start


Any ideas?

Kind regards,
Wout