Summary
When running the Compliance Importer, the following error may occur.
Symptoms
When running the Compliance Importer, the following error may occur:
Failed to execute Reader 'ReadClusterGroups' from file C:\ProgramData\Flexera Software\Compliance\ImportProcedures\Inventory\Reader\managesoft\Cluster.xml
Error: Violation of PRIMARY KEY constraint 'PK__#Cluster__XXXXX'. Cannot insert duplicate key in object 'dbo.#ClusterGroup'. The duplicate key value is (xxxx, xxxxx, xxxxx, xxxxxx).
Cause
As the error suggests, the duplicate values to be inserted into table "ClusterGroup" has violated the primary key constraint.
Workaround
Add "DISTINCT" to the select query for reader "ReadClusters" in file "ProgramData\Flexera Software\Compliance\ImportProcedures\Inventory\Reader\managesoft\Cluster.xml".
So it becomes:
SELECT DISTINCT
NULL
AS ExternalID,
CAST(NULL AS nvarchar(256))
AS ExternalName,
....
Rather than:
SELECT
NULL
AS ExternalID,
CAST(NULL AS nvarchar(256))
AS ExternalName,
....