none
Assessment fails with SQLException "string...would be truncated" RRS feed

  • Question

  • I have installed MAP toolkit v8.5 on a virtual Windows Server 2008 Enterprise running SQL Server 2008. Setup went all fine but when I try to run tutorial described in MAP_Demo_Exercises assessment fails with SQL exception below (found in log).

    Help appreciated!

    <2013-07-29 15:03:13.21 AssessInventoryWorker@Analyzer,E> RunAssessments() - Assessment threw an exception:
       |Microsoft.AssessmentPlatform.MapException: Caught SqlException running the stored procedure [Unix_Assessment].[CalculateHardwareInventoryCore]. ---> 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.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)
       |   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)
       |   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
       |   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
       |   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       |   at Microsoft.AssessmentPlatform.DataAccess.DataAccessCore.ExecuteStoredProcHelper(String storedProcName, Object[] parameters)
       |   at Microsoft.AssessmentPlatform.DataAccess.DataAccessCore.DoWorkInTransaction[T](Nullable`1 isolationLevel, String onSqlExceptionMessage, TransactionWorkCallback`1 callback)
       |   --- End of inner exception stack trace ---
       |   at Microsoft.AssessmentPlatform.DataAccess.DataAccessCore.DoWorkInTransaction[T](Nullable`1 isolationLevel, String onSqlExceptionMessage, TransactionWorkCallback`1 callback)
       |   at Microsoft.AssessmentPlatform.Analytics.Assessments.StoredProcAssessment.RunAssessment(ThreadSafeFlag continueProcessingFlag, SecureString connectionString)
       |   at Microsoft.AssessmentPlatform.Analytics.Analyzer.RunAssessments(IEnumerable`1 assessments)

    Monday, July 29, 2013 1:19 PM

All replies

  • I know this is from 4 years ago, but I found the fix. (Mine was MAP 9.6.5.0)

    Similar to the issue with VMWare data(1), there's a column that needs expanded.

    If you open the MapToolKit db with SQL Server Management Studio (whichever flavor you need), go to the database that matches the one you created for your inventory.

    Open a SQL Query window

        alter table AllDevices_Assessment.HardwareInventoryCore alter column CurrentOperatingSystem nvarchar(256) NULL

    This will expand the "CurrentOperatingSystem" column from 128 characters to 256 - and is what I needed to make my assessment refresh work.

    -------

    (1)  If you are wondering about the VMWare data comment, it's the same kind of issue

    Error:

    Microsoft.AssessmentPlatform.MapException: Caught SqlException running the stored procedure [AllVirt_Assessment].[AssessmentHostGuestRelationships]

    In this case, it's the OperatingSystem column in the Core_Inventory.Devices table that is too small for the data.

    The SQL query to fix that one is 

        alter table Core_Inventory.Devices alter column OperatingSystem nvarchar(256) NULL

    Hope this helps someone else!


    Tuesday, June 13, 2017 3:45 PM