The client is unable to verify that the server is Elasticsearch

Kibana version:

Elasticsearch version:
8.6.0
APM Server version:

APM Agent language and version:
8.6.0 - C#
Browser version:

Original install method (e.g. download page, yum, deb, from source, etc.) and version:
Predefined Elastic APM integration in cloud

Fresh install or upgraded from other version?
Fresh

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):

Trying to setup APM with serilog and send logs to Elasticsearch in my company elastic environment I got the following error printed using the Selflog option:

2023-06-13T19:48:28.9594206Z Exception while emitting periodic batch from Serilog.Sinks.Elasticsearch.Durable.ElasticsearchLogClient: 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 200 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.
   at Elasticsearch.Net.RequestPipeline.ThrowIfTransientProductCheckFailure()
   at Elasticsearch.Net.RequestPipeline.PingAsync(Node node, CancellationToken cancellationToken)
   at Elasticsearch.Net.Transport`1.PingAsync(IRequestPipeline pipeline, Node node, CancellationToken cancellationToken)
   at Elasticsearch.Net.Transport`1.RequestAsync[TResponse](HttpMethod method, String path, CancellationToken cancellationToken, PostData data, IRequestParameters requestParameters)
   --- 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[TResponse](HttpMethod method, String path, CancellationToken cancellationToken, PostData data, IRequestParameters requestParameters)
   at Serilog.Sinks.Elasticsearch.Durable.ElasticsearchLogClient.SendPayloadAsync(List`1 payload, Boolean first)

Steps to reproduce:

  1. Get APM Server Url and token and paste it in app settings
  2. Install the required nuget packages and use app.UseAllElasticApm(configurationBuilder) in program.cs
  3. Setup serilog :
var builder = WebApplication.CreateBuilder(args);



var configurationBuilder = new ConfigurationBuilder()
                      .SetBasePath(Directory.GetCurrentDirectory())
                    .AddJsonFile("appSettings.json", optional: false, reloadOnChange: true)
                    .AddEnvironmentVariables()
                    .Build();


builder.Logging.ClearProviders();
builder.Logging.AddSerilog();

 Log.Logger = new  LoggerConfiguration()
                 .ReadFrom.Configuration(configurationBuilder)
                .Enrich.WithElasticApmCorrelationInfo() //Using  Elastic.Apm.SerilogEnricher  adds the transaction id and trace id to every Serilog log message that is created during a transaction.
                .CreateLogger();


builder.Services.AddSingleton(Log.Logger);

I was pointing to apm server url besides Elasticsearch endpoint in the elastic serilog section of appsettings

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.