Approver Identification on APM remote has incorrect field length


 Product(s):APM Implementation and Performance Management
 Version(s):7.20
 Environment:N/A
 Area:N/A
 Subarea:N/A

Problem Description

An APM user using APM Remote has found an issue with deploying APM Remote. Through testing, it was found that the size of the Approver Identification attribute size on the mob.checksheet table does not match between the APM Remote database (255 characters) and the APM Foundation database (800 characters).

The attribute contains a list of approvers and is populated via a packaging script. It results in an failure to synchronize APM Remotes:
2023-01-27 00:00:00.0000Z Error   Ivara.Replication.Remote.ClientDirectSQL.DataTransfer [19] Bulk copy failed EXCEPTION OCCURRED:InvalidOperationException The given value of type String from the data source cannot be converted to type nvarchar of the specified target column.    at System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData metadata, Boolean isNull, Boolean& isSqlType, Boolean& coercedToDataFeed)
   at System.Data.SqlClient.SqlBulkCopy.ReadWriteColumnValueAsync(Int32 col)
   at System.Data.SqlClient.SqlBulkCopy.CopyColumnsAsync(Int32 col, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.CopyRowsAsync(Int32 rowsSoFar, Int32 totalRows, CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinued(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsync(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestContinuedAsync(BulkCopySimpleResultSet internalResults, CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestAsync(CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalAsync(CancellationToken ctoken)
   at System.Data.SqlClient.SqlBulkCopy.WriteRowSourceToServerAsync(Int32 columnCount, CancellationToken ctoken)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServer(DataTable table, DataRowState rowState)
   at Ivara.Replication.Remote.ClientDirectSQL.DataTransfer.ImportData(IvaraDataTable incomingTable, DbConnection dbConnection, DateTime startedOn, Boolean isDifferentialInsert)
InvalidOperationException String or binary data would be truncated.    at System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData metadata, Boolean isNull, Boolean& isSqlType, Boolean& coercedToDataFeed)

Solution

This has been reported as a bug, VSTS#1084896. The temporary workaround is have services modify the column in the SQL backup that is deployed to the user's Remotes.

See also

SR 7001542887