New clients failed to update configuration (Arithmetic overflow error converting IDENTITY to data type int.)
search cancel

New clients failed to update configuration (Arithmetic overflow error converting IDENTITY to data type int.)

book

Article ID: 260560

calendar_today

Updated On:

Products

Server Management Suite Client Management Suite IT Management Suite

Issue/Introduction

Error message on client agent: failed to update config specified resource is not ready. Error code: 0x80042100

Error message in Notification Server logs:

Failed to load inventory.

Database context invalidated by inner exception
   [Altiris.Database.InvalidDatabaseContextException @ Altiris.Database]
   at Altiris.Database.DatabaseContext`1.ProcessException(Exception exception)
   at Altiris.NS.DataAccessLayer.Implementation.Altiris_NS_ResourceManagement_DataAccessLayerResourceManagementDataAccessLayer.spResourceGenerateHistorySnapshot(Guid ResourceGuid, Guid InventoryClassGuid, String currentUser)
   at Altiris.NS.ResourceManagement.DataClassRowCollection.InventoryLoader.GenerateHistorySnapshots(DataClass dataClass, ICollection`1 resources)
   at Altiris.NS.ResourceManagement.DataClassRowCollection.InventoryLoader.Update(DataClass dataClass, DataClassRows rows, NullableDictionary`2 mapResourceInsertInfo, Boolean historyEnabled, Dictionary`2 resourceGuidToResourceTypeGuid, IDataLoaderConnection connection, Guid& updateInstanceGuid, List`1& fixedResources)
   at Altiris.NS.ResourceManagement.DataClassRowCollection.Loader.Update(DataClass dataClass, DataClassRows rows, NullableDictionary`2 mapResourceInsertInfo, Boolean historyEnabled, Dictionary`2 resourceGuidToResourceTypeGuid, IDataLoaderConnection connection)
   at Altiris.NS.ResourceManagement.DataClassRowCollection.TryCommit(IDataLoaderConnection connection, Boolean isInvAeXAcClientAgentGuid, ICollection`1 resourcesToActivate, ICollection`1 skipResources)
   at Altiris.NS.ResourceManagement.DataClassRowCollection.<>c_DisplayClass25_0.<Commit>b_0(IDatabaseContext ctx)
   at Altiris.NS.ContextManagement.AdminDatabaseContext.<>c_DisplayClass26_0`1.<PerformTransactedDeadlockRetry>b_0(IDatabaseContext ctx)
   at Altiris.Database.DatabaseContext`1.RetryAction(Int32 retries, Boolean transacted, Getter`1 getContext, Action`1 action, Action`1 retry, DeadlockRetryArgs& re, Exception& exception, Boolean inTransaction)
   at Altiris.Database.DatabaseContext`1.PerformWithDeadlockRetryHelper(Int32 retries, Boolean inTransaction, Getter`1 getContext, Action`1 action, Action`1 retry, Boolean transacted)
   at Altiris.Database.DatabaseContext`1.PerformTransactedDeadlockRetry(Int32 retries, Getter`1 getContext, Action`1 action, Action`1 retry)
   at Altiris.NS.ResourceManagement.DataClassRowCollection.Commit(IDataLoaderConnection connection)
   at Altiris.NS.ResourceManagement.DataClassRowCollection.OnCommitHandler(DCCommitEventArgs commitArgs)
   at Altiris.Database.DatabaseContext`1.RetryAction(Int32 retries, Boolean transacted, Getter`1 getContext, Action`1 action, Action`1 retry, DeadlockRetryArgs& re, Exception& exception, Boolean inTransaction)
   at Altiris.Database.DatabaseContext`1.PerformWithDeadlockRetryHelper(Int32 retries, Boolean inTransaction, Getter`1 getContext, Action`1 action, Action`1 retry, Boolean transacted)
   at Altiris.Database.DatabaseContext`1.PerformWithDeadlockRetry(Int32 retries, Boolean startNewTransaction, Nullable`1 isolationLevel, Boolean independentContext, Action`1 action, Action`1 retry)
   at Altiris.NS.ResourceManagement.DataClassRowCollection.CommitData(IDataLoaderConnection connection)
   at Altiris.NS.ResourceManagement.DataClassImporter.InventoryDataLoader.CommitData(ImmutableDataRowCacheTransaction imu, DataClassRowCollection rows)
   at Altiris.NS.ResourceManagement.DataClassImporter.InventoryDataLoader.ServeDataEnd()
   at Altiris.NS.ResourceManagement.DataClassImporter.InventoryDataLoader.Load(CodeProfiler cp)
   at Altiris.NS.ResourceManagement.DataClassImporter.InventoryDataLoader.Load(DataClass dataClass, XmlReader reader, Guid resourceGuidOverride, ProcessingDirective processingDirective, ResourceImporter importer)
   at Altiris.NS.ResourceManagement.DataClassImporter.InventoryLoader.ServeInventoryDataClassDataNode()
   at Altiris.NS.ResourceManagement.DataClassImporter.InventoryLoader.Load(CodeProfiler cp)
   at Altiris.NS.ResourceManagement.DataClassImporter.LoadInventory(XmlReader reader, Boolean processData, Boolean forceSchemaValidation, Guid resourceGuidOverride)

Arithmetic overflow error converting IDENTITY to data type int.
Arithmetic overflow occurred.
   [System.Data.SqlClient.SqlException @ .Net SqlClient Data Provider]
   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 Altiris.NS.DataAccessLayer.Implementation.Altiris_NS_ResourceManagement_DataAccessLayerResourceManagementDataAccessLayer.spResourceGenerateHistorySnapshot(Guid ResourceGuid, Guid InventoryClassGuid, String currentUser)

SQL Exception details: code=8115, line=36, procedure=spCaptureResourceHistory

Exception logged from: 
   at Altiris.NS.ResourceManagement.DataClassImporter.LoadInventory(System.Xml.XmlReader, Boolean, Boolean, System.Guid)
   at Altiris.NS.StandardItems.Messaging.InventoryCaptureItem.ImportDataClassNode(Altiris.NS.ResourceManagement.MessagingResource, System.Xml.XmlTextReader, Altiris.NS.ResourceManagement.ResourceImporter, Altiris.NS.ResourceManagement.DataClassImporter)
   at Altiris.NS.StandardItems.Messaging.InventoryCaptureItem.ImportDataClassData(Altiris.NS.ResourceManagement.MessagingResource, System.Xml.XmlTextReader, Altiris.NS.ResourceManagement.ResourceImporter)
   at Altiris.NS.StandardItems.Messaging.InventoryCaptureItem.OnMessageImpl(String, Boolean)
   at Altiris.NS.StandardItems.Messaging.InventoryCaptureItem.OnMessageInternal(String, Boolean)
   at Altiris.NS.ClientMessaging.EventQueueDispatcher.DispatchWithinContext(String, Boolean, Altiris.NS.ItemManagement.IItem, Altiris.NS.ItemManagement.IItemMessaging, Altiris.NS.ClientMessaging.EventQueueDispatcher+MessageHeader)
   at Altiris.NS.ClientMessaging.EventQueueDispatcher.DispatchWithinContext(Int32, String, Boolean, Int64, Int64, Altiris.NS.ClientMessaging.EventQueueDispatcher+MessageHeader)
   at Altiris.NS.ClientMessaging.EventQueueDispatcher.TryDispatch(Int32, String, Boolean, Int64, Int64)
   at Altiris.NS.ClientMessaging.EventQueueDispatcher.PerformDispatch(Altiris.NS.ClientMessaging.EventQueueDispatcher+DispatchSlot, Boolean&)
   at Altiris.NS.ClientMessaging.EventQueueDispatcher.WorkerDispatchStep(Altiris.NS.ClientMessaging.EventQueueDispatcher+DispatchSlot, Altiris.Common.Threading.IAutoCallContextSnapshot)
   at Altiris.NS.ClientMessaging.EventQueueDispatcher.PerformDispatchSlotLoop(Altiris.NS.ClientMessaging.EventQueueDispatcher+DispatchSlot, String&)
   at Altiris.NS.ClientMessaging.EventQueueDispatcher.PerformDispatchSlotLoop(Altiris.NS.Logging.EventLog+IMeasureOperation, Altiris.NS.ClientMessaging.EventQueueDispatcher+DispatchSlot)
   at Altiris.NS.ClientMessaging.EventQueueDispatcher.DispatchSlotThreadProc(Object)
   at System.Threading.ThreadHelper.ThreadStart(Object)

-----------------------------------------------------------------------------------------------------
Process: AeXSvc (1608), Thread ID: 348, Module: Altiris.NS.dll
Priority: 1, Source: Altiris.NS.ResourceManagement.DataClassImporter.LoadInventory

Environment

Release: 8.5 

Cause

We traced the cause to the Inv_Aex_AC_Location (Basic Inventory Dataclass) Resource History settings combined with environmental factors that caused Delta Basic Inventories to run every few minutes.

The ResourceInventoryHistory table utilizes a SnapshotID data filed with a datatype set to INT. The INT datatype is limited to values as high as 2,147,483,648. The SnapshotID field is used to link incoming data to other dataclasses. Because of an environmental issue, the DNS-related data was changing many times every hour, the agent sent a Delta Basic Inventory with the Inv_Aex_AC_Location dataclass data. Because Resource History was enabled for this dataclass, the data was written to the InvHIST_Aex_AC_Location table, and so a record of this was written to the  ResourceInventoryHistory table with a new SnapshotID, eventually maxing out the INT defined data type. 

Resolution

Note: Before performing any change to the database such as is listed below, perform a backup of the database. 

Disabled Resource History settings for Inv_Aex_AC_Location, and then truncated the ResourceInventoryHistory table. 

 

Note: There were other dataclasses selected for resource history collection contributing to this problem, so we reviewed which ones may be needed and disabled many without an obvious need.

Resource history tables, which start with InvHIST, have all incoming data added to the table - it does not replace old data, therefore they can grow quite large depending on which dataclass is configured for retention. 

This functionality is optional and most often seen in industries with regulatory requirements to retain historical data.