Error: Database error | 19: Column DstDn is not Unique

Created: 2012-04-20 08:09:59
Modified: 2022-09-10 09:00:35
Tags: Custom Mapping Errors Troubleshooting UnitySync

For most effective troubleshooting of this error, turn on Log File level 3-Detailed (General tab) and run the Sync again. The level 3 log will show more helpful information than a default log.

In this error message, Column DstDn refers to the DN of a contact stored within the connection’s database. Each Source object synced must result in a unique DN when the object is created on the Destination. This error indicates the Sync is trying to Add or Modify a Destination object using a DN that already exists in the connection’s database, resulting in the error. What is causing the duplicate DN depends on the DN mapping for this connection.

The format of the DN is defined in your connection’s map file(s). Review the level 3-Detailed log to identify the DN mapping by searching for “Load Person Map”.

Load Person Map | ../global/map/custom/DomainA-to-DomainB-person.txt
********************************* Person Map ****************************

In the above example, mail is used in the DN mapping. So, this error would indicate two Source objects have the same email address (mail). One Source object successfully synced previously, another source object is trying to Sync now.

Sample level 3 error output:

Add Object |,ou=test26,dc=2k19,dc=test
Database Error | 19
Database Message | UNIQUE constraint failed: object.dstdn
Source DN | CN=Kristine Piccola 2,OU=LoadWithSmallSyncs,OU=T…
Dest DN |,ou=test26,dc=2k19,dc=test
db srcdn | CN=Kristine Piccola,OU=LoadWithSmallSyncs,OU=Te…

The error output identifies the Source object attempting the Add:

db srcdn | CN=Kristine Piccola,OU=LoadWithSmallSyncs,OU=Te…

The error output also identifies the existing Destination DN already in the connection database:

Dest DN |,ou=test26,dc=2k19,dc=test

In order to identify the original Source object (that synced previously) search the level 3-Detailed log for the email address (i.e., search for mail: )

There is a Source Entry for each Source object. You should find more than one Source entry with the value mail: Check the DN shown in the Source Entry for each record that shows the problem mail value. You will find two source DNs have the same mail' value, as shown below.

****************** Source Entry ******************
dn: CN=Kris Smith,OU=Sales,DC=Acme,DC=com
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: user
department: Sales
cn: Joe Mallor
displayName: Kris Smith
objectGUID:: 8EYAIqnFgE+Xr91Tvw4Q==


****************** Source Entry ******************
dn: CN=Kristine Smith,OU=Support,DC=Acme,DC=com
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: user
department: Support
cn: Kris Smith
displayName: Kristine Smith
objectGUID:: 8EYAIqnFgE+Xr91Tvw4Q==


  1. In order for both of these objects to Sync, one of their values (i.e., mail) must be changed.
    This must be done on your Source.

  2. Alternatively, you can exclude one of the Source objects.
    Note: depending on which Source object you exclude, you may see a Delete then an Add on the next sync run.
    Sample exclude rule: dn=CN=Kristine Smith,OU=Support,DC=Acme,DC=com

  3. Finally, if you receive these errors regularly, you may want to consider customizing the DN mapping so it is more likely to result in a unique value for every sync. This occurs most commonly when an attribute other than the default of mail is used. If you need to use an alternate attribute for your DN mapping, we suggest contacting Support for assistance so they can help you craft the DN mapping in such a way that this error is avoided.

Share this article:

  1. Directify - Self Service

  2. Mimic - Replication

  3. UnitySync - Sync
  1. emPass - Sync
  1. Profiler
  2. SimpleSync