Well I have already gone through ldap_add: Constraint violation (19) but couldn't solve my problem!

Problem I'm facing is that, when I'm trying to add users from bckup.ldif file by issuing following command

ldapadd -x -D "dc=admin,dc=domain,dc=lcl -f bckup.ldif -W

It's throwing following error

adding new entry "uid=doctor.lcl,ou=People,dc=domain,dc=lcl"
ldap_add: Constraint violation (19)
    additional info: some attributes not unique

I took backup by using ldapsearch only not slapcat

So my question is What causing the error and How to resolve the error?

  • Seems to me that you already have a user id doctor.lcl in your ldap directory, and you cannot create a second user with this samue id due to integrity constraints
    – krisFR
    Commented Mar 6, 2015 at 12:25
  • @krisFr: No man. No same entry! I just searched.
    – Neel
    Commented Mar 6, 2015 at 12:32
  • So, check which attribute(s) have to be uniq in your LDAP directory, and then search which attributes are equal between doctor.lcl ones and existing ones. It could be cn, email etc etc...
    – krisFR
    Commented Mar 6, 2015 at 12:44
  • @KrisF : Can u tell me how to check which attributes to be unique? I am not so proficient with and some hints will be very helpful.
    – Neel
    Commented Mar 6, 2015 at 12:51
  • You will need to post the LDIF file you're adding from.
    – user207421
    Commented Mar 8, 2015 at 3:42

1 Answer 1


It seems that one (or more) attribute for uid=doctor.lcl,ou=People,dc=domain,dc=lcl contains duplicate value with an already existing LDAP entry, for an attribute defined as unique.

First, check your slapd.conf to search for attributes marked as unique. e.g :

# index since the unique overlay will search for matching mail attributes
index mail eq

overlay unique
unique_attributes mail

Then perform an ldap search on this (these) unique attribute(s) and find the one which is a duplicate with uid=doctor.lcl attributes.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .