Error returned when creating/importing Legal Documents in IT Asset Manager.
Import log shows the following error:
Web Service threw exception CA.Common.Utilities.Exceptions.ValidationException: 1. The application encountered an error while saving an object that references other objects. legaldoc_uuid contains invalid reference key: 5311280C2ED61440B3D4ACF8C23DFDEC.
---> System.Data.SqlClient.SqlException: String or binary data would be truncated.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.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 CA.Common.Data.Connection.Database.ExecuteNonQuery(DbCommand command, Object[] paramValues)
at CA.Common.Data.Connection.Database.ExecuteNonQuery(ParameterizedSql sqlStatement, Object[] paramValues)
at CA.Common.Data.Persistence.Persister.Insert(IEntity entity, Boolean performPreValidate)
at CA.Common.Data.Persistence.Persister.Save(IEntity entity, Boolean performPreValidate)
--- End of inner exception stack trace ---
at CA.Common.Data.Persistence.Persister.Save(IEntity entity, Boolean performPreValidate)
at CA.Common.Data.Persistence.Persister.SaveExtensions(IEntity entity, Boolean performPreValidate)
at CA.Common.Data.Persistence.Persister.Save(IEntity entity, Boolean performPreValidate)
at CA.Common.Business.BusinessEntityImp.Save()
at CA.Applications.Business.LegalDoc.Save()
at WebService.Service.SaveWithNormalization(Byte[] RequestStream)
Note: If you attempt to import the same record a second time, the UUID in the log error is different.
CA IT Asset Manager 17.3 and higher
All supported Operating Systems
Please perform the following to resolve the issue:
1. Take a backup of the MDB database
2. Run the following queries against the MDB database
update arg_field_def set data_size=100 where table_name='aud_ucapme_legaldoc' and field_name='audit_ship_to_location' ;
ALTER TABLE aud_ucapme_legaldoc ALTER COLUMN audit_ship_to_location nvarchar(100);
3. Restart the ITAM services