Error at IndexDocument()

I want to inject a data set using C# and elastic + kibana version 8.x.
On console at Kibana it works fine.
At the C# code at the indexResponse I get the error message:

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 /

I checked the net and find a article about this exception and tried to implement the solution at the setting (I add CertificateFingerprint, BasicAuthentication and EnableApiVersioningHeader). But it does not solve the exception.

What could cause and what could solve that error?

Thanks, Frank

    public class Manager
    {
        ElasticClient client;
        public Manager()
        {
            var pool = new SingleNodeConnectionPool(new Uri("http://localhost:9200"));
            ConnectionSettings settings = new ConnectionSettings(pool)
                .CertificateFingerprint("94:75:CE:4F:EB:05:32:83:40:B8:18:BB:79:01:7B:E0:F0:B6:C3:01:57:DB:4D:F5:D8:B8:A6:BA:BD:6D:C5:C4")
                .BasicAuthentication("elastic", "...")
                .EnableApiVersioningHeader()
                .DefaultIndex("test"); 
            client = new ElasticClient(settings);
        }

        public bool injectData()
        {
            Person person = new Person
            {
                name = "Anna",
                age = 29,
                address = "Beethovenweg 8, 99817 Eisenach"
            };

            IndexResponse indexResponse = client.IndexDocument(person);
            return indexResponse != null;
        }
}

at console:

POST /test/_doc/
{
  "name": "Oliver",
  "age": 29,
  "address": "Germany"
}
GET /test/_search

answer to GET command:

{
  "took" : 4,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 1,
      "relation" : "eq"
    },
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "test",
        "_id" : "cBd_mYABTQckRFudSyBa",
        "_score" : 1.0,
        "_source" : {
          "name" : "Oliver",
          "age" : 29,
          "address" : "Germany"
        }
      }
    ]
  }
}

Strange is the error message, because it should be a POST, not a GET?!

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