tags:

views:

1080

answers:

3

We have a .NET application that uses WMI to gather a wide range of information on machines throughout a network, such as reading the Win32_NTLogEvent to see if Symantec Antivirus has written anything. The queries work fine, but after repeatedly running a WMI query "Generic Failure" errors will start coming back. This happens very consistently after approx. 125 calls. Rebooting the machine that we are running the WMI query against, always fixes the error... that is until the next 125 queries are run.

It appears that the repository is fine and we can't locate any log file size issues.

More Info - Ran WMIDiag after getting the error and found -

25607 13:55:38 (1) !! ERROR: WMI ENUMERATION operation errors reported: 2 ERROR(S)!

25608 13:55:38 (0) ** - ROOT/CIMV2, SubClassesOf, '*', 0x80041006 - (WBEM_E_OUT_OF_MEMORY) Not enough memory for the operation.

25609 13:55:38 (0) ** MOF Registration: 'C:\WINNT\SYSTEM32\WBEM\SNMPREG.MOF ' 25610 13:55:38 (0) ** - Root/CIMv2, InstancesOf, 'Win32_PerfFormattedData_PerfProc_Thread', 0x8007000E - Not enough storage is available to complete this operation..

25611 13:55:38 (0) ** MOF Registration: 'C:\WINDOWS\SYSTEM32\WBEM\WMI.MOF'

Anyone ever see this? Ideas?

+1  A: 

We saw the "Generic Failure" error so many times with different WMI queries that we basically came to the conclusion that WMI isn't stable enough to use for anything other than raw administration. Our only solution after months of messing around was to pull all the WMI calls and find replacements in pure API calls. They would always work for a while, and then fail with "Generic Error" (I know this isn't an answer, but it is a shared experience and if anyone has an answer I would be very happy to hear about it).

Kris Erickson
+2  A: 

I believe we have found the issue. To simplify some of our queries we were adding something like 1=1 in the where clause to ease the building of the query. Removed the constant=constant and the one query I was testing with went from 40 seconds to .4 seconds and has run over 10,000 times without generating a generic failure (WBEM_E_OUT_OF_MEMORY).

gmoney
A: 

Windows Remote Management (WinRM) may overcome all these problems. WinRM is the Microsoft implementation of WS-Management Protocol, a standard Simple Object Access Protocol (SOAP)-based.

Sandy