After running a Discovery job, it either fails or appears to be completed with errors. After further investigation, error messages similar to the one below are found in the xcAdmin.log file:
Severity: Error, Switch: TraverseTiming Message: Error Updating Table :
System.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint'. Cannot insert duplicate key in object 'dbo.USERRIGHTS_MIRROR'.
The statement has been terminated.
Note: The ControlPoint Administration Log (xcAdmin.log) is accessible from the <SharePoint hive folder>\TEMPLATE\LAYOUTS\Axceler\log folder of the machine on which ControlPoint was installed for the farm.
The issue may be caused by either (a) an improperly terminated discovery has left data in the xcAdmin database or (b) 2 sites or webs exist with the same GUID in the same farm.
TRUNCATE TABLE WAPRIGHTS
TRUNCATE TABLE WAPRIGHTS_MIRROR
TRUNCATE TABLE USERRIGHTS
TRUNCATE TABLE USERRIGHTS_MIRROR
TRUNCATE TABLE WEBPARTS
TRUNCATE TABLE WEBPARTS_MIRROR
TRUNCATE TABLE xcTopHierarchy
TRUNCATE TABLE xcTopHierarchy_MIRROR
TRUNCATE TABLE xcSiteInfo_MIRROR