Linux – ldap_add no such object (32) matched dn dc=domain dc=com

ldaplinuxopenldapredhat

When im trying to import users to LDAP using this command:

ldapadd -x -D "cn=Manager,dc=domain,dc=com" -W -f  /etc/openldap/root.ldif

I have this error:

ldap_add no such object (32) 
          matched dn dc=domain,dc=com

Let me show you the files:

/etc/openldap/domain.ldif

dn: dc=domain,dc=com
dc: domain
description: LDAP Admin
objectClass: dcObject
objectClass: organizationalUnit
ou: rootobject 

dn: ou=People, dc=domain,dc=com
ou: People
description: Users of adminmart
objectClass: organizationalUnit

/etc/openldap/root.ldif

dn: uid=root,ou=People,dc=domain,dc=com
uid: root
cn: Manager
objectClass: account

Someone can help me?

Thanks

Best Answer

I had the same problem doing the same command:

No such object (32)
matched DN: dc=example,dc=com

I checked the LDIF file and all my OUs from LDAP and I was trying to add an entry to an OU that does not exist.

I solved changing the OU on ldif file for one that exist. And all worked fine.