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

RESOLVED: ldapsearch returns dreaded 'no such object'



thanks to everyone that e-mailed me "newbie" suggestions off-list. i got sidetracked on another project and finally got back to trying this out. it turns out i was doing two things wrong:

1) i had to change the owner of "/usr/local/var/openldap-ldbm" and the files inside to be "ldap" instead of "root" since slapd was running as "ldap". IMHO this should have been done by the "make install" command, but maybe there are other factors i don't understand. since an older version of OpenLDAP was already installed i think certain things had been done that normally aren't done when installing from source.

2) i had to use ldapadd instead of slapadd. now that i've done it the instructions make much more sense, but essentially i took these lines out of the LDIF file and loaded them with slapadd (while slapd wasn't running):
-----
dn: dc=aes,dc=org
objectClass: dcObject
objectClass: organization
o: AES
dc: aes


dn: cn=Manager,dc=aes,dc=org
objectclass: organizationalRole
cn: Manager
-----

and then i was able to start slapd and use this command to load the rest of the file:
ldapadd -f bottom.ldif -x -D "cn=Manager,dc=aes,dc=org" -w secret
after fixing one mistake in my "perfect" ldif file it loaded in without a hitch and i could then do:
ldapsearch -x
to print out the whole thing.


i know this is really basic stuff to most of you, but hopefully this post will help a newbie in the future that is searching the archives.

steve


----------------

i'm attempting to migrate away from Netscape Directory Server and onto OpenLDAP. i believe i have successfully loaded in a cleaned up LDIF file (using slapadd) but can't get ldapsearch to return any records. i'll paste below the relevant info below in the hopes that i'm doing something stupid.

Platform: Redhat Linux (Linux 2.4.18 #3 SMP Fri Jul 26 16:27:29 MDT 2002 i686 unknown)
Version: OpenLDAP 2.0.23


example of failed search - i've tried MANY variations on this:
----------------
ldapsearch -v -x -b 'dc=aes,dc=org' 'cn=*' cn
ldap_initialize( <DEFAULT> )
filter: cn=*
requesting: cn
version: 2

#
# filter: cn=*
# requesting: cn
#

# search result
search: 2
result: 32 No such object

# numResponses: 1
----------------

example of what i think is a successful search:
----------------
ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts
version: 2

#
# filter: (objectclass=*)
# requesting: namingContexts
#

#
dn:
namingContexts: dc=aes,dc=org

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1
----------------

partial LDIF file:  (actual file actually has 542 uids and 19 groups)
----------------
dn: dc=aes,dc=org
objectClass: dcObject
objectClass: organization
o: AES
dc: aes

dn: ou=AES,dc=aes,dc=org
objectClass: top
objectClass: organizationalunit
ou: AES

dn: uid=sjohnson,ou=AES,dc=aes,dc=org
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
givenName: Steve
sn: Johnson
cn: Steve Johnson
uid: sjohnson
userpassword: {SHA}<snipped>

dn: cn=Test,ou=AES,dc=aes,dc=org
objectClass: top
objectClass: groupOfUniqueNames
cn: Test
uniqueMember: uid=sjohnson,ou=AES,dc=aes,dc=org
----------------

slapd.conf file with comments removed:
----------------
# $OpenLDAP: pkg/ldap/servers/slapd/slapd.conf,v 1.8.8.7 2001/09/27 20:00:31 kur
t Exp $


include         /etc/openldap/schema/core.schema
include         /etc/openldap/schema/cosine.schema
include         /etc/openldap/schema/inetorgperson.schema
include         /etc/openldap/schema/nis.schema
include         /etc/openldap/schema/redhat/rfc822-MailMember.schema
include         /etc/openldap/schema/redhat/autofs.schema
include         /etc/openldap/schema/redhat/kerberosobject.schema
database        ldbm
suffix          "dc=aes,dc=org"
rootdn          "cn=Manager,dc=aes,dc=org"
rootpw          secret
directory       /var/lib/ldap
index   objectClass,uid,uidNumber,gidNumber,memberUid   eq
index   cn,mail,surname,givenname                       eq,subinitial
----------------

ldap.conf file with comments removed:
----------------
# $OpenLDAP: pkg/ldap/libraries/libldap/ldap.conf,v 1.4.8.6 2000/09/05 17:54:38 kurt Exp $


HOST 127.0.0.1
BASE dc=aes,dc=org
----------------

hopefully that's enough info but i can try to provide more...

steve