question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bulk-API | Invalid NEST response built from a successful (200) low level call

See original GitHub issue

NEST/Elasticsearch.Net version: 7.17.0

Elasticsearch version: 8.0.1

.NET runtime version: 6.0.201

Operating system version: Ubuntu 18.04.

Description of the problem including expected versus actual behavior: Successful Bulk-API Request produces invalid NEST Response. See Debug Information.

The property IsValid is false, but there are no errors in the response. Maybe it’s because of the missing _type Property in Elastic v8?

When I execute the query (see Debug-Information) directly in Elasticsearch, no error occurs. My data is in both cases (NEST-Client and direct via Elasticsearch) correctly modified.

Expected behavior Request response should not be invalid.

Provide DebugInformation (if relevant):

C# (also at similar Bulk-API requests with IndexMany and DeleteMany functions -> same error) var updateResponse = await client.BulkAsync(bd => bd .Index(ElasticIndex.MyIndex) .UpdateMany(myData, (descriptor, v) => descriptor .Doc(v)) );

NEST-Response Invalid NEST response built from a successful (200) low level call on POST: /my-index/_bulk Invalid Bulk items: operation[0]: update returned 200 _index: my-index _type: _id: 9f429b8b-dec2-4da1-83b7-e411782920f3 _version: 2 error: Audit trail of this API call: [1] HealthyResponse: Node: http://myserver:9200/ Took: 00:00:00.1292754 Request: {"update":{"_id":"9f429b8b-dec2-4da1-83b7-e411782920f3"}} ...doc information... Response: {"took":6,"errors":false,"items":[{"update":{"_index":"my-index","_id":"9f429b8b-dec2-4da1-83b7-e411782920f3","_version":2,"result":"updated","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":1459,"_primary_term":3,"status":200}}]}

C# - My Connection settings var pool = new SingleNodeConnectionPool(new Uri(_appSettings.Elasticsearch.Url)); var settings = new ConnectionSettings(pool, (builtin, settings) => new JsonNetSerializer(builtin, settings, () => new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All } )); settings.BasicAuthentication(_appSettings.Elasticsearch.Username, _appSettings.Elasticsearch.Password); settings.DisableDirectStreaming(); settings.EnableApiVersioningHeader();

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:38 (16 by maintainers)

github_iconTop GitHub Comments

5reactions
stevejgordoncommented, Mar 15, 2022

Thanks for checking that @neox2811 and @julbra. I’ll need to investigate this and see if it’s something we can accommodate in the interim before our new client is ready for GA. We do have bulk support in the new client which can be installed side-by-side with NEST. It is however an alpha release and not feature complete.

3reactions
stevejgordoncommented, Apr 1, 2022

@jeaguilarc As a starting point, please verify that you’ve enabled the compatibility mode on the client settings with the call to EnableApiVersioningHeader.

var pool = new SingleNodeConnectionPool(new Uri("http://localhost:9200"));

var settings = new ConnectionSettings(pool)
    .CertificateFingerprint("FINGERPRINT")
    .BasicAuthentication("elastic", "password")
    .EnableApiVersioningHeader();

var client = new ElasticClient(settings);

If that’s enabled, I’d recommend enabling DebugMode as well and verifying the request and response JSON in DebugInformation on the response. If you can share the response, that would be useful. When using Postman are you including the API versioning required on the Accept header?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid NEST response built from a unsuccessful low level ...
What am I configurating wrong? Error message: Invalid NEST response built from a unsuccessful low level call on POST: /customer/customer Audit ...
Read more >
Invalid NEST response built from a unsuccessful (200) low ...
Elasticsearch .NET DocumentExists() returns error: Invalid NEST response built from a unsuccessful (200) low level call on HEAD ... I'm running ...
Read more >
Invalid NEST response built from a successful (200) low ...
It gives you full control on how the underlying BulkApi should be called. var bulkAllObservable = client.BulkAll(people, b => ...
Read more >
.Net 6 WebAPI - Intro to ElasticSearch - Step by ...
I got this issue, even I tried the solution github.com/elastic/elasticsearch-n... Invalid NEST response built from a unsuccessful () low level ...
Read more >
C# – Invalid NEST response built from a unsuccessful low ...
I want to configurate NEST from c# code. When I use Kibana command GET /_cat/indices?v. I get this result: enter image description here....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found