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

Re: Problem to add entries



At 10:47 AM 4/29/2005, Irene Ruscalleda wrote:
>Hello,
>First of all i have to say that i am a newbie in LDAP.
>
>I have problems to update update the entries in my directory.
>
>After the following command: ldapadd -x -D "cn=Manager,dc=i2cat,dc=net" -W -f /var/db/openldap-data-i2cat/entries.ldif
>
>I get the following message:
>
>ldap_add: Already exists (68)

Likely one of the two entries in this LDIF already exist.

>My ldif file looks like this:
>
>+++++++++++++++++++++++++
>dn: dc=i2cat,dc=net
>objectClass: dcObject
>objectClass: organization
>dc: i2cat
>o: i2cat
>
>dn: cn=Manager,dc=i2cat,dc=net
>objectClass: organizationalRole
>cn: Manager
>+++++++++++++++++++++++++
>
>When i do a ldapseach i get the following output:
>
>ldapsearch -x -b 'dc=i2cat,dc=net' '(objectclass=*)'
># extended LDIF
>#
># LDAPv3
># base <dc=i2cat,dc=net> with scope sub
># filter: (objectclass=*)
># requesting: ALL
>#
>
># i2cat.net
>dn: dc=i2cat,dc=net
>description:: RnVuZGFjaW9uIEkyQ2F0IA==
>objectClass: dcObject
>objectClass: organization
>dc: i2cat
>o:: aTJjYXQg
>
># search result
>search: 2
>result: 0 Success
>
># numResponses: 2
># numEntries: 1

So, yes, the first of the entries does exist, hence the
error in trying to add it.

>As you can see there is information that doesn´t match my actual ldif file, there is old data in there and it seems it is corrupted.
>
>I tried to do a ldapmodify also but it seems it didn´t updated the database neither:
>
>ldapmodify -x -D "cn=Manager,dc=i2cat,dc=net" -W -f /var/db/openldap-data-i2cat/entries.ldif
>modifying entry "dc=i2cat,dc=net"
>modifying entry "cn=Manager,dc=i2cat,dc=net"
>ldap_modify: No such object (32)
>       matched DN: dc=i2cat,dc=net

This fails because the second entry does not exist.  You
need to add it first (by creating an LDIF file that just
contains it).

Note that ldapmodify(1) should not be used to add entries,
unless your LDIF explicitly changes ADD changetype records.
The entry LDIF form, more commmonly used to add entries,
as you provided above, should be feed to ldapadd(1).


>Thanks in advance for any help you can give me.
>Best regards and happy weekend.
>Irene Ruscalleda