(Answer) (Category) OpenLDAP Faq-O-Matic : (Category) OpenLDAP Software FAQ : (Category) Common Errors : (Answer) ldap_*: No such object
The 'no such object' error is generally returned when the target DN of the operation cannot be located. This section details reasons common to all operations. You should also look for answers specific to the operation (as indicated in the error message).
The most common reason for this error is non-existance of the named object. First, check for typos.

Also note that, by default, a new directory server holds no objects (except for a few system entries). So, if you are setting up a new directory server and get this message, it may simply be that you have yet to add the object you are trying to locate.

The error commonly occurs because a DN was not specified and a default was not properly configured.

If you have a suffix specified in slapd.conf eg.

  suffix "dc=example,dc=com"
You should use
  ldapsearch -b 'dc=example,dc=com' '(cn=jane*)'
to tell it where to start the search.

The -b should be specified for all LDAP commands unless you have an ldap.conf(5) default configured.

See Also: ldapsearch(1), ldapmodify(1), and (Xref) How do I specify default base DN for clients?
Also, slapadd(8) and its ancillary programs are very strict about the syntax of the LDIF file. Some liberties in the LDIF file may result in an apparently successful creation of the database, but accessing some parts of it may be difficult.

One known common error in database creation is putting a blank line before the first entry in the LDIF file. There must be no leading blank lines in the LDIF file.

It is generally recommended that ldapadd(1) be used instead of slapadd(8) when adding new entries your directory. slapadd(8) should be used to bulk load entries known to be valid.

Another cause of this message is a referral entry to an unpopulated directory. Either remove the referral, or add a single record with the referral base DN to the empty directory.
This error may also occur when slapd is unable to access the contents of its database because of file permission problems. For instance, on a RedHat Linux system, slapd runs as user 'ldap'. When slapadd is run as root to create a database from scratch, the contents of /var/lib/ldap are created with user and group root and with permission 600, making the contents unaccessable to the slapd server.
[Append to This Answer]
Previous: (Answer) ldap_*: Can't contact LDAP server
Next: (Answer) ldap_*: Can't chase referral
This document is: http://www.openldap.org/faq/index.cgi?file=343
[Search] [Appearance]
This is a Faq-O-Matic 2.721.test.
© Copyright 1998-2013, OpenLDAP Foundation, info@OpenLDAP.org