Bulk-API | Invalid NEST response built from a successful (200) low level call
See original GitHub issueNEST/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:
- Created 2 years ago
- Reactions:3
- Comments:38 (16 by maintainers)
Top GitHub Comments
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.
@jeaguilarc As a starting point, please verify that you’ve enabled the compatibility mode on the client settings with the call to
EnableApiVersioningHeader
.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?