Adding Multiple Entries From Ldif File Into OID With Ldapadd Fails: ldap_add: Object class violation; ldap_add: additional info: Failed to find dn in mandatory or optional attribute list. (Doc ID 295178.1)

Last updated on MARCH 08, 2017

Applies to:

Oracle Internet Directory - Version 9.0.4 and later
Information in this document applies to any platform.

Symptoms

Using ldapadd and ldif file to add multiple entries/users into Oracle Internet Directory (OID).

Running a file to add only one entry works fine.

Adding more than one user/entry in the ldif file, ldapadd fails.

Sample ldif file contents (i.e., adduser.ldif):

dn: cn=JSmith,cn=users,dc=us,dc=oracle,dc=com
sn: Smith
uid: JSmith
cn: JSmith
objectclass: orcluser
objectclass: organizationalperson
objectclass: inetorgperson
objectclass: person
objectclass: top
objectclass: orcluserv2
mail: JSmith@us.oracle.com
givenname: Smith
userpassword: welcome1
dn: cn=JDoe,cn=users,dc=us,dc=oracle,dc=com
sn: Doe
uid: JDoe
cn: JDoe
objectclass: orcluser
objectclass: organizationalperson
objectclass: inetorgperson
objectclass: person
objectclass: top
objectclass: orcluserv2
mail: JDoe@us.oracle.com
givenname: Doe
userpassword: welcome1


Running command:

./ldapadd -h < oidhost1 > -p < port# > -D "cn=orcladmin" -w < password > -v -f /tmp/adduser.ldif


It fails with:

add sn:
Smith
Doe
add uid:
JSmith
JDoe
add cn:
JSmith
JDoe
add objectclass:
orcluser
organizationalperson
inetorgperson
person
top
orcluserv2
orcluser
organizationalperson
inetorgperson
person
top
orcluserv2
add mail:
JSmith@us.oracle.com
JDoe@us.oracle.com
add givenname:
Smith
Doe
add userpassword:
welcome1
welcome1
add dn:
cn=JSmith,cn=users,dc=us,dc=oracle,dc=com
adding new entry cn=JDoe,cn=users,dc=us,dc=oracle,dc=com
ldap_add: Object class violation
ldap_add: additional info: Failed to find dn in mandatory or optional attribute list.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms