Summary
The CreateVDIUserConnections import writer step may fail with the following error:
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_VDIUserConnection_ComplianceUser". The conflict occurred in database "FNMSCompliance", table "dbo.ComplianceUser_MT", column 'ComplianceUserID'.
Details
This issue is caused by a logic error that incorrectly handles some situations where user records have been deleted from the database.
When this issue occurs, logging from the import writer process will show error details similar to the following:
2022-04-21 16:09:03,488 [INFO ] CreateVDIUserConnections 2022-04-21 16:17:15,655 [INFO ] Failed to execute Writer 'CreateVDIUserConnections' from file C:\ProgramData\Flexera Software\Compliance\ImportProcedures\Inventory\Writer\VDI.xml, at step line 78 Error: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_VDIUserConnection_ComplianceUser". The conflict occurred in database "FNMSCompliance", table "dbo.ComplianceUser_MT", column 'ComplianceUserID'. Removed 0 VDI user connection records for users who no longer have access to VDIs Updated inventory date for 0 VDI user connection records. The statement has been terminated. Added 0 new VDI user connection records for users who have access to VDIs 2022-04-21 16:17:15,655 [INFO ] All retries have been attempted for Writer 'CreateVDIUserConnections' 2022-04-21 16:17:15,717 [ERROR] System.Data.SqlClient.SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "FK_VDIUserConnection_ComplianceUser". The conflict occurred in database "FNMSCompliance", table "dbo.ComplianceUser_MT", column 'ComplianceUserID'.
Workaround
This issue can be worked around by making adding a line in one of the SQL queries in the CreateVDIUserConnections writer in the C:\ProgramData\Flexera Software\Compliance\ImportProcedures\Inventory\Writer\VDI.xml file on the FlexNet Manager Suite batch server as illustrated in the following unified diff:
--- VDI.xml.orig
+++ VDI.xml @@ -560,11 +560,12 @@
INSERT INTO dbo.VDIUserConnection (VDIGroupID, ComplianceUserID, ComplianceConnectionID, InventoryDate)
SELECT
tvuc.VDIGroupID,
tvuc.ComplianceUserID,
tvuc.ComplianceConnectionID,
tvuc.InventoryDate
FROM #VDIUserConnection AS tvuc
+ JOIN dbo.ComplianceUser cu ON cu.ComplianceUserID = tvuc.ComplianceUserID
WHERE NOT EXISTS (
SELECT 'x'
FROM dbo.VDIUserConnection AS vuc
WHERE
Related Articles
Import writers step "Syncs the reconcile staging tables to main tables" step may fail with error: 'The INSERT statement co… 10Number of Views WriteRemoteFileEvidenceMatchCounts import writer step may fail with error: Failed to import inventory devices with error m… 5Number of Views Writer step WriteContainerPods may fail with error if writers are run individually and a device has been deleted since the… 5Number of Views RemoveMissingComputersAndAssociatedProperties writer may fail with error: 'The DELETE statement conflicted with the FOREIG… 4Number of Views WriteInstalledFileEvidenceAttribute inventory writer step may fail with error: The MERGE statement conflicted with the FOR… 4Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Case id: 00001065
Activity: Status change: 2 hours ago