20121220

openldap: bdb_equality_candidates: (uidNumber) not indexed

This article was a big help

Tested on Debian v6.0.6


  1. Stop the LDAP server:
    /etc/init.d/slapd stop
  2. Open the right OpenLDAP config file with an editor:
    vi /etc/ldap/slapd.d/cn\=config/olcDatabase\=\{1\}hdb.ldif
  3. Add new lines (after the one with olcDbIndex: objectClass eq in it) for the missing indexes. Eg.:
    olcDbIndex: cn eq
    olcDbIndex: gidNumber eq
    olcDbIndex: memberUid eq
    olcDbIndex: uid eq
    olcDbIndex: uidNumber eq
    olcDbIndex: uniqueMember eq
  4. Run the OpenLDAP indexer for your configuration:
    slapindex -F /etc/ldap/slapd.d/
  5. Fix file permissions in your OpenLDAP database:
    sudo chown -R openldap:openldap /var/lib/ldap
  6. Start the LDAP server:
    /etc/init.d/slapd start