My Oracle Support Banner

Adding New Attribute of a New Objectclass to an Existing Entry in OID or OUD Fails: Ldap_modify: Failed to find <Attribute Name> in mandatory or optional attribute list / How to Add New Objectclass to an Entry (Doc ID 378345.1)

Last updated on JULY 11, 2023

Applies to:

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


Adding a new objectclass (including its mandatory and/or optional attributes) to an existing entry in Oracle Internet Directory (OID) or Oracle Unified Directory (OUD) fails.

Using ldapmodify to add new attribute and value to an existing entry in OID with the following ldif file, for example:

dn: cn=<USERNAME>,cn=users,dc=<COMPANY>,dc=com
changetype: modify
add: c
c: <country>

But the ldapmodify with this ldif file fails with error:

add c:
modifying entry cn=<USERNAME>,cn=users,dc=<COMPANY>,dc=com
ldap_modify: Object class violation
ldap_modify: additional info: Failed to find c in mandatory or optional attribute list.

As the c attribute is part of objectclass country, but this user entry does not currently have this objectclass, if then trying to modify the entry to add the objectclass country using the following ldif file:

dn: cn=<USERNAME>,cn=users,dc=<COMPANY>,dc=com
changetype: modify
add: objectclass
objectclass: country

That ldapmodify then fails with:

add objectclass:
modifying entry cn=<USERNAME>,cn=users,dc=<COMPANY>,dc=com
ldap_modify: Type or value exists
ldap_modify: additional info: objectclass attribute has duplicate value.

The same error can occur when adding a new objectclass that has no mandatory attributes, just optional ones.


Below is an example when using OUD:

ldapmodify -h <OUD_HOSTNAME> -p <OUD_PORT> -D "<OUD_ADMIN>" -w <password> -f <FILENAME.ldif> -v
add cn:
add objectclass:
add orclNetDescString:
adding new entry cn=<CN_VALUE>,cn=OracleContext,dc=<DOMAIN>,dc=<COUNTRY>
ldap_add: Object class violation
ldap_add: additional info: Entry cn=<CN_VALUE>,cn=OracleContext,dc=<DOMAIN>,dc=<COUNTRY> violates the Directory Server schema configuration because it contains an unknown objectclass top






To view full details, sign in with your My Oracle Support account.

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

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.