Winlogbeat - Not enough storage is available to complete this operation

Hi,

I'm running Winlogbeat to send out windows enent-logs to elastic.
version 7.12.1
windows 2012R2, 138GB memory, and 300GB free space on C.

for some reason , i see we're missing event logs from the security section, and the elastic logs shows this:

2021-06-01T16:34:05.585+0300 WARN eventlog/wineventlog.go:313 WinEventLog[Security] EventHandles returned error Not enough storage is available to complete this operation.
2021-06-01T16:34:05.585+0300 WARN beater/eventlogger.go:154 EventLog[Security] Read() error: Not enough storage is available to complete this operation.
2021-06-01T16:34:05.585+0300 INFO beater/eventlogger.go:129 EventLog[Security] Stop processing.

Restarting the service solves it, but it will occur again in dew days.
I'm using the default config file, just altered the kibana server url.
What can cause this and how can this be fixed?

Thanks!

Can you share a look at the Windows Resource Monitor showing the Winlogbeat process after it's been running for a while?

Also do you have the rest of the log file from when it last stopped. There are log lines that contain metrics every 30s. Can you share those please.

Winlogbeat 7.13.1 is out now too. It would be good to see if this happens with the latest version. I'm not aware of any specific fixes.

image

2021-06-01T16:34:05.585+0300 WARN eventlog/wineventlog.go:313 WinEventLog[Security] EventHandles returned error Not enough storage is available to complete this operation.
2021-06-01T16:34:05.585+0300 WARN beater/eventlogger.go:154 EventLog[Security] Read() error: Not enough storage is available to complete this operation.
2021-06-01T16:34:05.585+0300 INFO beater/eventlogger.go:129 EventLog[Security] Stop processing.
2021-06-01T16:34:05.611+0300 INFO beater/eventlogger.go:88 EventLog[Security] successfully published 50 events
2021-06-01T16:34:06.819+0300 INFO beater/eventlogger.go:88 EventLog[Application] successfully published 1 events
2021-06-01T16:34:06.820+0300 INFO beater/eventlogger.go:88 EventLog[System] successfully published 5 events
2021-06-01T16:34:06.827+0300 INFO beater/eventlogger.go:88 EventLog[Security] successfully published 42 events
2021-06-01T16:34:07.186+0300 INFO beater/eventlogger.go:88 EventLog[Security] successfully published 50 events
2021-06-01T16:34:07.222+0300 INFO beater/eventlogger.go:88 EventLog[Security] successfully published 50 events
2021-06-01T16:34:07.238+0300 INFO beater/eventlogger.go:88 EventLog[System] successfully published 8 events
2021-06-01T16:34:07.238+0300 INFO beater/eventlogger.go:88 EventLog[Application] successfully published 5 events
2021-06-01T16:34:09.445+0300 INFO beater/eventlogger.go:88 EventLog[System] successfully published 1 events
2021-06-01T16:34:09.445+0300 INFO beater/eventlogger.go:88 EventLog[Application] successfully published 4 events
2021-06-01T16:34:11.202+0300 INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":4559703,"time":{"ms":47}},"total":{"ticks":13521921,"time":{"ms":406},"value":13521921},"user":{"ticks":8962218,"time":{"ms":359}}},"handles":{"open":410},"info":{"ephemeral_id":"4749399e-ea6a-4155-bb53-43ea5d940bf0","uptime":{"ms":623280125}},"memstats":{"gc_next":13515520,"memory_alloc":9414472,"memory_total":486769351920,"rss":130461696},"runtime":{"goroutines":34}},"libbeat":{"config":{"module":{"running":0}},"output":{"events":{"acked":622,"active":789,"batches":29,"total":624},"read":{"bytes":16809},"write":{"bytes":1522954}},"pipeline":{"clients":5,"events":{"active":2,"published":595,"total":595},"queue":{"acked":622}}},"msg_file_cache":{"ApplicationHits":16,"ApplicationMisses":1,"ApplicationSize":1,"SecurityHits":561,"SystemHits":17},"published_events":{"Application":16,"Security":590,"System":16,"total":622},"read_errors":{"14":1}}}}
2021-06-01T16:34:12.159+0300 INFO beater/eventlogger.go:88 EventLog[System] successfully published 1 events
2021-06-01T16:34:12.159+0300 INFO beater/eventlogger.go:88 EventLog[Application] successfully published 1 events
2021-06-01T16:34:29.438+0300 INFO beater/eventlogger.go:88 EventLog[System] successfully published 1 events
2021-06-01T16:34:41.204+0300 INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":4559703},"total":{"ticks":13521921,"value":13521921},"user":{"ticks":8962218}},"handles":{"open":412},"info":{"ephemeral_id":"4749399e-ea6a-4155-bb53-43ea5d940bf0","uptime":{"ms":623310127}},"memstats":{"gc_next":13515520,"memory_alloc":10222376,"memory_total":486770159824,"rss":130625536},"runtime":{"goroutines":33}},"libbeat":{"config":{"module":{"running":0}},"output":{"events":{"acked":3,"active":787,"batches":1,"total":1},"read":{"bytes":934},"write":{"bytes":1933}},"pipeline":{"clients":5,"events":{"active":0,"published":1,"total":1},"queue":{"acked":3}}},"msg_file_cache":{"SystemMisses":1,"SystemSize":1},"published_events":{"Application":1,"System":2,"total":3}}}}
2021-06-01T16:34:47.808+0300 INFO beater/eventlogger.go:88 EventLog[System] successfully published 1 events
2021-06-01T16:34:48.074+0300 INFO beater/eventlogger.go:88 EventLog[System] successfully published 2 events
2021-06-01T16:34:55.127+0300 INFO beater/eventlogger.go:88 EventLog[Application] successfully published 1 events
2021-06-01T16:35:11.203+0300 INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":4559718,"time":{"ms":15}},"total":{"ticks":13521936,"time":{"ms":15},"value":13521936},"user":{"ticks":8962218}},"handles":{"open":410},"info":{"ephemeral_id":"4749399e-ea6a-4155-bb53-43ea5d940bf0","uptime":{"ms":623340125}},"memstats":{"gc_next":13515520,"memory_alloc":11493944,"memory_total":486771431392,"rss":131100672},"runtime":{"goroutines":33}},"libbeat":{"config":{"module":{"running":0}},"output":{"events":{"acked":4,"active":787,"batches":3,"total":4},"read":{"bytes":1390},"write":{"bytes":8053}},"pipeline":{"clients":5,"events":{"active":2,"published":6,"total":6},"queue":{"acked":4}}},"msg_file_cache":{"ApplicationMisses":1,"SystemHits":4,"SystemMisses":1,"SystemSize":1},"published_events":{"Application":1,"System":3,"total":4}}}}
2021-06-01T16:35:12.154+0300 INFO beater/eventlogger.go:88 EventLog[System] successfully published 2 events
2021-06-01T16:35:17.166+0300 INFO beater/eventlogger.go:88 EventLog[System] successfully published 1 events
2021-06-01T16:35:17.166+0300 INFO beater/eventlogger.go:88 EventLog[Application] successfully published 1 events
2021-06-01T16:35:22.306+0300 INFO beater/eventlogger.go:88 EventLog[Application] successfully published 1 events
2021-06-01T16:35:34.499+0300 INFO beater/eventlogger.go:88 EventLog[Application] successfully published 1 events
2021-06-01T16:35:41.204+0300 INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":4559734,"time":{"ms":16}},"total":{"ticks":13521952,"time":{"ms":16},"value":13521952},"user":{"ticks":8962218}},"handles":{"open":412},"info":{"ephemeral_id":"4749399e-ea6a-4155-bb53-43ea5d940bf0","uptime":{"ms":623370125}},"memstats":{"gc_next":10995920,"memory_alloc":5856256,"memory_total":486772965352,"rss":128057344},"runtime":{"goroutines":33}},"libbeat":{"config":{"module":{"running":0}},"output":{"events":{"acked":6,"active":787,"batches":4,"total":6},"read":{"bytes":1868},"write":{"bytes":12045}},"pipeline":{"clients":5,"events":{"active":0,"published":4,"total":4},"queue":{"acked":6}}},"msg_file_cache":{"ApplicationHits":2,"ApplicationMisses":1,"ApplicationSize":1,"SystemHits":1},"published_events":{"Application":3,"System":3,"total":6}}}}
2021-06-01T16:36:11.204+0300 INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":4559734},"total":{"ticks":13521952,"value":13521952},"user":{"ticks":8962218}},"handles":{"open":412},"info":{"ephemeral_id":"4749399e-ea6a-4155-bb53-43ea5d940bf0","uptime":{"ms":623400125}},"memstats":{"gc_next":10995920,"memory_alloc":6114944,"memory_total":486773224040,"rss":128077824},"runtime":{"goroutines":35}},"libbeat":{"config":{"module":{"running":0}},"output":{"events":{"active":787}},"pipeline":{"clients":5,"events":{"active":0}}},"msg_file_cache":{"SecuritySize":-1,"SystemSize":-1}}}}
2021-06-01T16:36:22.582+0300 INFO beater/eventlogger.go:88 EventLog[System] successfully published 2 events
2021-06-01T16:36:41.205+0300 INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":4559734},"total":{"ticks":13521952,"value":13521952},"user":{"ticks":8962218}},"handles":{"open":408},"info":{"ephemeral_id":"4749399e-ea6a-4155-bb53-43ea5d940bf0","uptime":{"ms":623430126}},"memstats":{"gc_next":10995920,"memory_alloc":6700280,"memory_total":486773809376,"rss":128331776},"runtime":{"goroutines":33}},"libbeat":{"config":{"module":{"running":0}},"output":{"events":{"acked":2,"active":787,"batches":1,"total":2},"read":{"bytes":475},"write":{"bytes":3647}},"pipeline":{"clients":5,"events":{"active":0,"published":2,"total":2},"queue":{"acked":2}}},"msg_file_cache":{"ApplicationSize":-5,"SystemHits":2,"SystemSize":-1},"published_events":{"System":2,"total":2}}}}
2021-06-01T16:36:54.264+0300 INFO beater/eventlogger.go:88 EventLog[System] successfully published 1 events
2021-06-01T16:37:00.285+0300 INFO beater/eventlogger.go:88 EventLog[Application] successfully published 1 events
2021-06-01T16:37:11.204+0300 INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":4559734},"total":{"ticks":13521968,"time":{"ms":16},"value":13521968},"user":{"ticks":8962234,"time":{"ms":16}}},"handles":{"open":410},"info":{"ephemeral_id":"4749399e-ea6a-4155-bb53-43ea5d940bf0","uptime":{"ms":623460125}},"memstats":{"gc_next":10995920,"memory_alloc":7577784,"memory_total":486774686880,"rss":128659456},"runtime":{"goroutines":33}},"libbeat":{"config":{"module":{"running":0}},"output":{"events":{"acked":2,"active":787,"batches":2,"total":2},"read":{"bytes":912},"write":{"bytes":4126}},"pipeline":{"clients":5,"events":{"active":0,"published":2,"total":2},"queue":{"acked":2}}},"msg_file_cache":{"ApplicationHits":1,"SystemHits":1},"published_events":{"Application":1,"System":1,"total":2}}}}
2021-06-01T16:37:14.486+0300 INFO beater/eventlogger.go:88 EventLog[Application] successfully published 1 events
2021-06-01T16:37:25.311+0300 INFO beater/eventlogger.go:88 EventLog[System] successfully published 1 events
2021-06-01T16:37:32.334+0300 INFO beater/eventlogger.go:88 EventLog[System] successfully published 2 events
2021-06-01T16:37:41.204+0300 INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":4559750,"time":{"ms":16}},"total":{"ticks":13521984,"time":{"ms":16},"value":13521984},"user":{"ticks":8962234}},"handles":{"open":410},"info":{"ephemeral_id":"4749399e-ea6a-4155-bb53-43ea5d940bf0","uptime":{"ms":623490125}},"memstats":{"gc_next":10861040,"memory_alloc":5595760,"memory_total":486775999088,"rss":127754240},"runtime":{"goroutines":33}},"libbeat":{"config":{"module":{"running":0}},"output":{"events":{"acked":4,"active":787,"batches":3,"total":4},"read":{"bytes":1392},"write":{"bytes":7787}},"pipeline":{"clients":5,"events":{"active":2,"published":6,"total":6},"queue":{"acked":4}}},"msg_file_cache":{"ApplicationHits":1,"ApplicationMisses":2,"SystemHits":3,"SystemSize":-1},"published_events":{"Application":1,"System":3,"total":4}}}}
2021-06-01T16:37:42.580+0300 INFO beater/eventlogger.go:88 EventLog[System] successfully published 1 events

one more note, i've added those lines 2 days ago, when i found the issue, before restarting it:
queue.mem:
events: 4096
flush.min_events: 20
flush.timeout: 5s

(as there were no queue settings at all and logs were sent immidiatly)
not sure if its related though

The error you are getting is error number 14. It seems that Windows could not allocate the memory necessary to return the Windows events logs that Winlogbeat requested. Based on the screenshot it looks like Winlogbeat is using about 33MB. How much is available? Can you look at the memory tab in the resource manager.

ERROR_OUTOFMEMORY

14 (0xE)

Not enough storage is available to complete this operation.

as you can see here, this server has enough memory:
image

and used:

I haven't seen this happen with Winlogbeat before. I wonder if the error is about some resource other than memory.

Have you checked the System event log to see if there are any logs that relate that might have some more details?

And maybe try looking at the process with Sysinternals Process Explorer. It can show a bunch a details about memory and handles. Maybe something will stand out.

nothing odd in the event log.
as for now its still working, sending batches of 20 every time, and the performance are the same.
thing is, last time it crashed, it only stopped fetching security events from event logs, the other logs (system, apps) where still pushing new events with no issues, and service was running.
this makes it hard to understand or monoitor