Hello!
I recently updated project dependency of project from co.elastic.clients:elasticsearch-java:7.17.22 to co.elastic.clients:elasticsearch-java:8.14.3
Everything seems working fine first hour.
After an hour exactly client not able to communicate with server.
And it was shared between multiple threads for reading data.
In background I had daemon thread which were checking available nodes every hour
client.nodes().info().nodes().values();
In version 7 it worked fine during off hours, and connection kept alive by java client.
In version 8 seems client or something underneath is closing connection earlier. No warning messages in the logs.
I didn't find anything related in release notes. What should be changed? What timeout value? Or maybe I need to refresh somehow client session? Or client object can't be singleton and should be instantiated with every request?
Dumb me, didn't notice incorrect level of logging exceptions.
Actually connections were working fine in my case.
This is problem of calling client.nodes().info(), it throws exception:
co.elastic.clients.transport.TransportException: node: http://127.0.0.1:9200/, status: 200, [es/nodes.info] Failed to decode response
at co.elastic.clients.transport.ElasticsearchTransportBase.decodeTransportResponse(ElasticsearchTransportBase.java:404)
at co.elastic.clients.transport.ElasticsearchTransportBase.getApiResponse(ElasticsearchTransportBase.java:363)
at co.elastic.clients.transport.ElasticsearchTransportBase.performRequest(ElasticsearchTransportBase.java:147)
at co.elastic.clients.elasticsearch.nodes.ElasticsearchNodesClient.info(ElasticsearchNodesClient.java:229)
at com.termweb4.core.module.search.SearchModuleConfiguration$1.call(SearchModuleConfiguration.java:104)
at com.termweb4.core.module.search.SearchModuleConfiguration$1.call(SearchModuleConfiguration.java:95)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
Caused by: co.elastic.clients.json.JsonpMappingException: Error deserializing co.elastic.clients.elasticsearch.nodes.info.NodeInfoXpack: co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'NodeInfoXpackSecurity.http' (JSON path: nodes.LnKzJ51QQlKmJ4tNcWOO5Q.settings.xpack.security) (line no=1, column no=1508, offset=-1)
at co.elastic.clients.json.JsonpMappingException.from0(JsonpMappingException.java:134)
at co.elastic.clients.json.JsonpMappingException.from(JsonpMappingException.java:121)
at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:218)
I'm trying to connect to elasticsearch 7.17.22 with 8.14.3 client on my localhost with disabled xpack.security.
Yep, I was going to write that same problem occurred with 7.17.23 client too.
Method co.elastic.clients.elasticsearch.nodes.ElasticsearchNodesClient#info() of co.elastic.clients.elasticsearch.ElasticsearchClient#nodes throws this exception.
I switched to use another method for now: co.elastic.clients.elasticsearch.ElasticsearchClient#info
Dependency tree is huge and I'm not allowed to disclose it.
But I'm pretty sure, here I'm using correct versions, this is what I got right now, for client:
Anyway, problem happened before update to v8 client.
Before I did minor update of client from v7.17.17 to v7.17.23. And this brought problems to client.nodes().info() I just missed it because of wrong log level of application.
Yes, I already tried that, it bypassed first error with mapping 'NodeInfoXpackSecurity.http', but then it failed on another field, because JSON contained array value but it expected an object.
I can try later create test repo with this error.
As I said before, replacing call client.nodes.info() with client.info() solved issue, we were simply checking connectivity to cluster with this method.
Hello! I can confirm that client.nodes.info() is currently broken for 7.17.X versions, probably due to changes server side that were not ported to the clients. We'll fix it in newer 7.17 releases, while for 8.14.X it seems to be working correctly. Thank you for reporting this! You can still open an issue in the client repo, it helps us with tracking
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.