# Getting ClusterBlockException while running queries using node client

**URL:** https://discuss.elastic.co/t/getting-clusterblockexception-while-running-queries-using-node-client/39463
**Category:** Elasticsearch
**Created:** [January 18, 2016, 3:17pm UTC](https://discuss.elastic.co/t/getting-clusterblockexception-while-running-queries-using-node-client/39463 "2016-01-18T15:17:15Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![anjith.p](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@anjith.p](https://discuss.elastic.co/u/anjith.p)
#### Post date: [January 18, 2016, 3:17pm UTC](https://discuss.elastic.co/t/getting-clusterblockexception-while-running-queries-using-node-client/39463/1 "2016-01-18T15:17:16Z")

</div>

My elasticsearch cluster(version 2.0) is started and the node client is built successfully, but for some reason I'm getting the following error while running queries using node client.

> 20:15:15.479 [Pool:entitytaskscheduler: Thread#1] DEBUG c.b.o.e.t.c.DataCollectorStatusUpdateTask - collectors updated due to agent reconnected:{}  
> ClusterBlockException[blocked by: [SERVICE\_UNAVAILABLE/1/state not recovered / initialized];]  
> at org.elasticsearch.cluster.block.ClusterBlocks.globalBlockedException(ClusterBlocks.java:154)  
> at org.elasticsearch.cluster.block.ClusterBlocks.globalBlockedRaiseException(ClusterBlocks.java:144)  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.(TransportSearchTypeAction.java:116)  
> at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.(TransportSearchQueryThenFetchAction.java:73)  
> at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.(TransportSearchQueryThenFetchAction.java:67)  
> at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction.doExecute(TransportSearchQueryThenFetchAction.java:64)  
> at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction.doExecute(TransportSearchQueryThenFetchAction.java:53)  
> at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:70)  
> at org.elasticsearch.action.search.TransportSearchAction.doExecute(TransportSearchAction.java:99)  
> at org.elasticsearch.action.search.TransportSearchAction.doExecute(TransportSearchAction.java:44)  
> at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:70)  
> at org.elasticsearch.client.node.NodeClient.doExecute(NodeClient.java:58)  
> at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:347)  
> at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:85)  
> at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:59)  
> at com.hidden.ppp.management.dc.DataCollectorPollStatusDAOESImpl.findDCIdsUpdatedInTime(DataCollectorPollStatusDAOESImpl.java:151)  
> at com.hidden.ppp.engine.taskexecutor.cptaskexecs.DataCollectorStatusUpdateTask.execute(DataCollectorStatusUpdateTask.java:199)  
> at com.hidden.ppp.engine.taskexecutor.cptaskexecs.DataCollectorStatusUpdateTaskRunner.run(DataCollectorStatusUpdateTaskRunner.java:27)  
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)  
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)  
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)  
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)  
> 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)  
> 20:15:15.558 [Pool:entitytaskscheduler: Thread#1] WARN c.b.o.m.d.DataCollectorPollStatusDAOESImpl - blocked by: [SERVICE\_UNAVAILABLE/1/state not recovered / initialized];  
> 20:15:15.558 [Pool:entitytaskscheduler: Thread#1] DEBUG c.b.o.e.t.c.DataCollectorStatusUpdateTask - collectors for which polls updated after epoc time:1453128243336 - dcids:   
> ClusterBlockException[blocked by: [SERVICE\_UNAVAILABLE/1/state not recovered / initialized];]  
> at org.elasticsearch.cluster.block.ClusterBlocks.globalBlockedException(ClusterBlocks.java:154)  
> at org.elasticsearch.cluster.block.ClusterBlocks.globalBlockedRaiseException(ClusterBlocks.java:144)  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.(TransportSearchTypeAction.java:116)  
> at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.(TransportSearchQueryThenFetchAction.java:73)  
> at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.(TransportSearchQueryThenFetchAction.java:67)

I've even disabled the "multicast" as per this [post](https://groups.google.com/forum/embed/#!topic/elasticsearch/uNRGDdwAi-g) - still no luck. Surprisingly, I could access the elasticsearch from sense. Any clues on what is going wrong ?

---

<div class="post-metadata">

### Author: ![anjith.p](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@anjith.p](https://discuss.elastic.co/u/anjith.p)
#### Post date: [January 19, 2016, 6:57am UTC](https://discuss.elastic.co/t/getting-clusterblockexception-while-running-queries-using-node-client/39463/2 "2016-01-19T06:57:49Z")

</div>



---

<div class="post-metadata">

### Author: ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)
#### Post date: [January 19, 2016, 9:44am UTC](https://discuss.elastic.co/t/getting-clusterblockexception-while-running-queries-using-node-client/39463/3 "2016-01-19T09:44:03Z")

</div>

It would be useful for other users who might experience this issue in the future if you could explain how you resolved the issue?

---

<div class="post-metadata">

### Author: ![anjith.p](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@anjith.p](https://discuss.elastic.co/u/anjith.p)
#### Post date: [January 19, 2016, 9:55am UTC](https://discuss.elastic.co/t/getting-clusterblockexception-while-running-queries-using-node-client/39463/4 "2016-01-19T09:55:35Z")

</div>

I take back from statement: I'm still getting the exception ☹ Please help. This is the latest exception:

> org.elasticsearch.discovery.MasterNotDiscoveredException: waited for [30s]  
> at org.elasticsearch.action.support.master.TransportMasterNodeAction$4.onTimeout(TransportMasterNodeAction.java:154) ~[agent-foundation-2.5.00-RELEASE.jar:na]  
> at org.elasticsearch.cluster.ClusterStateObserver$ObserverClusterStateListener.onTimeout(ClusterStateObserver.java:239) ~[agent-foundation-2.5.00-RELEASE.jar:na]  
> at org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:574) ~[agent-foundation-2.5.00-RELEASE.jar:na]  
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0\_66]  
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0\_66]  
> at java.lang.Thread.run(Thread.java:745) [na:1.8.0\_66]

---

<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:23pm UTC](https://discuss.elastic.co/t/getting-clusterblockexception-while-running-queries-using-node-client/39463/5 "2017-07-05T23:23:28Z")

</div>


