[SalesForce] duplicates value on record with id:

As part of an ant deployment, to recently cleaned Org, I get the following:

All Component Failures:
1.  objects/CustomObject__c.object (CustomObject__c.SomeQueue) -- Warning: Added entity: CustomObject__c support on queue: SomeQueue (line 1334, column 16)
2.  layouts/CustomObject__c-One Layout.layout -- Error: duplicate value found: <unknown> duplicates value on record with id: <unknown>
3.  layouts/CustomObject__c-Another Layout.layout -- Error: duplicate value found: <unknown> duplicates value on record with id: <unknown>

The first seems to be due to Salesforce's own circular logic; an object has a listview based on a queue and a queue is linked to an object. I just a warning so I guess its OK?

The other two I have no idea how to debug.

Any ideas what could be causing this issue? I've tried turning trackFeedHistory off as suggested here.

Best Answer

Editor's Note: This issue has been resolved in Winter 19


The Error: duplicate value found error seems to be a bug, related to deploying two inter-related objects with history tracking. See here:

https://success.salesforce.com/issues_view?id=a1p30000000T5hTAAS

Suggested workaround is splitting deployment into stages