Failed to register task server. Database context invalidated by inner exception

book

Article ID: 195007

calendar_today

Updated On:

Products

Management Platform (Formerly known as Notification Server) Task Server

Issue/Introduction

When the SMP tries to register to itself as a Task Server, the following error occurs:

Failed to register task server: 1e6157c7-651e-45d7-8b09-e7510d1f1688

Database context invalidated by inner exception
   [Altiris.Database.InvalidDatabaseContextException @ Altiris.Database]
   at Altiris.Database.DatabaseContext`1.ProcessException(Exception exception)
   at Altiris.NS.ResourceManagement.Database.SqlClientConnectionBase.ExecuteSQLNoResults(String query, Int32& rowsAffected)
   at Altiris.NS.ResourceManagement.Database.SqlClientConnectionBase.ExecuteSQLNoResults(String query)
   at Altiris.NS.ResourceManagement.Database.GluedSqlCalls.System.IDisposable.Dispose()
   at Altiris.NS.ResourceManagement.DataClassRowCollection.InventoryLoader.FixResourceUpdateSummaries(DataClass dataClass, NullableDictionary`2 mapResourceInsertInfo, IDataLoaderConnection connection, QueryCacheEntry e)
   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.TaskManagement.ClientTask.AgentWeb.ClientTaskServersHelper.<>c__DisplayClass9_0.<Commit>b__0(IDatabaseContext ctx)
   at Altiris.NS.ContextManagement.AdminDatabaseContext.<>c__DisplayClass31_0`1.<PerformWithDeadlockRetry>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.PerformWithDeadlockRetry(Int32 retries, Boolean startNewTransaction, Nullable`1 isolationLevel, Boolean independentContext, Action`1 action, Action`1 retry)
   at Altiris.TaskManagement.ClientTask.AgentWeb.ClientTaskServersHelper.Commit(DataClassRowCollection& rows, Int32 batchSize)
   at Altiris.TaskManagement.ClientTask.AgentWeb.ClientTaskServersHelper.SetTaskServerStatusOn(Guid notificationServerGuid, Guid taskServerGuid, Guid resourceGuid, Guid secretToken, String version, Int32 buildNumber, Nullable`1 httpPort, Nullable`1 httpsPort, Nullable`1 cemPort, Boolean isWssEnabled, Boolean isWssActive)
   at Altiris.TaskManagement.ClientTask.AgentWeb.ClientTaskServersHelper.RegisterTaskServer(Guid notificationServerGuid, Guid taskServerGuid, Guid resourceGuid, Guid secretToken, String version, Int32 buildNumber, Nullable`1 httpPort, Nullable`1 httpsPort, Nullable`1 cemPort, Boolean isWssEnabled, Boolean isWssActive)

Internal Query Processor Error: The query processor encountered an unexpected error during execution (HRESULT = 0x80040e19).
   [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.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
   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.ResourceManagement.Database.SqlClientConnectionBase.ExecuteSQLNoResults(String query, Int32& rowsAffected)

SQL Exception details: code=8630, line=61, procedure=spResourceUpdateSummary

Exception logged from: 
   at Altiris.TaskManagement.ClientTask.AgentWeb.ClientTaskServersHelper.RegisterTaskServer(System.Guid, System.Guid, System.Guid, System.Guid, String, Int32, System.Nullable<Int32>, System.Nullable<Int32>, System.Nullable<Int32>, Boolean, Boolean)
   at Altiris.TaskManagement.Data.NotificationServerLocalConnection.Altiris.TaskManagement.Common.ClientTask.Communication.IInternalNotificationServerConnection.RegisterTaskServer(System.Guid, System.Guid, String, Int32, System.Nullable<Int32>, System.Nullable<Int32>, System.Nullable<Int32>, Boolean, Boolean, Altiris.TaskManagement.Common.Configuration.TaskServerConfiguration&)
   at Altiris.ClientTask.Server.ClientTaskServer.RegisterTaskServer(Version)
   at Altiris.ClientTask.Server.ClientTaskServer.ReRegister(Version)
   at Altiris.ClientTask.Server.ClientTaskServer.ProcessRegistrationThreadProc()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, Object)
   at System.Threading.ThreadHelper.ThreadStart()

User [RFOC\srvc_altiris], Auth [RFOC\Srvc_Altiris], AppDomain [AtrsHost.exe]

-----------------------------------------------------------------------------------------------------
Date: 07/07/2020 13:55:48, Tick Count: 71096625 (19:44:56.6250000), Size: 7,75 KB
Process: AtrsHost (5836), Thread ID: 3, Module: Altiris.TaskManagement.dll
Priority: 1, Source: Altiris.TaskManagement.ClientTask.AgentWeb.ClientTaskServersHelper.RegisterTaskServer

------------------------------------------------------------------------------

From what we can tell, there is a failure under "procedure=spResourceUpdateSummary" as mentioned in the log excerpt above.

According to the SQL logs, this failure occurred:

CPerIndexMetaQS::ErrorAbort - Index corruption

Cause

Unknown. Under Investigation.

Environment

ITMS 8.5 RU3

Resolution

This issue has been reported to the Symantec Development team.

Few suggestions to try in the meantime:

  1. Make sure you have a SQL Maintenance plan running against your ITMS database. 
  2. Rebuild and reorganize indexes for the tables "Inv_Client_Task_Servers" and "ResourceUpdateSummary":
    a) On SQL Server Management Studio, navigate to the mentioned tables.
    b) Expand the tree and right-click on "Indexes"
    c) You should see a menu window with "Disable All". Run it.
    d) Then select "Rebuild All". Run it.
    e) Then select "Reorganize All". Run it.


    Note: Please disable indexes first by "Disable All" and then rebuild indexes, they will be re-enabled after rebuild

    f) Go ahead and try to register the Task Server again and see if the error is gone.
  3. If the above steps didn't help, try the following:

    1) SQL actions:

    drop table Inv_Client_Task_Servers
    delete from DataClass where Guid='b68b9966-f19c-4a70-999d-7e7d95a2757a'

    2) Execute actions in cmd.exe:

    2.1) cd "C:\Program Files\Altiris\Notification Server\Bin" --use the proper drive letter for your current installation drive

    2.2) AeXConfig.exe /configure "C:\Program Files\Altiris\TaskManagement\Config\TaskManagement.config"  --use the proper drive letter for your current installation drive

    2.3) Restart AtrsHost service on SMP Server to see the result of our Actions and this will enforce all the other Task Servers to re-register within SMP Server

Attachments