# Elasticsearch.Net SniffingConnectionPool requires open Transport port

**URL:** <https://discuss.elastic.co/t/elasticsearch-net-sniffingconnectionpool-requires-open-transport-port/75727>\
**Category:** Elasticsearch\
**Created:** [February 20, 2017, 12:14pm UTC](https://discuss.elastic.co/t/elasticsearch-net-sniffingconnectionpool-requires-open-transport-port/75727 "2017-02-20T12:14:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Babadofar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/babadofar/32/44803_2.png) [@Babadofar](https://discuss.elastic.co/u/Babadofar)\
**Post date:** [February 20, 2017, 12:14pm UTC](https://discuss.elastic.co/t/elasticsearch-net-sniffingconnectionpool-requires-open-transport-port/75727/1 "2017-02-20T12:14:11Z")

</div>

Hi,

I'm seeing connection failures using [Sniffing ConnectionPool](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/connection-pooling.html#sniffing-connection-pool) , where parts of the elasticsearch cluster is only available on the http port, that is - the transport port is closed for these nodes. When limiting the set of cluster nodes to only those with open transport ports, no failed sniffing cluster state errors occur.  
So it seems that there is a requirement for the transport ports to be open, alternatively to set a publish port (which should be open to the client). If this is correct, you might want to add this to the documentation.

```
Elasticsearch.Net.PipelineException: Failed sniffing cluster state. ---> System.AggregateException: One or more errors occurred. ---> Elasticsearch.Net.PipelineException: An error occurred trying to read the response from the specified node.
at Elasticsearch.Net.RequestPipeline.Sniff() in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Transport\Pipeline\RequestPipeline.cs:line 340

```

Thanks for the awesome work with the NEST language client for .Net. 🙂

---

<div class="post-metadata">

**Author:** ![DejongheE](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@DejongheE](https://discuss.elastic.co/u/DejongheE)\
**Post date:** [February 28, 2017, 2:28pm UTC](https://discuss.elastic.co/t/elasticsearch-net-sniffingconnectionpool-requires-open-transport-port/75727/2 "2017-02-28T14:28:59Z")

</div>

Hi,

Looks like I'm having the same issue.

My cluster is running on [https://cloud.elastic.co/](https://cloud.elastic.co/) and when I try to connect using the SniffingConnectionPool, I see the following exception:

> [PipelineException: An error occurred trying to read the response from the specified node.]  
> Elasticsearch.Net.RequestPipeline.Sniff() in C:\code\elasticsearch-net\src\Elasticsearch.Net\Transport\Pipeline\RequestPipeline.cs:342

> [AggregateException: One or more errors occurred.]

> [PipelineException: Failed sniffing cluster state.]  
> Elasticsearch.Net.RequestPipeline.Sniff() in C:\code\elasticsearch-net\src\Elasticsearch.Net\Transport\Pipeline\RequestPipeline.cs:357  
> Elasticsearch.Net.RequestPipeline.SniffOnConnectionFailure() in C:\code\elasticsearch-net\src\Elasticsearch.Net\Transport\Pipeline\RequestPipeline.cs:317  
> Elasticsearch.Net.Transport`1.Ping(IRequestPipeline pipeline, Node node) in C:\code\elasticsearch-net\src\Elasticsearch.Net\Transport\Transport.cs:177 Elasticsearch.Net.Transport`1.Request(HttpMethod method, String path, PostData`1 data, IRequestParameters requestParameters) in C:\code\elasticsearch-net\src\Elasticsearch.Net\Transport\Transport.cs:69

I'm using an Elastic 5.2 cluster and tested with both Nest client 5.0 and 5.2.

Regards,  
Emanuel

---

<div class="post-metadata">

**Author:** ![Babadofar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/babadofar/32/44803_2.png) [@Babadofar](https://discuss.elastic.co/u/Babadofar)\
**Post date:** [February 28, 2017, 8:31pm UTC](https://discuss.elastic.co/t/elasticsearch-net-sniffingconnectionpool-requires-open-transport-port/75727/3 "2017-02-28T20:31:33Z")

</div>

I still see this error occasionally, now with all ports open. Will try out static connection pool next.

---

<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:** [February 28, 2017, 11:48pm UTC](https://discuss.elastic.co/t/elasticsearch-net-sniffingconnectionpool-requires-open-transport-port/75727/4 "2017-02-28T23:48:26Z")

</div>

Thanks for reporting @Babadofar and @DejongheE.

[I've opened a github issue on the client to look into](https://github.com/elastic/elasticsearch-net/issues/2642).

---

<div class="post-metadata">

**Author:** ![Martijn\_Laarman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martijn_laarman/32/4410_2.png) [@Martijn\_Laarman](https://discuss.elastic.co/u/Martijn_Laarman)\
**Post date:** [March 11, 2017, 10:20pm UTC](https://discuss.elastic.co/t/elasticsearch-net-sniffingconnectionpool-requires-open-transport-port/75727/5 "2017-03-11T22:20:36Z")

</div>

@DejongheE elastic cloud is not expected to work with the `SniffingConnectionPool`. Elastic Cloud exposes a single proxy url.

When you use the SniffingConnectionPool this is what happens (the responses `ApiCall` property will list out an `AuditTrail`.

- `SniffOnStartup`, first time usage of client we reach out
- `SniffSuccess`, sniffing returns the node but these are all private IPs
- `PingFailure`, we try to use the first node on a private ip so we ping which will fail.
- `SniffOnFail`, we resniff the cluster on failures by default so we attempt to sniff again
- `SniffFailure`, sniff on our node fails.

Please use the `SingleNodeConnectionPool`

@Babadofar the client will never communicate over the transport layer so this is definitely not a requirent. Mind sharing a bit more about your set up and also copy what `DebugInformation` returns on the response/exception. Preferably on the issue @forloop opened 🙂

---

<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:** [April 8, 2017, 10:21pm UTC](https://discuss.elastic.co/t/elasticsearch-net-sniffingconnectionpool-requires-open-transport-port/75727/6 "2017-04-08T22:21:03Z")

</div>

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