Orleans: After upgrading from 2.4.5 to 3.1.2,A warning appears:Error initializing CPU & Memory perf counters

Created on 12 Mar 2020  Â·  15Comments  Â·  Source: dotnet/orleans

This is the log:

warn: Orleans.Statistics.PerfCounterEnvironmentStatistics[100719]
Error initializing CPU & Memory perf counters - you need to repair Windows perf counter config on this machine with 'lodctr /r' command
System.Runtime.InteropServices.MarshalDirectiveException: Cannot marshal 'parameter #3': Cannot marshal a string by-value with the [Out] attribute.
at System.StubHelpers.StubHelpers.ThrowInteropParamException(Int32 resID, Int32 paramIdx)
at System.Management.ManagementPath.GetWbemPath(IWbemPath wbemPath)
at System.Management.ManagementPath.GetWbemPath()
at System.Management.ManagementPath.get_Path()
at System.Management.ManagementScope.set_prvpath(ManagementPath value)
at System.Management.ManagementScope._Clone(ManagementScope scope, IdentifierChangedEventHandler handler)
at System.Management.ManagementScope._Clone(ManagementScope scope)
at System.Management.ManagementObjectSearcher..ctor(ManagementScope scope, ObjectQuery query, EnumerationOptions options)
at Orleans.Statistics.PerfCounterEnvironmentStatistics.InitCpuMemoryCounters()

Most helpful comment

All 15 comments

Have you tried running the lodctr /r command?

Already run but did not solve the problem.

perferr
OrleansDashboard cannot view memory usage.

I think this issue is more urgent.

Is this on your workstation or laptop? Last time I've seen this one, I've fixed it by updating the System.Diagnostics.PerformanceCounter package to the latest version, 4.7 in my case. The Microsoft.Orleans.TelemetryConsumers.Counters package declares a dependency on 4.5 but it looks like that has become outdated against the ever-changing Windows 10. I've seen no such issues on stable server boxes yet though.

Windows Server 2012R2 , Windows Server 2016 has this problem.

BTW .NetCore version is 3.1,Orleans version is 3.1.2.
Windows Server 2012R2 , Windows Server 2016,Windows10 all has this warn.

My case is upgrading System.Management to 4.7.0, on a Windows 10 1909 box so as to fix this issue.

@windperson Thank you very much.
After Upgrading System.Management to 4.7.0, the problem was resolved.

@ReubenBond I suggest that the Orleans team can upgrade the Microsoft.Orleans.OrleansTelemetryConsumers.Counters version to System.Management (> = 4.5.0) to System.Management (> = 4.7.0)

@JorgeCandeias Thanks.
System.Diagnostics.PerformanceCounter also need >=4.7.0

@HermesNew are you able to open a PR? We can include it in 3.1.3

Actually, I will update it. I'll link the PR here, so please let me know if it looks right to you.

OK,good job.Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bobanco picture bobanco  Â·  3Comments

bwanner picture bwanner  Â·  5Comments

luciobemquerer picture luciobemquerer  Â·  4Comments

scharada picture scharada  Â·  3Comments

Vlad-Stryapko picture Vlad-Stryapko  Â·  3Comments