Closed nvivo closed 1 year ago
Can you give it a go with the latest alpha nuget package? There was some fix in the dynamic error message that is returned from the batch operation.
Op 23 aug. 2019 om 20:21 heeft Natan Vivo notifications@github.com het volgende geschreven:
Some events are missing from ElasticSearch and I'm investigating what is happening. Looking into the selflog I get this error every few minutes:
2019-08-23T17:40:38.4905634Z Exception while emitting periodic batch from Serilog.Sinks.Elasticsearch.ElasticsearchSink: System.Collections.Generic.KeyNotFoundException: The given key 'error' was not present in the dictionary. at System.Collections.Generic.Dictionary
2.get_Item(TKey key) at Serilog.Sinks.Elasticsearch.ElasticsearchSink.EmitBatch(IEnumerable
1 events) at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.EmitBatchAsync(IEnumerable`1 events) at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.OnTick() Is this a bug or I might be causing it from my code?— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
I just got the latest dev branch and ran with debug symbols.
Looks like the ["error"]
is not present. Should it always be there?
Ok, I got what is happening.
The response from ElasticSearch contains all items, not only the ones with errors. This is part of the response:
While DynamicResponse uses TryGetValue for the "index" part, the value itself is another dictionary and that one complains about trying to get "error" without a check.
Hmm, that is unfortunate, I recently merged this one (https://github.com/serilog/serilog-sinks-elasticsearch/pull/266/files) into dev. So if you tried the dev branch, then it still has issues. Would you care for a PR?
See #271
Is this still an issue with the latest nuget package?
I was having the same issue with 8.0.0. Updated to alpha0002 and no longer have the problem.
Some events are missing from ElasticSearch and I'm investigating what is happening. Looking into the selflog I get this error every few minutes:
Is this a bug or I might be causing it from my code?