Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Elastic.Serilog.Sinks usage triggers OperationCanceledException every few seconds #472

Open
rh101 opened this issue Jan 9, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@rh101
Copy link

rh101 commented Jan 9, 2025

ECS integration/library project(s) (e.g. Elastic.CommonSchema.Serilog):

Elastic.Serilog.Sinks

ECS schema version (e.g. 1.4.0):

ECS .NET assembly version (e.g. 1.4.2):
8.12.3

Elasticsearch version (if applicable):
8.17.0

.NET framework / OS:
.NET 9 / Windows 10

Description of the problem, including expected versus actual behavior:

On running the project, the follow exception is thrown every few seconds:

Exception thrown: 'System.OperationCanceledException' in System.Private.CoreLib.dll: 'The operation was canceled.'

If the Elasticsearch serilog sink is not used, then that exception is not triggered.

The call stack shows the following:

System.Private.CoreLib.dll!System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()	C#
System.Threading.Channels.dll!System.Threading.Channels.AsyncOperation<bool>.GetResult(short token)	C#
Elastic.Channels.dll!Elastic.Channels.Buffers.InboundBuffer<Elastic.CommonSchema.EcsDocument>.WaitToReadAsync(System.Threading.Channels.ChannelReader<Elastic.CommonSchema.EcsDocument> reader)	C#
[Resuming Async Method]	
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<bool>.AsyncStateMachineBox<Elastic.Channels.Buffers.InboundBuffer<Elastic.CommonSchema.EcsDocument>.<WaitToReadAsync>d__31>.ExecutionContextCallback(object s)	C#
System.Private.CoreLib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state)	C#
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<bool>.AsyncStateMachineBox<Elastic.Channels.Buffers.InboundBuffer<Elastic.CommonSchema.EcsDocument>.<WaitToReadAsync>d__31>.MoveNext(System.Threading.Thread threadPoolThread)	C#
System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<bool>.AsyncStateMachineBox<Elastic.Channels.Buffers.InboundBuffer<System.__Canon>.<WaitToReadAsync>d__31>.MoveNext()	C#
System.Private.CoreLib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch()	C#
System.Private.CoreLib.dll!System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()	C#
[Native to Managed Transition]	
[Async Call Stack]	
[Async] Elastic.Channels.dll!Elastic.Channels.BufferedChannelBase<Elastic.Ingest.Elasticsearch.DataStreams.DataStreamChannelOptions<Elastic.CommonSchema.EcsDocument>, Elastic.CommonSchema.EcsDocument, Elastic.Ingest.Elasticsearch.Serialization.BulkResponse>.ConsumeInboundEventsAsync(int maxQueuedMessages, System.TimeSpan maxInterval)	C#
[Async] Elastic.Channels.dll!Elastic.Channels.BufferedChannelBase<Elastic.Ingest.Elasticsearch.DataStreams.DataStreamChannelOptions<Elastic.CommonSchema.EcsDocument>, Elastic.CommonSchema.EcsDocument, Elastic.Ingest.Elasticsearch.Serialization.BulkResponse>..ctor.AnonymousMethod__48_3()	C#

Steps to reproduce:

Visual Studio 2022 project at https://github.com/rh101/SerilogESTest

Use docker compose to run the project.

Update the relevant passwords in the .env file to the the values from the commands:
/usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic
/usr/share/elasticsearch/bin/elasticsearch-reset-password -u kibana_system

@rh101 rh101 added the bug Something isn't working label Jan 9, 2025
@rh101 rh101 changed the title [BUG] [BUG] Elastic.Serilog.Sinks usage triggers OperationCanceledException every few seconds Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant