# Org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to execute phase total failure; shardFailures {\[\_na\_\]\[products\]\[0\]: No active shards}{\[\_na\_\]\[products\]\[1\]: No active shards}{\[\_na\_\]\[products\]\[2\]

**URL:** <https://discuss.elastic.co/t/org-elasticsearch-action-search-searchphaseexecutionexception-failed-to-execute-phase-total-failure-shardfailures--na--products-0-no-active-shards--na--products-1-no-active-shards--na--products-2/8544>\
**Category:** Elasticsearch\
**Created:** [July 27, 2012, 4:57pm UTC](https://discuss.elastic.co/t/org-elasticsearch-action-search-searchphaseexecutionexception-failed-to-execute-phase-total-failure-shardfailures--na--products-0-no-active-shards--na--products-1-no-active-shards--na--products-2/8544 "2012-07-27T16:57:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajasuja18](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@ajasuja18](https://discuss.elastic.co/u/ajasuja18)\
**Post date:** [July 27, 2012, 4:57pm UTC](https://discuss.elastic.co/t/org-elasticsearch-action-search-searchphaseexecutionexception-failed-to-execute-phase-total-failure-shardfailures--na--products-0-no-active-shards--na--products-1-no-active-shards--na--products-2/8544/1 "2012-07-27T16:57:08Z")

</div>

Hey everyone,

I indexed some of the documents through java api and they were in this  
format:

{"pid":10001,"lang":"lang1","properties":[{"name":"prop1","type":"type1","values":["p1v1","p1v2"]}]}  
Indexing works fine for me.

But when I tried to search I got this exception:

Exception in thread "main"  
org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to  
execute phase [dfs], total failure; shardFailures {[_na_][products][0]: No  
active shards}{[_na_][products][1]: No active shards}{[_na_][products][2]:  
No active shards}{[_na_][products][3]: No active  
shards}{[_na_][products][4]: No active shards}  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:259)  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.start(TransportSearchTypeAction.java:144)  
at  
org.elasticsearch.action.search.type.TransportSearchDfsQueryThenFetchAction.doExecute(TransportSearchDfsQueryThenFetchAction.java:62)  
at  
org.elasticsearch.action.search.type.TransportSearchDfsQueryThenFetchAction.doExecute(TransportSearchDfsQueryThenFetchAction.java:52)  
at  
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:61)  
at  
org.elasticsearch.action.search.TransportSearchAction.doExecute(TransportSearchAction.java:106)  
at  
org.elasticsearch.action.search.TransportSearchAction.doExecute(TransportSearchAction.java:43)  
at  
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:61)  
at org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:83)  
at  
org.elasticsearch.client.support.AbstractClient.search(AbstractClient.java:206)  
at  
org.elasticsearch.action.search.SearchRequestBuilder.doExecute(SearchRequestBuilder.java:743)  
at  
org.elasticsearch.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:53)  
at  
org.elasticsearch.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:47)  
at com.ankit.json.IndexJson.search(IndexJson.java:50)  
at com.ankit.json.ToJson.main(ToJson.java:72)

Any help would be greatly appreciated..:!!!

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![rami\_sellami](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@rami\_sellami](https://discuss.elastic.co/u/rami_sellami)\
**Post date:** [August 3, 2012, 9:02am UTC](https://discuss.elastic.co/t/org-elasticsearch-action-search-searchphaseexecutionexception-failed-to-execute-phase-total-failure-shardfailures--na--products-0-no-active-shards--na--products-1-no-active-shards--na--products-2/8544/2 "2012-08-03T09:02:36Z")

</div>

Dear ajasuja,

I have the same error as you. Could you tell me whether you find a solution  
or not yet?

Best regards,  
Rami Sellami.

---

<div class="post-metadata">

**Author:** ![Thiago\_Cardoso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago_cardoso/32/2787_2.png) [@Thiago\_Cardoso](https://discuss.elastic.co/u/Thiago_Cardoso)\
**Post date:** [August 3, 2012, 12:05pm UTC](https://discuss.elastic.co/t/org-elasticsearch-action-search-searchphaseexecutionexception-failed-to-execute-phase-total-failure-shardfailures--na--products-0-no-active-shards--na--products-1-no-active-shards--na--products-2/8544/3 "2012-08-03T12:05:43Z")

</div>

Hi Rami,

I have a similar problem. I couldn't find a way to fix it but waiting  
for 'green status' before querying the created node alleviated the  
problem.

this.client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();

-- Thiago

On Fri, Aug 3, 2012 at 6:02 AM, rami sellami [sel.rami@gmail.com](mailto:sel.rami@gmail.com) wrote:

> Dear ajasuja,
> 
> I have the same error as you. Could you tell me whether you find a solution  
> or not yet?
> 
> Best regards,  
> Rami Sellami.

---

<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 6, 2017, 3:17am UTC](https://discuss.elastic.co/t/org-elasticsearch-action-search-searchphaseexecutionexception-failed-to-execute-phase-total-failure-shardfailures--na--products-0-no-active-shards--na--products-1-no-active-shards--na--products-2/8544/4 "2017-07-06T03:17:51Z")

</div>


