cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Reconciliation stuck at Azure Import

Azure import stuck with  below error:

System.Data.SqlClient.SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "FK_SoftwareUsagePerWeek_Computer". The conflict occurred in database "FNMSInventory", table "dbo.Computer_MT", column 'ComputerID'.

(3) Replies
ChrisG
By Community Manager Community Manager
Community Manager

That's a strange error to see coming from an Azure import process - I can't think of any way that an Azure import would be referencing the FNMSInventory database.

Details appearing in the import log before the message you've shown here will give more context to what is going on - in particular, it should identify the specific step in the import that is failing. Can you check those details and post them here?

(Did my reply solve the question? Click "ACCEPT AS SOLUTION" to help others find answers faster. Liked something? Click "KUDO". Anything expressed here is my own view and not necessarily that of my employer, Flexera.)

Below is the complete logs from where its started - 

The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at ManageSoft.Database.DatabaseCommand.ExecuteNonQuery()
at ManageSoft.Database.Impl.DatabaseLayerBaseSql.Execute(CommandType p_CommandType, String p_CommandText, DatabaseParameter[] p_Parameters)
at ManageSoft.Usage.Importer.Machine.ProcessUsages()
at ManageSoft.Usage.Importer.UsageImporter.Import(String importType, Stream inputStream, Boolean isGzipped, String sourceIdentifier, String targetFilename, MGSLicenseTermCheckResult licenseTermCheckResult, ImportProcessingStats& stats, IDispatcherPreferences preferences)
at ManageSoft.Import.Dispatcher.runImporter_ActualExecution_invokeImporter(ItemProcessingTask processingTask)
ClientConnectionId:c3863899-xxxx-xxxx-xxxx-xxxxxxxxx
Error Number:547,State:0,Class:16
[ERROR 2022-08-05 00:01:27,355 80221320ms Dispatcher ] Failed to run importer
System.Data.SqlClient.SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "FK_SoftwareUsagePerWeek_Computer". The conflict occurred in database "FNMSInventory", table "dbo.Computer_MT", column 'ComputerID'.
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_ComputerUsage_Computer". The conflict occurred in database "FNMSInventory", table "dbo.Computer_MT", column 'ComputerID'.
The statement has been terminated.

ChrisG
By Community Manager Community Manager
Community Manager

That logging doesn't look like it is coming from an Azure import process; this looks like logging that you would see from importing a usage MMI file.

This is likely a side-effect of the following known issue that can affect some devices (although it is not necessarily obvious from the description!): AgentID may be obtained from agent history instead of AgentUniqueID causing usage data to fail to be associated with the expected computer record (IOJ-2233432)

What agent version are you using? To avoid this issue occurring on affected devices you would need to use a version of the agent that has this issue fixed - that is agent version 17.4 or later (from the Flexera One ITAM 2021 R1.4 or FlexNet Manager Suite 2022 R1 release).

(Did my reply solve the question? Click "ACCEPT AS SOLUTION" to help others find answers faster. Liked something? Click "KUDO". Anything expressed here is my own view and not necessarily that of my employer, Flexera.)