On a subset of similarly configured servers I had problems installing the SCOM agent. At the time I installed the client I used the NOAPM=1 switch. However, when an update came out for the client through windows update, the update would fail and the client service would stop. The error when using an interactive installer was “Product: System Center Operations Managers 2012 Server — Error 25211.Failed to install performance counters.. Error Code: -2147024809 (The parameter is incorrect.).”

I noticed when I launched perfmon.exe there were no counters available. Microsoft provided some guidance regarding this issue in KB2554336. The rebuilding of the performance counters yielded unpredictable results. Sometimes after conducting the steps I would have performance counters, other times I would not. I was able to get more reproducible results by using the code provided Reidar Johansen’s Blog post . Even with the performance counters back in the Performance Monitor application the install of the SCOM agent would still fail.

The exact error I saw in the logs is:

InstallAPMPerfCounters: Installing agent perf counters. 
MSI (s) (6C:F4) [10:00:45:160]: Executing op: ActionStart(Name=_Rollback_Inst_APM_PerfCounters.A591E3B4_D228_431D_BF89_99D52C8FFB76,,)
MSI (s) (6C:F4) [10:00:45:160]: Executing op: CustomActionSchedule(Action=_Rollback_Inst_APM_PerfCounters.A591E3B4_D228_431D_BF89_99D52C8FFB76,ActionType=3393,Source=BinaryData,Target=UninstallServerPerfCounters,CustomActionData=C:\Program Files\Microsoft Monitoring Agent\Agent\APMDOTNETAgent\Microsoft.EnterpriseManagement.OperationsManager.Apm.PerformanceCounters.dll)
MSI (s) (6C:F4) [10:00:45:160]: Executing op: ActionStart(Name=_Inst_APM_PerfCounters.A591E3B4_D228_431D_BF89_99D52C8FFB76,,)
MSI (s) (6C:F4) [10:00:45:160]: Executing op: CustomActionSchedule(Action=_Inst_APM_PerfCounters.A591E3B4_D228_431D_BF89_99D52C8FFB76,ActionType=3073,Source=BinaryData,Target=InstallServerPerfCounters,CustomActionData=C:\Program Files\Microsoft Monitoring Agent\Agent\APMDOTNETAgent\Microsoft.EnterpriseManagement.OperationsManager.Apm.PerformanceCounters.dll)
MSI (s) (6C:F0) [10:00:45:176]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI8EC8.tmp, Entrypoint: InstallServerPerfCounters
CAPACK: Extracting custom action to temporary directory: C:\Windows\Installer\MSI8EC8.tmp-\
CAPACK: CLR version v2.0.50727 is installed.
CAPACK: CLR version v2.0.50727 is detected.
CAPACK: CLR version v4.0.30319 is installed.
CAPACK: CLR version v4.0.30319 is detected.
CAPACK: Binding to CLR version v2.0.50727
Calling custom action CAManaged!Microsoft.MOMv3.Setup.MOMv3ManagedCAs.InstallServerPerfCounters
CustomAction _Inst_APM_PerfCounters.A591E3B4_D228_431D_BF89_99D52C8FFB76 returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (6C:F0) [10:00:48:520]: NOTE: custom action _Inst_APM_PerfCounters.A591E3B4_D228_431D_BF89_99D52C8FFB76 unexpectedly closed the hInstall handle (type MSIHANDLE) provided to it. The custom action should be fixed to not close that handle.
Action ended 10:00:49: InstallFinalize. Return value 3.
MSI (s) (6C:F4) [10:00:49:723]: User policy value 'DisableRollback' is 0
MSI (s) (6C:F4) [10:00:49:723]: Machine policy value 'DisableRollback' is 0
MSI (s) (6C:F4) [10:00:49:723]: Executing op: Header(Signature=1397708873,Version=500,Timestamp=1211518986,LangId=0,Platform=589824,ScriptType=2,ScriptMajorVersion=21,ScriptMinorVersion=4,ScriptAttributes=1)
MSI (s) (6C:F4) [10:00:49:723]: Executing op: DialogInfo(Type=0,Argument=0)
MSI (s) (6C:F4) [10:00:49:723]: Executing op: DialogInfo(Type=1,Argument=Microsoft Monitoring Agent)
MSI (s) (6C:F4) [10:00:49:723]: Executing op: RollbackInfo(,RollbackAction=Rollback,RollbackDescription=Rolling back action,RollbackTemplate=[1],CleanupAction=RollbackCleanup,CleanupDescription=Removing backup files,CleanupTemplate=File: [1])
MSI (s) (6C:F4) [10:00:49:723]: Executing op: ActionStart(Name=_Inst_APM_PerfCounters.A591E3B4_D228_431D_BF89_99D52C8FFB76,,)
MSI (s) (6C:F4) [10:00:49:739]: Executing op: ProductInfo(ProductKey={786970C5-E6F6-4A41-B238-AE25D4B91EEA},ProductName=Microsoft Monitoring Agent,PackageName=MOMAgent.msi,Language=0,Version=117516232,Assignment=1,ObsoleteArg=0,ProductIcon=agentgateway.ico,,PackageCode={283192C9-D69D-4E21-A33A-F9AC64EAD2A4},,,InstanceType=0,LUASetting=0,RemoteURTInstalls=0,ProductDeploymentFlags=3)
MSI (s) (6C:F4) [10:00:49:739]: Executing op: ActionStart(Name=_Rollback_Inst_APM_PerfCounters.A591E3B4_D228_431D_BF89_99D52C8FFB76,,)
MSI (s) (6C:F4) [10:00:49:739]: Executing op: CustomActionRollback(Action=_Rollback_Inst_APM_PerfCounters.A591E3B4_D228_431D_BF89_99D52C8FFB76,ActionType=3393,Source=BinaryData,Target=UninstallServerPerfCounters,CustomActionData=C:\Program Files\Microsoft Monitoring Agent\Agent\APMDOTNETAgent\Microsoft.EnterpriseManagement.OperationsManager.Apm.PerformanceCounters.dll)
MSI (s) (6C:B0) [10:00:49:739]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIA0AC.tmp, Entrypoint: UninstallServerPerfCounters
CAPACK: Extracting custom action to temporary directory: C:\Windows\Installer\MSIA0AC.tmp-\
CAPACK: CLR version v2.0.50727 is installed.
CAPACK: CLR version v2.0.50727 is detected.
CAPACK: CLR version v4.0.30319 is installed.
CAPACK: CLR version v4.0.30319 is detected.
CAPACK: Binding to CLR version v2.0.50727
Calling custom action CAManaged!Microsoft.MOMv3.Setup.MOMv3ManagedCAs.UninstallServerPerfCounters
CustomAction _Rollback_Inst_APM_PerfCounters.A591E3B4_D228_431D_BF89_99D52C8FFB76 returned actual error code 1603 but will be translated to success due to continue marking
MSI (s) (6C:B0) [10:00:54:707]: NOTE: custom action _Rollback_Inst_APM_PerfCounters.A591E3B4_D228_431D_BF89_99D52C8FFB76 unexpectedly closed the hInstall handle (type MSIHANDLE) provided to it. The custom action should be fixed to not close that handle.
MSI (s) (6C:F4) [10:00:54:707]: Executing op: ActionStart(Name=_InstallInterceptPerfCounters.A591E3B4_D228_431D_BF89_99D52C8FFB76,,)
MSI (s) (6C:F4) [10:00:54:707]: Executing op: ActionStart(Name=_Rollback_InstallInterceptPerfCounters.A591E3B4_D228_431D_BF89_99D52C8FFB76,,)
MSI (s) (6C:F4) [10:00:54:707]: Executing op: CustomActionRollback(Action=_Rollback_InstallInterceptPerfCounters.A591E3B4_D228_431D_BF89_99D52C8FFB76,ActionType=3393,Source=BinaryData,Target=UninstallAPMPerfCounters,CustomActionData=C:\Program Files\Microsoft Monitoring Agent\Agent\APMDOTNETAgent\)
MSI (s) (6C:00) [10:00:54:707]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIB415.tmp, Entrypoint: UninstallAPMPerfCounters
UninstallAPMPerfCounters: Custom Action Data. C:\Program Files\Microsoft Monitoring Agent\Agent\APMDOTNETAgent\
UninstallAPMPerfCounters: Un-installing agent perf counters. 
UninstallAPMPerfCounters: Successfully un-installed agent perf counters.

KB300956  indicated that the lodctr.exe command could be used to restore counters from an .ini file. I saw that a file existed in C:\Windows\System32 and C:\Windows\SysWow64 called PerfStringBackup.INI. Since my previous attempts to restore the performance counters yielded inconsistent, I tried replacing PerfStringBackup.INI with a copy from another windows 2008R2 install. I issued the following powershell commands:

lodctr.exe c:\Windows\System32\PerfStringBackup.ini
lodctr.exe c:\Windows\SysWOW64\PerfStringBackup.ini
WINMGMT.EXE /RESYNCPERF
restart-service pla
restart-service Winmgmt -force

 

After verifying the counters were present in Performance Monitor, I ran the SCOM agent installer. It completed without error and subsequent updates from Windows Update applied without failiure.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>