IMPORTANT: Allways perform a FULL Backup of the databases before doing anything to it !!!

ALSO: It is advised that you open a case at Microsoft before doing this - directly editing the database is not supported and you may find yourself in an unsupported state if anything goes wrong.

 

You may notice that the configuration fails to get updated on the RMS or a MS and if you see these 3 warning events in the Operations Manager event log, then you are impacted by this issue:

 Log Name: Operations Manager
Source: OpsMgr Config Service
Date: TIMESTAMP
Event ID: 29106
Task Category: None
Level: Warning
Keywords: Classic
User: N/A
Computer: FQDN
Description:
The request to synchronize state for OpsMgr Health Service identified by "SOME_GUID" failed due to the following
exception "Microsoft.Mom.ConfigService.Public.ConfigServiceException: Config service failed to service the request because it is waiting to refresh in memory copy of the database.
at Microsoft.Mom.ConfigService.Engine.ConfigurationEngine.Managers.Synchronize(OnDoSynchronizedWork onDoSynchronizedWork)
at Microsoft.Mom.ConfigService.Engine.ConfigurationEngine.CommunicationHelper.StateSyncRequestTask.Execute(Managers managers)
at Microsoft.Mom.ConfigService.Engine.ConfigurationEngine.CommunicationHelper.StateSyncRequestTask.Run(Guid source, String cookie, Managers managers, IConfigurationDataAccessor dataAccessor, Stream stream, IConnection connection)".

 

 followed by this event:

 Log Name: Operations Manager
Source: OpsMgr Config Service
Date: TIMESTAMP
Event ID: 29206
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: FQDN
Description:
OpsMgr Config Service failed to build in-memory state (snapshot).
Reason:
Microsoft.Mom.ConfigService.Public.ConfigServiceCanNotApplyConfigurationChangesException: Failed to apply configuration changes. ---> System.ApplicationException: Failed to apply configuration change of type 'Addition' for object of type 'Relation' with id 'GUID' timestamped 'TIMESTAMP'. ---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Microsoft.Mom.ConfigService.Common.KeyedDictionary`2.get_Item(K identity)
at Microsoft.Mom.ConfigService.Common.Graph`3.AddEdge(I added, E edgeContext, I fromVertex, I toVertex, OnAttachIEdge onAttachIEdge, Boolean addToVertices)
at Microsoft.Mom.ConfigService.Engine.InstanceSpaceManager.OnRelationChange(ConfigurationChange change)
at Microsoft.Mom.ConfigService.Engine.InstanceSpaceManager.OnChange(ConfigurationChange change)
at Microsoft.Mom.ConfigService.Engine.ConfigurationEngine.DatabaseHelper.OnChange(ConfigurationChange change) at Microsoft.Mom.ConfigService.Engine.ConfigurationEngine.DatabaseHelper.ApplyConfigurationChanges(Boolean isIncremental, ReadOnlyCollection`1 configurationChanges)
--- End of inner exception stack trace ---
at Microsoft.Mom.ConfigService.Engine.ConfigurationEngine.DatabaseHelper.ApplyConfigurationChanges(Boolean isIncremental, ReadOnlyCollection`1 configurationChanges)
--- End of inner exception stack trace ---
at Microsoft.Mom.ConfigService.Engine.ConfigurationEngine.DatabaseHelper.ApplyConfigurationChanges(Boolean isIncremental, ReadOnlyCollection`1 configurationChanges)
at Microsoft.Mom.ConfigService.Engine.ConfigurationEngine.DatabaseHelper.OnConfigurationChange(Boolean isIncremental, ReadOnlyCollection`1 configurationChanges)
at Microsoft.Mom.ConfigService.DataAccess.DatabaseAccessor.NotifyInitialization()
at Microsoft.Mom.ConfigService.DataAccess.DatabaseAccessor.DoNotification(Boolean isInitial, Boolean isIncremental)
at Microsoft.Mom.ConfigService.DataAccess.DatabaseAccessor.PollingThreadMethod()

 

 and then this event:

 Log Name: Operations Manager
Source: OpsMgr Config Service
Date: TIMESTAMP
Event ID: 29100
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: FQDN
Description:
OpsMgr Config Service configuration state has become invalid. This maybe a temporary issue that may be recovered from automatically. If problem persists, it usually indicates a problem with the OpsMgr database.

 

 

So wait ... what's the "actual" error?... Well the actual error is this:

Failed to apply configuration change of type 'Addition' for object of type 'Relation' with id 'GUID' timestamped 'TIMESTAMP'

 

So what you have to do is take a note of all the GUIDs that appear in all 29206 events and using these GUIDs, add them to the @RelIds variable separated by a comma and execute this SQL Query on the operational database:

 DECLARE @RelIds NVARCHAR(MAX)
SET @RelIds = N'
REL_GUID_1,REL_GUID_2,REL_GUID_X'

SELECT
   BME.BaseManagedEntityId AS [BME Id],
   BME.FullName AS [BME FullName],
   BME.Name AS [BME Name],
   BME.DisplayName AS [BME DisplayName],
   BME.IsDeleted AS [BME isDeleted],
   BME.LastModified AS [BME LastModified],
   MT.TypeName AS [MT TypeName],
   MT.IsDeleted AS [MT isDeleted],
   MT.LastModified AS [MT LastModified],
   MP.MPName AS [MP Name],
   MP.MPVersionDependentId AS [MP VersionDependentId],
   MP.MPVersion AS [MP Version],
   MP.MPLastModified AS [MP LastModified],
   R.RelationshipId AS [RelationshipId],
   R.SourceEntityId AS [R SourceEntityId],
   R.TargetEntityId AS [R TargetEntityId],
   R.LastModified AS [R LastModified],
   R.IsDeleted AS [R isDeleted]
FROM BaseManagedEntity AS BME WITH(NOLOCK)
JOIN ManagedType AS MT WITH(NOLOCK)
   ON BME.BaseManagedTypeId = MT.ManagedTypeId
JOIN ManagementPack AS MP WITH(NOLOCK)
   ON MT.ManagementPackId = MP.ManagementPackId
JOIN Relationship AS R WITH(NOLOCK)
   ON (
      R.SourceEntityId = BME.BaseManagedEntityId OR
      R.SourceEntityId = BME.BaseManagedEntityId
   )
WHERE R.RelationshipId IN (
   SELECT value
   FROM dbo.fn_ParseIdListInOrder(@RelIds)
)

 

Using the results out of the list - uninstall and delete out of the console all agents that will appear in the list of results.Then perform a HealthService Cache-Flush on the affected servers:

  1. stop the System Center Management service
  2. rename the \Health Service State\ folder (default in: %ProgramFiles%\System Center Operations Manager 2007\ or on the Cluster Shared Disk on a clustered RMS)
  3. now start the System Center Management service


If any new 29206 events appear, repeat the procedure until we get the 1210 event stating that the configuration has been received, processed and activated.

NOTE: Iff there are any 29106 events from different agents remaining, perform a HealthService Cache-Flush for all of these as well.

 

You should be set to go! :D