Adding New Attribute Of A New Objectclass To An Existing Entry Fails With: 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 MARCH 08, 2017

Applies to:

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

Symptoms

How to add a new objectclass (including its mandatory and/or optional attributes) to an existing entry in Oracle Internet Directory (OID) 10g or 11g?

Tried using ldapmodify to add new attribute and value to an existing entry with the following ldif file, for example:

dn: cn=TestUser,cn=users,dc=mycompany,dc=com
changetype: modify
add: c
c: USA

But the ldapmodify with this ldif file fails with error:

add c:
      USA
modifying entry cn=testuser,cn=users,dc=mycompany,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=testuser,cn=users,dc=mycompany,dc=com
changetype: modify
add: objectclass
objectclass: country


That ldapmodify then fails with:

add objectclass:
country
modifying entry cn=testuser,cn=users,dc=mycompany,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.

Changes

 

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