Error 80040154 during preagent install

  • 7001023
  • 24-Jul-2008
  • 27-Apr-2012

Environment

Novell ZENworks 10 Configuration Management

Situation

Preagent package installation fails with error 80040154 for unregistered clsid.
 
ERROR (from Application Event log):
 
[ZENPreAgent.AgentMain.serviceThreadMethod()]
Unexpected Exception occured: COM object with CLSID {4590F811-1D3A-11D0-891F-00AA004B2E24} is either not valid or not registered.
   at System.Management.ManagementScope.InitializeGuts(Object o)
   at System.Management.ManagementScope.Initialize()
   at System.Management.ManagementObject.Initialize(Boolean getObject)
   at System.Management.ManagementBaseObject.get_Properties()
   at System.Management.ManagementBaseObject.GetPropertyValue(String propertyName)
   at System.Management.ManagementBaseObject.get_Item(String propertyName)
   at ZENPreAgent.ServiceControllerEx.get_StartMode()
   at ZENPreAgent.FirewallHandler_win._isFirewallEnabled()
   at ZENPreAgent.FirewallHandler.openFirewallPort(Int32 port, Boolean openTCP, Boolean openUDP)
   at ZENPreAgent.FirewallHandler.openFirewallPort(Int32 port)
   at ZENPreAgent.AgentWin._openFirewallPort(Int32 port)
   at ZENPreAgent.AgentMain.serviceThreadMethod()
 

Resolution

The dlls and exe com files for the WMI (Windows Management Instrumentation) service need to be registered properly.  Search for the CLSID in the error against those listed in the registry to ensure whether the com control is registered properly. 
 
If not, they need to be registered (regsvr32 )
 
For example, on XP SP2 the control files are in c:\windows\system32\wbem
 
cd c:\windows\system32\wbem
for %%i in (*.dll) do regsvr32 -s %%i
for %%i in (*.exe) do regsvr32 -s %%i
net stop winmgmt
net start winmgmt

 
The WMI service needs to be restarted.
 
See Microsoft website for more information about the WMI service and associated com files.
 

Additional Information

The WMI service is a requirement for the ZENworks preagent install.
 
Use wbemtest to test the service.  If connect fails with error 80040154 this verifies the problem.
 
If the WMI service is disabled, the error is different.  In that case wbemtest returns error 0x80070422 and the event log from ZENPreagent error is:
 
[System.Threading.ThreadHelper.ThreadStart_Context(Object state)
]
Unexpected Exception occured: The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. (Exception from HRESULT: 0x80070422)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Management.ManagementScope.InitializeGuts(Object o)
   at System.Management.ManagementScope.Initialize()
   at System.Management.ManagementObject.Initialize(Boolean getObject)
   at System.Management.ManagementBaseObject.get_Properties()
   at System.Management.ManagementBaseObject.GetPropertyValue(String propertyName)
   at System.Management.ManagementBaseObject.get_Item(String propertyName)
   at ZENPreAgent.ServiceControllerEx.get_StartMode()
   at ZENPreAgent.FirewallHandler_win._isFirewallEnabled()
   at ZENPreAgent.FirewallHandler.openFirewallPort(Int32 port, Boolean openTCP, Boolean openUDP)
   at ZENPreAgent.FirewallHandler.openFirewallPort(Int32 port)
   at ZENPreAgent.AgentWin._openFirewallPort(Int32 port)
   at ZENPreAgent.AgentMain.serviceThreadMethod()