"Duplicate value found" on Deploy — Causes and Fixes
Short answer: this is a uniqueness clash raised while deploying a component, and it has more than one cause — which is why the message is so cryptic. On a modern org (recent API versions) it usually surfaces in one of these forms:
The label:Shared Label on record type:My_Object__c.New_RT is not unique
DUPLICATE_VALUE: duplicate value found when building unique index: <value> on rows (…)
The older, terser form — duplicate value found: <unknown> duplicates value on record with id: <unknown> — still appears at the data layer (and on older orgs), but the deploy path now gives you the friendlier, cause-specific messages above. Match your fix to the cause.
The common causes
| Cause | What you see | Why |
|---|---|---|
| Record-type label clash | The label:… on record type:Obj.RT is not unique | You're deploying a record type whose API name differs but whose label matches an existing record type on the target. Record-type labels must be unique per object. |
| Field going unique vs existing data | duplicate value found when building unique index: … | You're deploying a field change that makes it Unique, but the target object already holds records that share a value, so the unique index can't be built. |
| Duplicated entry in a profile / layout | Duplicate name '…' specified / repeated rows | A merge or hand-edit left a repeated entry (a field, a record-type visibility, a related-list button) inside a profile or page-layout file. |
How to fix each
- Record-type label clash — make the labels unique, or align the API names, so the record type you're deploying doesn't collide with one already on the target. Compare the object's record types on both orgs first: the clash is almost always a label that was renamed on one side but kept the same on the other.
- Field going unique — this one is a data problem, not a metadata one. Find and merge (or clear) the target records that already share the value, then deploy the unique-field change. Salesforce can't build a unique index while duplicates exist.
- Duplicated profile/layout entry — open the component and remove the repeated block, then redeploy. These usually come from a version-control merge that doubled an entry.
How mtdt.io helps
Salesforce gives you the bare message with no hint about which cause you hit. In mtdt.io's Deploy History, the failed component carries a hint that decodes it — naming the likely causes so you know where to look:

For the record-type label clash — the most common deploy-path cause — mtdt.io's Table View compares the object's record types row by row, so you can spot the label that matches across orgs while the API name differs. For the field-going-unique case, the fix is on the data side (merge the duplicate records); mtdt.io surfaces the clash but doesn't resolve the underlying data for you.
FAQ
What causes "duplicate value found" when deploying? A uniqueness clash. The most common deploy-path causes are a record type whose label matches an existing one on the target (labels must be unique per object), a field being made Unique while the target already has records sharing a value, or a duplicated entry inside a profile or page-layout file.
Why is the error message so vague?
Because one uniqueness rule is being violated at the database layer, and several different metadata mistakes can trigger it. Modern orgs now report the specific cause (record-type label, unique index, duplicate name) instead of the old <unknown> duplicates value on record with id: <unknown> string, which mostly appears at the data layer now.
How do I fix a record-type label clash? Make the record-type labels unique across the two orgs, or align the API names so you're updating the same record type rather than creating a colliding one. Comparing the object's record types side by side shows you which label was renamed.
How do I fix "duplicate value found when building unique index"? That's a data issue: the target object already has records sharing the value you're making unique. Find and merge (or clear) those duplicate records, then deploy the unique-field change.
Related
- Deploying Record Types — how record types deploy, and their dependencies.
- Compare Salesforce Metadata Without Reading XML — Table View for comparing record types row by row.