- Flexera Community
- :
- FlexNet Manager
- :
- FlexNet Manager Suite Known Issues
- :
- Known Issue: Import may fail at step "WriteComputers - Insert new computers" with error: The DELETE ...
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Known Issue: Import may fail at step "WriteComputers - Insert new computers" with error: The DELETE statement conflicted with the REFERENCE constraint "CloudServiceApplicationWithByol_ComplianceComputer" (IOJ-2228768)
Known Issue: Import may fail at step "WriteComputers - Insert new computers" with error: The DELETE statement conflicted with the REFERENCE constraint "CloudServiceApplicationWithByol_ComplianceComputer" (IOJ-2228768)
Summary
The “writer” phase of the inventory import process may fail with an error message like the following:
2021-10-24 19:12:29,746 [INFO ] WriteComputers - Insert new computers 2021-10-24 19:12:56,731 [INFO ] Failed to execute Writer 'WriteComputers - Insert new computers' from file C:\ProgramData\Flexera Software\Compliance\ImportProcedures\Inventory\Writer\Computer.xml, at step line 544 Error: The DELETE statement conflicted with the REFERENCE constraint "CloudServiceApplicationWithByol_ComplianceComputer". The conflict occurred in database "FNMSCompliance", table "dbo.CloudServiceApplicationWithByol_MT", column 'ComplianceComputerID'. Synchronized 0 row(s) of table 'ComplianceComputerPerOperator_PC' (234 ms) Synchronized 0 row(s) of table 'ComplianceComputerPerOperator_PC' (94 ms) The statement has been terminated.
Details
This error occurs due to a logic error related to removing inventory device records in the database that have a status of “awaiting inventory” when they need to be replaced with an active inventory device record.
If the following query returns any results when executed against the compliance database then the current state of data is liable to trigger this issue to occur:
SELECT * FROM dbo.ComplianceComputer cc JOIN dbo.CloudServiceApplicationWithByol csab ON csab.ComplianceComputerID = cc.ComplianceComputerID wHERE cc.ComplianceComputerStatusID = 4 /* awaiting inventory */
Mitigation
When this issue occurs, the following SQL statements can be executed against the compliance database to clean up problematic data.
UPDATE csi SET HostComplianceComputerID = NULL FROM dbo.CloudServiceInstance_MT csi INNER JOIN ComplianceComputer d ON d.ComplianceComputerID = csi.HostComplianceComputerID WHERE d.ComplianceComputerStatusID = 4 UPDATE csi SET ComplianceComputerID = NULL, MatchingRuleID = NULL, InventoryDate = NULL FROM dbo.CloudServiceInstance_MT csi INNER JOIN ComplianceComputer d ON d.ComplianceComputerID = csi.ComplianceComputerID WHERE d.ComplianceComputerStatusID in = 4 UPDATE csab SET ComplianceComputerID = NULL, SoftwareTitleID = NULL, CloudLicenseTypeID = NULL, Overridden = 0 FROM dbo.CloudServiceApplicationWithByol_MT csab INNER JOIN ComplianceComputer d ON d.ComplianceComputerID = csab.ComplianceComputerID WHERE d.ComplianceComputerStatusID = 4
Be aware that this is only a temporary mitigation, as new problematic data may arise and cause future imports to fail in the same way - in which case these statements can be re-executed.
Fix status
This issue has been fixed in the following FlexNet Manager Suite releases: 2022 R1.5 / Aug 2022 (Cloud), 2022 R2 (On Premises)
Other information
Affected components: Inventory import (read/write/export)
Master issue ID: IOJ-2228768
Also known as: FNML-74620
Tip: If you have been impacted by this issue, please click the KUDOS button above. This helps to track the relative significance and importance of issues. Clicking on an option against "Was this article helpful?" also helps assess and improve the usefulness of content.