# The client is unable to verify that the server is Elasticsearch

**URL:** <https://discuss.elastic.co/t/the-client-is-unable-to-verify-that-the-server-is-elasticsearch/335912>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [June 13, 2023, 8:09pm UTC](https://discuss.elastic.co/t/the-client-is-unable-to-verify-that-the-server-is-elasticsearch/335912 "2023-06-13T20:09:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcosrobles-qo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcosrobles-qo/32/122213_2.png) [@marcosrobles-qo](https://discuss.elastic.co/u/marcosrobles-qo)\
**Post date:** [June 13, 2023, 8:09pm UTC](https://discuss.elastic.co/t/the-client-is-unable-to-verify-that-the-server-is-elasticsearch/335912/1 "2023-06-13T20:09:17Z")

</div>

**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:

```auto
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 :

```auto
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);

```

---

<div class="post-metadata">

**Author:** ![marcosrobles-qo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcosrobles-qo/32/122213_2.png) [@marcosrobles-qo](https://discuss.elastic.co/u/marcosrobles-qo)\
**Post date:** [June 19, 2023, 4:09pm UTC](https://discuss.elastic.co/t/the-client-is-unable-to-verify-that-the-server-is-elasticsearch/335912/2 "2023-06-19T16:09:22Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/f/ff243b114557c366a820bc6346871fb3a1e429af.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 17, 2023, 4:10pm UTC](https://discuss.elastic.co/t/the-client-is-unable-to-verify-that-the-server-is-elasticsearch/335912/3 "2023-07-17T16:10:07Z")

</div>

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