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

Re: No Such Object



After poring over the Howes/Smith/Good book, blitzing my datastore a
couple of times, and watching slapd's debug output while querying, I
figured it out why I couldn't load my Netscape ldif file. The reason is
that the ldif file I'd exported from Netscape contained a comma in a
rather unfortunate place:

dn: cn=Smith, John dc=ldis, dc=com
cn: Smith, John
mail: jsmith@ldis.com
givenname: John
sn: Smith
countryname: US
objectclass: top
objectclass: person

The problem is in the first line. Note the comma between the last name
and the first name, the result of my personal preference of entering
contact names that way (this is not Netscape's default behavior). Slapd
thought this was a separator, and was looking for a parent object called
John (too bad the error message isn't more specific).

Changing the first line of each addressbook entry to use a uid instead
of a cn, using a unique id with no spaces or commas, The following
example will load fine:

dn: uid=jsmith, dc=ldis, dc=com
cn: Smith, John
mail: jsmith@ldis.com
givenname: John
sn: Smith
countryname: US
objectclass: top
objectclass: person


Lesson Learned: Beware Netscape's ldif export. It doesn't validate its
own output. (Maybe I should stick to XML...:)

Thanks for the suggestions,

Jonathan



"Kurt D. Zeilenga" wrote:
> 
> At 03:55 PM 6/6/00 -0500, Jonathan Donald wrote:
> >           dn: dc=ldis, dc=com
> >           dc: ldis
> >           o: LDIS
> >           objectclass: organization
> >           objectclass: dcObject
> >
> >           dn: cn=Manager, dc=ldis, dc=com
> >           cn: Manager
> >           sn: Manager
> >           objectclass: person
> 
> I'll assume your actual LDIF file doesn't contain spaces to
> the left of attribute types AND that you loaded this with
> ldapadd(1) and verified with ldapsearch(1).
> 
> >When I try to do a lookup using Netscape Communicator, I get the
> >following error:
> >
> >   Failed to search 'OpenLDAP Test Installation' due to LDAP error 'No
> >such object (0x20)
> >
> >Then I attempt to load an ldif file (exported from my Netscape address
> >book):
> >
> >   %ldapadd -D "cn=Manager, dc=ldis, dc=com" -W < addressbook.ldif
> >   adding new entry cn=Smith, John,mail=joe@ldis.com
> >   Enter password:
> >   ldap_add: No such object
> 
> The root of your DIT is "dc=ldis, dc=com" and this entry is outside
> your DIT.
> 
> >Seems pretty clear that my directory is missing something very important
> >(a root node?), but I'm not sure how to troubleshoot this.
> 
> Well, if you added the first LDIF with "dc=ldis, dc=com", you
> have added the entry at your.  (note: you do not need (and
> should not) add "dc=com" as someone suggested).
> 
> Kurt
begin:vcard 
n:Donald;Jonathan
tel;fax:212/989-1961
tel;work:212/989-1001
x-mozilla-html:TRUE
org:Liquid Digital Information Systems
adr:;;180 Varick St, 12th Fl;New York;NY;10014;USA
version:2.1
email;internet:jonathan@ldis.com
title:Enterprise Engineer
x-mozilla-cpt:;15104
fn:Jonathan Donald
end:vcard