Elasticsearch-net: SniffingConnectionPool - Failed sniffing cluster state

Created on 25 Oct 2016  路  5Comments  路  Source: elastic/elasticsearch-net

NEST/Elasticsearch.Net version: 5.0.0-beta1

Elasticsearch version: 5.0.0-rc1

From https://discuss.elastic.co/t/elasticsearch-net-5-0-beta1-sniffingconnectionpool-failed-sniffing-cluster-state/63874:

Not sure if this is the correct forum, but I had this working last week but for the life of me I can't get it to work this week.

Question: Is the SniffingConnectionPool currently supported by the Elasticsearch.net/NEST APIs ?

2 nodes running ES 5.0.0-rc1, on my windows machine, another node on another developers windows machine.

Running these statements from Linqpad:

var nodes = new List<string>(){"http://danny-desktop:9200", "http://danny-desktop:9201", "http://vinay-desktop:9200"};

var uris = nodes.Select(n=> new Uri(n));
var connectionPool = new SniffingConnectionPool(uris);
//var connectionPool = new StickyConnectionPool(uris);

var connectionSettings = new ConnectionSettings(connectionPool);

var client = new ElasticClient(connectionSettings);

var result = client.IndexExists(Indices.Parse("hd20160518"));

result.Dump();

It fails with message "Failed sniffing cluster state." Inner exception stack trace places it at:

at Elasticsearch.Net.Node..ctor(Uri uri)
at Elasticsearch.Net.SniffResponse.<ToNodes>d__11.MoveNext()
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
at Elasticsearch.Net.SniffingConnectionPool.Reseed(IEnumerable`1 nodes)
at Elasticsearch.Net.RequestPipeline.Sniff()

It looks to me like the code is expecting to find a property "http_address" on the result of the request for: _nodes/_all/settings?flat_settings&timeout=2s

Previous versions (1.7 and 2.4) return this property.

any help/advise greatly appreciated.

regards,
Danny

bug v5.0.0-rc1

Most helpful comment

@russcam Got NEST 5.0.1 and all worked after fixing some breaking changes in code. Thanks!

All 5 comments

Hi! Has this made it into a release yet please?

@LeeSalter yes, it's been in since the 5.0.0-rc1 release, per the attached label.

Are you still running into an issue?

Hi @gmarz, I just downloaded v5.1.2 and got the exact same error. Was using NEST 2.4.1 - do I have to use NEST 5.x?

(_updated comment_)

@JessicaQin Yes, NEST 5.x is compatible with Elasticsearch 5.1.2; NEST 2.x is not compatible; it may work for the most part but there are breaking changes in Elasticsearch will that cause NEST 2.x to throw an exception, as in this case

@russcam Got NEST 5.0.1 and all worked after fixing some breaking changes in code. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

codebrain picture codebrain  路  3Comments

Cnordbo picture Cnordbo  路  4Comments

hatem1975 picture hatem1975  路  3Comments

mszczepaniakebsco picture mszczepaniakebsco  路  5Comments

alwag85 picture alwag85  路  5Comments