influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.7k stars 5.59k forks source link

[[inputs.win_wmi]] dropped values - Error in plugin: Object server is stopping when OLE service contacts it #16179

Open 1tft opened 5 days ago

1tft commented 5 days ago

Relevant telegraf.conf

[[inputs.win_wmi]]
   name_override = "mymeasurement"
   interval = "1m"

   [[inputs.win_wmi.method]]
     namespace = 'root\default'
     class_name = "StdRegProv"
     method = "GetDWordValue"
     [inputs.win_wmi.method.arguments]
       hDefKey = '2147483650'
       sSubKeyName = 'Software\Microsoft\windows NT\CurrentVersion'
       sValueName = 'UBR'
     [inputs.win_wmi.method.fields]
       uValue = "ole_stop_test01"

  [[inputs.win_wmi.method]]
    namespace = 'root\default'
    class_name = "StdRegProv"
    method = "GetStringValue"
    [inputs.win_wmi.method.arguments]
      hDefKey = '2147483650'
      sSubKeyName = 'Software\Microsoft\windows NT\CurrentVersion'
      sValueName = 'CurrentBuild'
    [inputs.win_wmi.method.fields]
         sValue = "ole_stop_test02"

Logs from Telegraf

[inputs.win_wmi] Error in plugin: Object server is stopping when OLE service contacts it

System info

Telegraf 1.31.3, 1.32.1 e.g. Windows 2019/2016

Docker

No response

Steps to reproduce

  1. Run given telegraf config (query at least two values with [[inputs.win_wmi.method]]
  2. Usually after some hours You will see inside Telegraf log ERROR messages "_[inputs.winwmi] Error in plugin: Object server is stopping when OLE service contacts it"
  3. When this error occurs, [[inputs.win_wmi.method]] does not successfully query value, so "sValue" is null/empty/

Expected behavior

In case of this error "Object server is stopping when OLE service contacts it" (CO_E_SERVER_STOPPING 0x80080008), Telegraf should retry query until inputs timeout has been reached or try to avoid this error.

Actual behavior

Error occurs and metric is not created.

Additional info

No response

knollet commented 4 days ago

Hi,

I believe the error is thrown in one of these lines as those are the only ones, which don't get prefixed with some additional error information.

Also this error doesn't only affect .method but also .query sections, so there's also these two lines.

The Windows-Error which is thrown by those functions is CO_E_SERVER_STOPPING, which unfortunately doesn't really point to a specific function. Also, the documentation doesn't recommend a specific handling, so I don't really know how to fix that or even what causes this.