Elasticsearch sink C# with docker ELK stack not working. Getting an exception Client unable to verify the server

  c#, docker, elastic-stack, elasticsearch, serilog

I have setup an docker ELK stack for use with logging with SeriLog in c# and later I will import our legacy log4net logs. I have used Docker ELK stack for setting it up I’m running elasticsearch as singlenode.
When running the elasticsearch sink I’m getting below stack trace. I then tried to disable the security xpack.security.enabled: false but I’m still having the same issue.

The elasticsearch version is 7.14 and I have update Elasticsearch.Net to the newest version 7.14.1, but didn’t solve the problem.

My setup of elasticsearch:

xpack.license.self_generated.type: basic
xpack.security.enabled: false
xpack.monitoring.collection.enabled: true

The stack trace for when I’m logging:

021-08-17T13:44:59.9342422Z Caught exception while preforming bulk operation to Elasticsearch: Elasticsearch.Net.ElasticsearchClientException: The client is unable to verify that the server is Elasticsearch due to an unsuccessful product check call. Some functionality may not be compatible if the server is running an unsupported product. Call: Status code unknown from: GET / ---> Elasticsearch.Net.PipelineException: The client is unable to verify that the server is Elasticsearch due to an unsuccessful product check call. Some functionality may not be compatible if the server is running an unsupported product. ---> System.Net.WebException: The request was aborted: The request was canceled.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Elasticsearch.Net.HttpWebRequestConnection.<RequestAsync>d__5`1.MoveNext()
   --- End of inner exception stack trace ---
   at Elasticsearch.Net.RequestPipeline.ThrowIfTransientProductCheckFailure()
   at Elasticsearch.Net.RequestPipeline.<PingAsync>d__75.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Elasticsearch.Net.Transport`1.<PingAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Elasticsearch.Net.Transport`1.<RequestAsync>d__15`1.MoveNext()
   --- End of inner exception stack trace ---
   at Elasticsearch.Net.Transport`1.HandleElasticsearchClientException(RequestData data, Exception clientException, IElasticsearchResponse response)
   at Elasticsearch.Net.Transport`1.FinalizeResponse[TResponse](RequestData requestData, IRequestPipeline pipeline, List`1 seenExceptions, TResponse response)
   at Elasticsearch.Net.Transport`1.<RequestAsync>d__15`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Serilog.Sinks.Elasticsearch.ElasticsearchSink.<EmitBatchAsync>d__2.MoveNext()

Does anybody have any idea to why I’m getting this and how to solve it ?

Source: Docker Questions

LEAVE A COMMENT