MobiControl 15.2.3.1033
Agent 14.4.1.1064
Samsung Device OEM Version QP1A.190711.020.A505FNXXS5BTJ4
Samsung devices updated to the latest firmware are returning a Device APIiD of 840. This value is missing from the database table [MobiControlDB].[dbo].[AndroidDeviceAPILkUp]
Which leads to the following error in the logs.
2020-11-17 18:02:03,527 (0x00000ae0) [ERROR] System.Data.SqlClient.SqlException (0x80131904): The MERGE statement conflicted with the FOREIGN KEY constraint "FK_AndroidDeviceAPI_APIId". The conflict occurred in database "MobiControlDB", table "dbo.AndroidDeviceAPILkUp", column 'APIId'.
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 Soti.MobiControl.Platforms.Android.Devices.DeviceApi.Providers.Implementation.AndroidDeviceAPIDataProvider.AndroidDeviceAPI_Merge_ByDeviceIds(ICollection`1 deviceAPIDatas)
at Soti.MobiControl.Platforms.Android.Devices.SupportedApisUpdateHandler.Handle(Int32 deviceId, IEnumerable`1 supportedApis)
at CSOTIDatabase.UpdateDeviceDSE(CSOTIDatabase* , CDBDevice* device, Boolean aUpdateCustomData)
ClientConnectionId:83d5e0b8-f454-4170-97ab-a19854ab0caf
Error Number:547,State:0,Class:16
This error is preventing those devices from enrolling completely. As this was urgent I had a guess at what should be in that table and came up with the following.
APIId = 840
Description = MCW.enums.DeviceAPI.SamsungKnoxV34
APIName = SamsungKnoxV34
The change works in so far as the devices will now enroll but does not display the proper API name in the web console.
Is there a script that needs to be run to add these new API levels to the database properly?
N.B This appears to be the same issue as
https://discussions.soti.net/thread/enrollment-problem-with-client-14-4-1-1064-on-server-15-1-0-3416/