# Invalid NEST response built from a unsuccessful (401) low level call on HEAD: /

**URL:** <https://discuss.elastic.co/t/invalid-nest-response-built-from-a-unsuccessful-401-low-level-call-on-head/243537>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [August 3, 2020, 9:58am UTC](https://discuss.elastic.co/t/invalid-nest-response-built-from-a-unsuccessful-401-low-level-call-on-head/243537 "2020-08-03T09:58:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![buka\_bidzina](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/buka_bidzina/32/50141_2.png) [@buka\_bidzina](https://discuss.elastic.co/u/buka_bidzina)\
**Post date:** [August 3, 2020, 9:58am UTC](https://discuss.elastic.co/t/invalid-nest-response-built-from-a-unsuccessful-401-low-level-call-on-head/243537/1 "2020-08-03T09:58:14Z")

</div>

Invalid NEST response built from a unsuccessful (401) low level call on HEAD: /

# Audit trail of this API call:

- [1] BadResponse: Node: [http://es.test.dev/](http://es.test.dev/) Exception: PipelineException Took: 00:00:00.1126819

# OriginalException: Elasticsearch.Net.ElasticsearchClientException: Could not authenticate with the specified node. Try verifying your credentials or check your Shield configuration.. Call: Status code 401 from: HEAD / ---\> Elasticsearch.Net.PipelineException: Could not authenticate with the specified node. Try verifying your credentials or check your Shield configuration.

at Elasticsearch.Net.RequestPipeline.ThrowBadAuthPipelineExceptionWhenNeeded(IApiCallDetails details, IElasticsearchResponse response)  
at Elasticsearch.Net.RequestPipeline.CallElasticsearch[TResponse](RequestData requestData)  
at Elasticsearch.Net.Transport`1.Request[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters)  
--- End of inner exception stack trace ---

# Audit exception in step 1 BadResponse:

Elasticsearch.Net.PipelineException: Could not authenticate with the specified node. Try verifying your credentials or check your Shield configuration.  
at Elasticsearch.Net.RequestPipeline.ThrowBadAuthPipelineExceptionWhenNeeded(IApiCallDetails details, IElasticsearchResponse response)  
at Elasticsearch.Net.RequestPipeline.CallElasticsearch[TResponse](RequestData requestData)  
at Elasticsearch.Net.Transport`1.Request[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters)

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

\<Response stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.\>

```
 public ElasticClient EsClient()
        {
            var nodes = new Uri[]
            {
                new Uri($"{_settings.ServerUrl}"),
            };

            var connectionPool = new StaticConnectionPool(nodes);

            var elasticClient = new ElasticClient(new ConnectionSettings(connectionPool)
                                                  .DisableDirectStreaming()
                                                  .BasicAuthentication(_settings.ServerUser, _settings.ServerPassword)
                                                  .DisablePing());
            var resp = elasticClient.Ping().DebugInformation;
            return elasticClient;
        }
```

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [August 3, 2020, 11:37pm UTC](https://discuss.elastic.co/t/invalid-nest-response-built-from-a-unsuccessful-401-low-level-call-on-head/243537/2 "2020-08-03T23:37:01Z")

</div>

A 401 HTTP status code response and the accompanying audit trail indicate that the authentication details provided to the client cannot authenticate with the cluster.

Check that the credentials provided to the client in

> [@buka\_bidzina](#):
>
> `.BasicAuthentication(_settings.ServerUser, _settings.ServerPassword)`

can authenticate with the cluster. Could try the credentials with curl, PowerShell, etc. to ensure that they can authenticate as expected.

---

<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 31, 2020, 11:37pm UTC](https://discuss.elastic.co/t/invalid-nest-response-built-from-a-unsuccessful-401-low-level-call-on-head/243537/3 "2020-08-31T23:37:03Z")

</div>

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