# Org.elasticsearch.action.UnavailableShardsException

**URL:** <https://discuss.elastic.co/t/org-elasticsearch-action-unavailableshardsexception/7504>\
**Category:** Elasticsearch\
**Created:** [April 28, 2012, 9:06pm UTC](https://discuss.elastic.co/t/org-elasticsearch-action-unavailableshardsexception/7504 "2012-04-28T21:06:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Slava\_G](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@Slava\_G](https://discuss.elastic.co/u/Slava_G)\
**Post date:** [April 28, 2012, 9:06pm UTC](https://discuss.elastic.co/t/org-elasticsearch-action-unavailableshardsexception/7504/1 "2012-04-28T21:06:14Z")

</div>

Hi,  
I have java code that index documents.  
This code worked fine when I worked with index name for the indexing.  
Now I switched to use alias instead of index name and I started to get  
this exception:  
org.elasticsearch.action.UnavailableShardsException [index][0] [3]  
shardIt, [1] active : Timeout waiting for [1m], request: index  
{[index]...

My index cluster is one computer (localhost), the connection to es is  
fine and I can create index and alias.  
But indexing doc is failed.  
May be my usage of the alias instead of index name is wrong for  
indexing doc ?

Thank You.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 29, 2012, 5:56pm UTC](https://discuss.elastic.co/t/org-elasticsearch-action-unavailableshardsexception/7504/2 "2012-04-29T17:56:13Z")

</div>

There isn't really a different between using an alias and an index, the  
mentioned failure means that the shard has not been allocated (yet) on the  
cluster.

On Sun, Apr 29, 2012 at 12:06 AM, slavag [slavago@gmail.com](mailto:slavago@gmail.com) wrote:

> Hi,  
> I have java code that index documents.  
> This code worked fine when I worked with index name for the indexing.  
> Now I switched to use alias instead of index name and I started to get  
> this exception:  
> org.elasticsearch.action.UnavailableShardsException [index][0] [3]  
> shardIt, [1] active : Timeout waiting for [1m], request: index  
> {[index]...
> 
> My index cluster is one computer (localhost), the connection to es is  
> fine and I can create index and alias.  
> But indexing doc is failed.  
> May be my usage of the alias instead of index name is wrong for  
> indexing doc ?
> 
> Thank You.

---

<div class="post-metadata">

**Author:** ![Slava\_G](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@Slava\_G](https://discuss.elastic.co/u/Slava_G)\
**Post date:** [May 3, 2012, 3:48pm UTC](https://discuss.elastic.co/t/org-elasticsearch-action-unavailableshardsexception/7504/3 "2012-05-03T15:48:09Z")

</div>

I think i fixed this by reducing number of replicas.  
Thank You.

On Apr 29, 8:56 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> There isn't really a different between using an alias and an index, the  
> mentioned failure means that the shard has not been allocated (yet) on the  
> cluster.
> 
> On Sun, Apr 29, 2012 at 12:06 AM, slavag [slav...@gmail.com](mailto:slav...@gmail.com) wrote:
> 
> > Hi,  
> > I have java code that index documents.  
> > This code worked fine when I worked with index name for the indexing.  
> > Now I switched to use alias instead of index name and I started to get  
> > this exception:  
> > org.elasticsearch.action.UnavailableShardsException [index][0] [3]  
> > shardIt, [1] active : Timeout waiting for [1m], request: index  
> > {[index]...
> 
> > My index cluster is one computer (localhost), the connection to es is  
> > fine and I can create index and alias.  
> > But indexing doc is failed.  
> > May be my usage of the alias instead of index name is wrong for  
> > indexing doc ?
> 
> > Thank You.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 4, 2012, 1:59pm UTC](https://discuss.elastic.co/t/org-elasticsearch-action-unavailableshardsexception/7504/4 "2012-05-04T13:59:52Z")

</div>

Did you have somethign like 4 replicas and started only one node case? In  
this case, yes, indexing will fail because it, by default, requires a  
quorum of shards to be available. See more on write consistency in the  
index API docs.

On Thu, May 3, 2012 at 6:48 PM, slavag [slavago@gmail.com](mailto:slavago@gmail.com) wrote:

> I think i fixed this by reducing number of replicas.  
> Thank You.
> 
> On Apr 29, 8:56 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> 
> > There isn't really a different between using an alias and an index, the  
> > mentioned failure means that the shard has not been allocated (yet) on  
> > the  
> > cluster.
> > 
> > On Sun, Apr 29, 2012 at 12:06 AM, slavag [slav...@gmail.com](mailto:slav...@gmail.com) wrote:
> > 
> > > Hi,  
> > > I have java code that index documents.  
> > > This code worked fine when I worked with index name for the indexing.  
> > > Now I switched to use alias instead of index name and I started to get  
> > > this exception:  
> > > org.elasticsearch.action.UnavailableShardsException [index][0] [3]  
> > > shardIt, [1] active : Timeout waiting for [1m], request: index  
> > > {[index]...
> > 
> > > My index cluster is one computer (localhost), the connection to es is  
> > > fine and I can create index and alias.  
> > > But indexing doc is failed.  
> > > May be my usage of the alias instead of index name is wrong for  
> > > indexing doc ?
> > 
> > > Thank You.

---

<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:30am UTC](https://discuss.elastic.co/t/org-elasticsearch-action-unavailableshardsexception/7504/5 "2017-07-06T03:30:04Z")

</div>


