# Elasticsearch .NET DocumentExists() returns error: Invalid NEST response built from a unsuccessful (200) low level call on HEAD

**URL:** <https://discuss.elastic.co/t/elasticsearch-net-documentexists-returns-error-invalid-nest-response-built-from-a-unsuccessful-200-low-level-call-on-head/278970>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [July 17, 2021, 12:42pm UTC](https://discuss.elastic.co/t/elasticsearch-net-documentexists-returns-error-invalid-nest-response-built-from-a-unsuccessful-200-low-level-call-on-head/278970 "2021-07-17T12:42:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AdstraCat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adstracat/32/79281_2.png) [@AdstraCat](https://discuss.elastic.co/u/AdstraCat)\
**Post date:** [July 17, 2021, 12:42pm UTC](https://discuss.elastic.co/t/elasticsearch-net-documentexists-returns-error-invalid-nest-response-built-from-a-unsuccessful-200-low-level-call-on-head/278970/1 "2021-07-17T12:42:31Z")

</div>

Hi everyone  
I have a document already exists in an index in elastic below

 ![dScru](https://us1.discourse-cdn.com/elastic/original/3X/7/b/7b7e9adf92c7ecda8b460f166510c2e2d2fb3ab7.png)

And here's my C# code for checking if this document exists:

```auto
ExistsResponse existsResponse = await _elasticClient.DocumentExistsAsync<T>(type.Id, d => 
                d.Index(index));

```

However whenever the program runs to that line it always returns an error with invalid NEST response: (I've greyed out my node domain address with xxxx)

```auto
Invalid NEST response built from a unsuccessful (200) low level call on HEAD: /purchaseorders_test/_doc/PO1Z74FVF4
# Audit trail of this API call:
 - [1] BadResponse: Node: https://xxxxxxxxx/ Took: 00:00:00.3388193
# OriginalException: Elasticsearch.Net.ElasticsearchClientException: Request failed to execute. Call: Status code 200 from: HEAD /purchaseorders_test/_doc/PO1Z74FVF4
# Request:
<Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>
# Response:

```

I've already set `DisableDirectStreaming` on my `ConnectionSettings` , but they don't seem to solve anything

```auto
    var settings = new ConnectionSettings(new Uri(url))
                .DefaultIndex(defaultIndex).BasicAuthentication("elastic", "xxxxxxx").DisableDirectStreaming();

 var client = new ElasticClient(settings);

```

The version of Elastic NUGET I'm using is **[Elasticsearch.Net](http://Elasticsearch.Net) 7.13.0**

I'm running out of idea on how to solve this, can anyone help me with this ?

---

<div class="post-metadata">

**Author:** ![stevejgordon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stevejgordon/32/80912_2.png) [@stevejgordon](https://discuss.elastic.co/u/stevejgordon)\
**Post date:** [July 27, 2021, 9:31am UTC](https://discuss.elastic.co/t/elasticsearch-net-documentexists-returns-error-invalid-nest-response-built-from-a-unsuccessful-200-low-level-call-on-head/278970/2 "2021-07-27T09:31:00Z")

</div>

I responded to this query on a Reddit thread and wanted to copy the answer here for anyone finding this issue:

This relates to an issue that was fixed in [v7.13.1](https://github.com/elastic/elasticsearch-net/releases/tag/7.13.1). The bug unfortunately crept into the 7.13.0 release you are using. You should find it resolves if you grab the latest patch release from [NuGet](https://www.nuget.org/packages/NEST/7.13.2).

If the issue persists after upgrading, please do open an [issue on the GitHub](https://github.com/elastic/elasticsearch-net) repository and I'll take a look at it.

---

<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:** [August 24, 2021, 9:31am UTC](https://discuss.elastic.co/t/elasticsearch-net-documentexists-returns-error-invalid-nest-response-built-from-a-unsuccessful-200-low-level-call-on-head/278970/3 "2021-08-24T09:31:49Z")

</div>

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