18 Apr 2011

SCOM 2007 R2 - The service threw an unknown exception


Database connection related issue(when you try to install an agent):
The service threw an unknown exception. See inner exception...




Here's the full text of the error from Operations Manager log on RMS:

eventid 26319
An exception was thrown while processing InsertAgentPendingActions for session id uuid:4b89e0b0-c7ec-4179-96ef-4eb698b90181;id=1483.
Exception Message: Error 777980450, severity 16, state 1 was raised, but no message with that error number was found in sys.messages. If error is larger than 50000, make sure the user-defined message is added using sp_addmessage.
Full Exception: System.Data.SqlClient.SqlException: Error 777980450, severity 16, state 1 was raised, but no message with that error number was found in sys.messages. If error is larger than 50000, make sure the user-defined message is added using sp_addmessage.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
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)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.EnterpriseManagement.Mom.DataAccess.SqlRetryHandler.ExecuteReader(ExecuteArguments executeArguments, QueryResults& queryResults)
at Microsoft.EnterpriseManagement.Mom.DataAccess.SqlRetryHandler.Execute[T](ExecuteArguments executeArguments, RetryPolicy retryPolicy, GenericExecute`1 genericExecute)
at Microsoft.EnterpriseManagement.Mom.DataAccess.SqlRetryHandler.ExecuteReader(SqlCommand sqlCommand, IList`1 prologEpilogList, IList`1 projection, QueryDefinition queryDefinition, RetryPolicy retryPolicy)
at Microsoft.EnterpriseManagement.Mom.DataAccess.QueryRequest.Execute(SqlNotificationRequest sqlNotificationRequest)
at Microsoft.EnterpriseManagement.Mom.ServiceDataLayer.AgentManagement.InsertAgentPendingActions(IList`1 agentPrincipalNames, IList`1 pendingActionDataXmls, String managementServername, Int32 pendingActionType)
at Microsoft.EnterpriseManagement.Mom.ServiceDataLayer.SdkDataAccess.InsertAgentPendingActions(IList`1 agentPrincipalNames, IList`1 pendingActionDataXml, String managementServerPrincipalName, Int32 pendingActionType)
at Microsoft.EnterpriseManagement.Mom.ServiceDataLayer.SdkDataAccessTieringWrapper.InsertAgentPendingActions(IList`1 agentPrincipalNames, IList`1 pendingActionDataXml, String managementServerPrincipalName, Int32 pendingActionType)
at Microsoft.EnterpriseManagement.Mom.ServiceDataLayer.SdkDataAccessExceptionTracingWrapper.InsertAgentPendingActions(IList`1 agentPrincipalNames, IList`1 pendingActionDataXml, String managementServerPrincipalName, Int32 pendingActionType)



eventid 33333
Data Access Layer rejected retry on SqlError:
Request: AgentPendingActionProcessChange -- (AgentName=AGENTNAME), (PendingActionType=1), (AgentPendingActionId=7fca8901-1e40-7c8a-b96c-ec282e8201f2), (ManagementServerName=SERVERNAME), (PendingActionData=<PendingActionInformation xmlns="urn:Microsoft.EnterpriseManagement.Mom.PendingActionInformation"><AgentDnsName /><AgentOperatio...), (RETURN_VALUE=1)
Class: 16
Number: 18054
Message: Error 777980450, severity 16, state 1 was raised, but no message with that error number was found in sys.messages. If error is larger than 50000, make sure the user-defined message is added using sp_addmessage.

After investigation, I've found that OperationsManager db and OperationsManagerDW db were restored from backup last night.

This issue happens because of some specific configuration information is stored in the Master database. So it can happen when you migrate your bases to another server, backup and restore.

 Here's the list of errors and fix scripts for such kind of sql-related errors:
-----------------------------------------
--    MOMv3 messages are 77798xxxx     --
-----------------------------------------


-----------------------------------------------
-- Discovery range: 77798-0000 to 77798-0049 --
-----------------------------------------------
-- Managed type doesn't exist.
EXECUTE sp_addmessage @msgnum = 777980000, @msgtext = N'The specified managed type doesn''t exist.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Relationship type doesn't exist.
EXECUTE sp_addmessage @msgnum = 777980001, @msgtext = N'The specified relationship type doesn''t exist.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Source entity of the relationship doesn't exist.
EXECUTE sp_addmessage @msgnum = 777980002, @msgtext = N'The specified relationship doesn''t have a valid source.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Target entity of the relationship doesn't exist.
EXECUTE sp_addmessage @msgnum = 777980003, @msgtext = N'The specified relationship doesn''t have a valid target.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Discovery data from invalid managed entity is dropped.
EXECUTE sp_addmessage @msgnum = 777980004, @msgtext = N'Discovery data has been received from a rule targeted to a non-existent entity. The discovery data will be dropped.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Invalid relationship rejected by cycle detection.
EXECUTE sp_addmessage @msgnum = 777980005, @msgtext = N'Invalid relationship rejected by cycle detection.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Discovery data generated by invalid connector.
EXECUTE sp_addmessage @msgnum = 777980006, @msgtext = N'Discovery data generated by invalid connector:%s.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Discovery data generated by invalid rule, task, discovery.
EXECUTE sp_addmessage @msgnum = 777980007, @msgtext = N'Discovery data generated by invalid discovery source. Id:%s.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Health service should not generate data about this managed object.
EXECUTE sp_addmessage @msgnum = 777980008, @msgtext = N'Health service ( %s ) should not generate data about this managed object ( %s ).', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Health service should not generate data about this relationship object.
EXECUTE sp_addmessage @msgnum = 777980009, @msgtext = N'Health service ( %s ) should not generate data about this relationship object between ( %s and %s ).', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

---------------------------------------------------------------------
-- Availability & Maintenance Mode range: 77798-0050 to 77798-0099 --
---------------------------------------------------------------------

-- Can not set availability on a health service that doesn't exist.
EXECUTE sp_addmessage @msgnum = 777980050, @msgtext = N'Cannot set availability on a health service that doesn''t exist.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Managed entity is not currently in maintenance mode
EXECUTE sp_addmessage @msgnum = 777980051, @msgtext = N'Managed entity is not currently in maintenance mode.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- End time has to be greater than start time
EXECUTE sp_addmessage @msgnum = 777980052, @msgtext = N'The maintenance mode scheduled end time has to be greater than the start time.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- ScheduledEndTime can't be in the past
EXECUTE sp_addmessage @msgnum = 777980053, @msgtext = N'Cannot set scheduled end time to a time in the past', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO


-----------------------------------------------
-- UserRole range: 77798-0100 to 77798-0199 --
-----------------------------------------------

-- UserRoleAdministratorAlreadyExistsException
EXECUTE sp_addmessage @msgnum = 777980100, @msgtext = N'A user role with the administrator profile already exists. Cannot create another user role with the same profile.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- UserRoleSystemDeleteException
EXECUTE sp_addmessage @msgnum = 777980101, @msgtext = N'Cannot delete system user roles.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- UserRoleSystemException
EXECUTE sp_addmessage @msgnum = 777980102, @msgtext = N'Cannot create user roles with IsSystem specified.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- NULL is not a valid Group Id for the Scope specified
EXECUTE sp_addmessage @msgnum = 777980103, @msgtext = N'NULL is not a valid GroupId for the Scope specified.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- NULL is not a valid TypeId for the Scope specified
EXECUTE sp_addmessage @msgnum = 777980104, @msgtext = N'NULL is not a valid TypeId for the Scope specified.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO



------------------------------------------------------
-- Operational Data range: 77798-0200 to 77798-0299 --
------------------------------------------------------

-- Invalid Timestamp
EXECUTE sp_addmessage @msgnum = 777980200, @msgtext = N'Request to update alert ignored due to invalid TimeModified', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Invalid Timestamp
EXECUTE sp_addmessage @msgnum = 777980201, @msgtext = N'Request to update alert ignored due to mismatch in BaseManagedEntityId', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Invalid MonitorId
EXECUTE sp_addmessage @msgnum = 777980202, @msgtext = N'Cannot create Alert. Invalid MonitorId.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Invalid RuleId
EXECUTE sp_addmessage @msgnum = 777980203, @msgtext = N'Cannot create Alert. Invalid RuleId.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- NULL category in Monitor
EXECUTE sp_addmessage @msgnum = 777980204, @msgtext = N'Cannot create Alert. Monitor Category cannot be NULL', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- NULL category in Rule
EXECUTE sp_addmessage @msgnum = 777980205, @msgtext = N'Cannot create Alert. Rule Category cannot be NULL.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Trying to update Alert that doesn't exist in the table.
EXECUTE sp_addmessage @msgnum = 777980206, @msgtext = N'No alert matches the given AlertId.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Alert resolution state shortcut key has to be unique.
EXECUTE sp_addmessage @msgnum = 777980207, @msgtext = N'Alert resolution state shortcut key has to be unique.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- A predefined alert resolution state can not be updated.
EXECUTE sp_addmessage @msgnum = 777980208, @msgtext = N'A predefined alert resolution state can not be updated.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Only the action account secure data type can be associated with the action account secure reference.
EXECUTE sp_addmessage @msgnum = 777980209, @msgtext = N'Action account secure data must be paired with the action account secure reference.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Cannot associated a health service with a credential that has no password. This happens when the secure data object was inserted by a health service.
EXECUTE sp_addmessage @msgnum = 777980210, @msgtext = N'-- Cannot associated a health service with a credential that has no password. This happens when the secure data object was inserted by a health service.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

------------------------------------------------------
-- ManagementPack Data range: 77798-0300 to 77798-0399 --
------------------------------------------------------

-- Duplicate Name For ManagedType
EXECUTE sp_addmessage @msgnum = 777980300, @msgtext = N'ManagementPack cannot be imported because it contains a Managed Type with the same name as an existing type: %s', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Duplicate Name For RelationshipType
EXECUTE sp_addmessage @msgnum = 777980301, @msgtext = N'ManagementPack cannot be imported because it contains a Relationship Type with the same name as an existing type: %s', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Update specified, but no prior version of Management Pack exists
EXECUTE sp_addmessage @msgnum = 777980302, @msgtext = N'ManagementPack cannot be updated because it has not installed', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Update specified, but no ManagementPack is sealed
EXECUTE sp_addmessage @msgnum = 777980303, @msgtext = N'ManagementPack cannot be updated because it is sealed', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

--  Update specified, but  Timestamp is too old
EXECUTE sp_addmessage @msgnum = 777980304, @msgtext = N'ManagementPack cannot be updated because TimeModified is not the latest', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

--  Update specified, but  Timestamp is too old
EXECUTE sp_addmessage @msgnum = 777980305, @msgtext = N'TypeCacheSelect failed due to update of data during transaction', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

--  Update specified, but  Timestamp is too old
EXECUTE sp_addmessage @msgnum = 777980306, @msgtext = N'ManagementPack cannot be updated because %s has been modified more recently.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

------------------------------------------------------
-- Connectors & MCF range: 77798-0400 to 77798-0449 --
------------------------------------------------------
-- Connector not initialized
EXECUTE sp_addmessage @msgnum = 777980400, @msgtext = N'Cannot perform operation: Connector does not exist or is not initialized', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Connector does not own object
EXECUTE sp_addmessage @msgnum = 777980401, @msgtext = N'Cannot perform operation: Connector does not own object', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Connector is alredy in given IsInitialized state
EXECUTE sp_addmessage @msgnum = 777980402, @msgtext = N'Connector is already the given IsInitialized State', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Connector is not unitialized
EXECUTE sp_addmessage @msgnum = 777980403, @msgtext = N'Cannot perform operation: Connector does not exist or is not Uninitialized', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Collision in setting the connector id.
EXECUTE sp_addmessage @msgnum = 777980404, @msgtext = N'A collision happened while setting the connector id of alerts.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO


------------------------------------------------------
-- Agent management: 77798-0450 to 77798-0499 --
------------------------------------------------------
-- Connector not initialized
EXECUTE sp_addmessage @msgnum = 777980450, @msgtext = N'There is an existing pending action for agent %s. You must process this pending action before a new pending action can be inserted.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO


I've taken these fixes from Madd Goedtel blog

In my case it is  777980450 error. 
I fixed it by running the following query to Operations Manager db:

-- Connector not initialized
EXECUTE sp_addmessage @msgnum = 777980450, @msgtext = N'There is an existing pending action for agent %s. You must process this pending action before a new pending action can be inserted.', @severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO



No comments:

Post a Comment