# CurrentState\[RECOVERING\] operations only allowed when started/relocated | action.search.type | All shards failed for phase: \[dfs\]

**URL:** <https://discuss.elastic.co/t/currentstate-recovering-operations-only-allowed-when-started-relocated-action-search-type-all-shards-failed-for-phase-dfs/26756>\
**Category:** Elasticsearch\
**Created:** [August 3, 2015, 10:20pm UTC](https://discuss.elastic.co/t/currentstate-recovering-operations-only-allowed-when-started-relocated-action-search-type-all-shards-failed-for-phase-dfs/26756 "2015-08-03T22:20:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![orenClamour](https://avatars.discourse-cdn.com/v4/letter/o/8491ac/32.png) [@orenClamour](https://discuss.elastic.co/u/orenClamour)\
**Post date:** [August 3, 2015, 10:20pm UTC](https://discuss.elastic.co/t/currentstate-recovering-operations-only-allowed-when-started-relocated-action-search-type-all-shards-failed-for-phase-dfs/26756/1 "2015-08-03T22:20:33Z")

</div>

The issue were seeing on production seems to be that a shard of ES is stuck in the recovery state and we attempt to search it when it's in this state causing the exception.

From time to time we get this error, which results in nothing returning from a search, we are using ES version 1.7.1 on Found:

17:55:57 DEBUG action.search.type i17@z0 [2015-08-03 21:55:57,142][DEBUG][action.search.type] All shards failed for phase: [dfs] org.elasticsearch.transport.RemoteTransportException: [instance-0000000018][inet[...]][indices:data/read/search[phase/dfs]] Caused by: org.elasticsearch.index.shard.IllegalIndexShardStateException: [clamour\_postv1][1] CurrentState[RECOVERING] operations only allowed when started/relocated at org.elasticsearch.index.shard.IndexShard.readAllowed(IndexShard.java:1004) at org.elasticsearch.index.shard.IndexShard.acquireSearcher(IndexShard.java:797) at org.elasticsearch.index.shard.IndexShard.acquireSearcher(IndexShard.java:793) at org.elasticsearch.search.SearchService.createContext(SearchService.java:564) at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:544) at org.elasticsearch.search.SearchService.executeDfsPhase(SearchService.java:223) at org.elasticsearch.search.action.SearchServiceTransportAction$SearchDfsTransportHandler.messageReceived(SearchServiceTransportAction.java:757) at org.elasticsearch.search.action.SearchServiceTransportAction$SearchDfsTransportHandler.messageReceived(SearchServiceTransportAction.java:748) at org.elasticsearch.shield.transport.ShieldServerTransportService$ProfileSecuredRequestHandler.messageReceived(ShieldServerTransportService.java:176) at org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler.doRun(MessageChannelHandler.java:279) at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:36) 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)

---

<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:57pm UTC](https://discuss.elastic.co/t/currentstate-recovering-operations-only-allowed-when-started-relocated-action-search-type-all-shards-failed-for-phase-dfs/26756/2 "2017-07-05T23:57:37Z")

</div>


