OID ldapadd Command Fails with Error ldap_add: Object class violation or ldap_add_s: Constraint violation
(Doc ID 1379627.1)
Last updated on APRIL 03, 2023
Applies to:
Oracle Internet Directory - Version 10.1.4.0.1 and laterInformation in this document applies to any platform.
Symptoms
1.ldapadd command fails with below common error message.
"ldap_add: Object class violation"
2.Examples of failed ldapadd commands
Example 1:
--------------
>ldapadd -p <PORT> -h <OID_HOSTNAME> -D "cn=orcladmin" -w <PASSWORD> -v -f <FILENAME>.ldif
add dc:
<DOMAIN>
add objectclass:
domain
top
adding new entry dc=<DOMAIN>
ldap_add: Constraint violation
ldap_add: additional info: Admin domain does not contain schema information for objectclass domain.
Example 2:
--------------
>ldapadd --p <PORT> -h <OID_HOSTNAME> -D "cn=orcladmin" -w <PASSWORD> -v -f <FILENAME>.ldif
adding new entry cn=<CN>,cn=OracleContext
ldap_add: Object class violation
ldap_add: additional info: dc attribute not found. Mandatory Attribute missing.
In this case it was OID 10.1.4.0.1.
But same note applies for later OID versions if above error is faced.
Example 3:
$ORACLE_HOME/bin>./ldapadd -h <oid_host> -p <oid_port> -D cn=<username> -w -f <path_to_ldif_file>
ERROR
======
ldap_add: Object class violation
ldap_add: additional info: Failed to find <attribute> in mandatory or optional attribute list.
The contents of the ldif file contained incorrect parameters defined for the objectclass and attribute of the entry being added.
Contents of the ldif file:
cn=<object_name>,cn=OracleContext,<DOMAIN_REALM>
objectclass=top
objectclass=oraclNetService
cn=<object_name>
oraclnetdescstring= (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=<db_host>)(PORT=<db_port>)))(CONNECT_DATA=(SERVICE_NAME=<service_name>)))
Changes
OID Schema ObjectClasses were not as per standard definition.
Here in this case we had two issues
1. "domain" objectclass was missing.
2."top" objectclass was modified unknowingly and was not as per standard default installation
Cause
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
Symptoms |
Changes |
Cause |
Solution |