# ElasticSearch JAVA API gives error after short time

**URL:** <https://discuss.elastic.co/t/elasticsearch-java-api-gives-error-after-short-time/26574>\
**Category:** Elasticsearch\
**Created:** [July 30, 2015, 2:08pm UTC](https://discuss.elastic.co/t/elasticsearch-java-api-gives-error-after-short-time/26574 "2015-07-30T14:08:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fisa](https://avatars.discourse-cdn.com/v4/letter/f/49beb7/32.png) [@Fisa](https://discuss.elastic.co/u/Fisa)\
**Post date:** [July 30, 2015, 2:08pm UTC](https://discuss.elastic.co/t/elasticsearch-java-api-gives-error-after-short-time/26574/1 "2015-07-30T14:08:47Z")

</div>

Hi Everybody,

I am new Elastic-search. I started using elastic-search and now reading from writing to elastic-search through Java code. for that i used elasticsearch-1.5.2.jar. I successfully gets connected to elastic-search through transport port 9300.  
But after sometime I get following errors at different times.

975920 [elasticsearch[Killpower][generic][T#1]] INFO org.elasticsearch.client.transport - [Killpower] failed to get node info for [#transport#-1][rdsa][inet[/172.20.16.5:9300]], disconnecting...org.elasticsearch.transport.ReceiveTimeoutTransportException: [][inet[/172.20.16.5:9300]][cluster:monitor/nodes/info] request\_id [187] timed out after [5001ms] at org.elasticsearch.transport.TransportService$TimeoutHandler.run(TransportService.java:529) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

Error in fetching options ruleorg.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [] at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:305) at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:200) at org.elasticsearch.client.transport.support.InternalTransportClient.execute(InternalTransportClient.java:106) at org.elasticsearch.client.support.AbstractClient.index(AbstractClient.java:98) at org.elasticsearch.client.transport.TransportClient.index(TransportClient.java:326) at org.elasticsearch.action.index.IndexRequestBuilder.doExecute(IndexRequestBuilder.java:313) at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:91) at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:65) at storm.starter.bolt.DBWriterBolt.insertDirectiveEventsinDB(DBWriterBolt.java:781) at storm.starter.bolt.DBWriterBolt.execute(DBWriterBolt.java:254) at backtype.storm.topology.BasicBoltExecutor.execute(BasicBoltExecutor.java:32) at backtype.storm.daemon.executor$fn\_\_4050$tuple\_action\_fn\_\_4052.invoke(executor.clj:566) at backtype.storm.daemon.executor$mk\_task\_receiver$fn\_\_3976.invoke(executor.clj:345) at backtype.storm.disruptor$clojure\_handler$reify\_\_1606.onEvent(disruptor.clj:43) at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:84) at backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:58) at backtype.storm.disruptor$consume\_batch\_when\_available.invoke(disruptor.clj:62) at backtype.storm.daemon.executor$fn\_\_4050$fn\_\_4059$fn\_\_4106.invoke(executor.clj:658) at backtype.storm.util$async\_loop$fn\_\_465.invoke(util.clj:377) at clojure.lang.AFn.run(AFn.java:24) at java.lang.Thread.run(Thread.java:745)

Please Help me with your experience and expert opinion. Thank you.

---

<div class="post-metadata">

**Author:** ![PatrickKik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrickkik/32/619_2.png) [@PatrickKik](https://discuss.elastic.co/u/PatrickKik)\
**Post date:** [August 3, 2015, 5:02am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-gives-error-after-short-time/26574/2 "2015-08-03T05:02:22Z")

</div>

I think that these two are the most common issues:

Please check if your server is of the same version of your client.  
And you should configure the clustername in your client: [https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/transport-client.html](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/transport-client.html).

---

<div class="post-metadata">

**Author:** ![Fisa](https://avatars.discourse-cdn.com/v4/letter/f/49beb7/32.png) [@Fisa](https://discuss.elastic.co/u/Fisa)\
**Post date:** [August 3, 2015, 9:26am UTC](https://discuss.elastic.co/t/elasticsearch-java-api-gives-error-after-short-time/26574/3 "2015-08-03T09:26:49Z")

</div>

I am using elasticsarch 1.5.2 version and the java api I am using is elasticsearch-1.5.2.jar. Both has same version.

---

<div class="post-metadata">

**Author:** ![gmu3](https://avatars.discourse-cdn.com/v4/letter/g/b3f665/32.png) [@gmu3](https://discuss.elastic.co/u/gmu3)\
**Post date:** [September 21, 2015, 8:21pm UTC](https://discuss.elastic.co/t/elasticsearch-java-api-gives-error-after-short-time/26574/4 "2015-09-21T20:21:30Z")

</div>

Did you ever find a solution? I'm experiencing the same thing.

---

<div class="post-metadata">

**Author:** ![roger](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@roger](https://discuss.elastic.co/u/roger)\
**Post date:** [September 21, 2015, 10:05pm UTC](https://discuss.elastic.co/t/elasticsearch-java-api-gives-error-after-short-time/26574/5 "2015-09-21T22:05:55Z")

</div>

We had the same issue and we found out we had the problem described here:

> **[Dealing with NodeNotAvailableExceptions in Elasticsearch](https://blog.trifork.com/2015/04/08/dealing-with-nodenotavailableexceptions-in-elasticsearch/comment-page-1/)**
>
> tl;dr Elasticsearch provides distributed search with minimal setup and configuration. Now the nice thing about it is that, most of the time, you don’t need to be particularly concerned about …

---

<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:** [July 5, 2017, 11:48pm UTC](https://discuss.elastic.co/t/elasticsearch-java-api-gives-error-after-short-time/26574/6 "2017-07-05T23:48:55Z")

</div>


