# Seeing many new exceptions in latest master build

**URL:** <https://discuss.elastic.co/t/seeing-many-new-exceptions-in-latest-master-build/3092>\
**Category:** Elasticsearch\
**Created:** [July 12, 2010, 8:26pm UTC](https://discuss.elastic.co/t/seeing-many-new-exceptions-in-latest-master-build/3092 "2010-07-12T20:26:17Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samuel\_Doyle](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@Samuel\_Doyle](https://discuss.elastic.co/u/Samuel_Doyle)\
**Post date:** [July 12, 2010, 8:26pm UTC](https://discuss.elastic.co/t/seeing-many-new-exceptions-in-latest-master-build/3092/1 "2010-07-12T20:26:17Z")

</div>

I'm many exceptions I have encountered previously, here is one to start  
with.

When I attempt to do a batch index, I delete the old index and recreate it.  
I then will check several times to see if the index exists using:

statusResponse = client.admin().indices().status(new  
IndicesStatusRequest()).actionGet() // If i specify a name for an index that  
doesn't exist I get an exception.

Before if I specified the index name I had created in the request I would  
get an exception if it didn't exist, now even not even specifying the name I  
get the exception, I need to make sure the index exists before continuing  
but this makes it impossible since the check itself throws the exception.

Here is the link to the stacktrace: [http://www.pastie.org/1041486](http://www.pastie.org/1041486)

---

<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:** [July 12, 2010, 9:38pm UTC](https://discuss.elastic.co/t/seeing-many-new-exceptions-in-latest-master-build/3092/2 "2010-07-12T21:38:07Z")

</div>

Not sure I understand exactly what you do and when you get an exception, can  
you explain it a bit better? A few questions, how do you get a Client  
instance, out of a Node?

On Mon, Jul 12, 2010 at 11:26 PM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:

> I'm many exceptions I have encountered previously, here is one to start  
> with.
> 
> When I attempt to do a batch index, I delete the old index and recreate it.  
> I then will check several times to see if the index exists using:
> 
> statusResponse = client.admin().indices().status(new  
> IndicesStatusRequest()).actionGet() // If i specify a name for an index that  
> doesn't exist I get an exception.
> 
> Before if I specified the index name I had created in the request I would  
> get an exception if it didn't exist, now even not even specifying the name I  
> get the exception, I need to make sure the index exists before continuing  
> but this makes it impossible since the check itself throws the exception.
> 
> Here is the link to the stacktrace: [http://www.pastie.org/1041486](http://www.pastie.org/1041486)

---

<div class="post-metadata">

**Author:** ![Samuel\_Doyle](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@Samuel\_Doyle](https://discuss.elastic.co/u/Samuel_Doyle)\
**Post date:** [July 12, 2010, 9:57pm UTC](https://discuss.elastic.co/t/seeing-many-new-exceptions-in-latest-master-build/3092/3 "2010-07-12T21:57:26Z")

</div>

Hi, yes that is what I am doing.

node =  
nodeBuilder().client(true).data(false).clusterName(clusterName).node()  
client = node.client()

I have what I'm doing in the initial post,

1. delete index
2. create index
3. verify index is created via the status request because I encountered  
problems before where I would attempt to index but the index was not yet  
available/created and would throw the exception so I put this check in.  
My first attempt to check would include the index name in the status request  
but that to would throw an exception, so I just do the request without any  
name and it would work.  
Now it throws the exception.

On Mon, Jul 12, 2010 at 2:38 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Not sure I understand exactly what you do and when you get an exception,  
> can you explain it a bit better? A few questions, how do you get a Client  
> instance, out of a Node?
> 
> On Mon, Jul 12, 2010 at 11:26 PM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> 
> > I'm many exceptions I have encountered previously, here is one to start  
> > with.
> > 
> > When I attempt to do a batch index, I delete the old index and recreate  
> > it. I then will check several times to see if the index exists using:
> > 
> > statusResponse = client.admin().indices().status(new  
> > IndicesStatusRequest()).actionGet() // If i specify a name for an index that  
> > doesn't exist I get an exception.
> > 
> > Before if I specified the index name I had created in the request I would  
> > get an exception if it didn't exist, now even not even specifying the name I  
> > get the exception, I need to make sure the index exists before continuing  
> > but this makes it impossible since the check itself throws the exception.
> > 
> > Here is the link to the stacktrace: [http://www.pastie.org/1041486](http://www.pastie.org/1041486)

---

<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:** [July 12, 2010, 10:05pm UTC](https://discuss.elastic.co/t/seeing-many-new-exceptions-in-latest-master-build/3092/4 "2010-07-12T22:05:25Z")

</div>

This might be because the index was created, but shards have not been  
allocated to it yet. What you can do is use the cluster health API, here is  
an example (using the new Java API):

client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();

-shay.banon

On Tue, Jul 13, 2010 at 12:57 AM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:

> Hi, yes that is what I am doing.
> 
> node =  
> nodeBuilder().client(true).data(false).clusterName(clusterName).node()  
> client = node.client()
> 
> I have what I'm doing in the initial post,
> 
> 1. delete index
> 2. create index
> 3. verify index is created via the status request because I encountered  
> problems before where I would attempt to index but the index was not yet  
> available/created and would throw the exception so I put this check in.  
> My first attempt to check would include the index name in the status  
> request but that to would throw an exception, so I just do the request  
> without any name and it would work.  
> Now it throws the exception.
> 
> On Mon, Jul 12, 2010 at 2:38 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:
> 
> > Not sure I understand exactly what you do and when you get an exception,  
> > can you explain it a bit better? A few questions, how do you get a Client  
> > instance, out of a Node?
> > 
> > On Mon, Jul 12, 2010 at 11:26 PM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> > 
> > > I'm many exceptions I have encountered previously, here is one to start  
> > > with.
> > > 
> > > When I attempt to do a batch index, I delete the old index and recreate  
> > > it. I then will check several times to see if the index exists using:
> > > 
> > > statusResponse = client.admin().indices().status(new  
> > > IndicesStatusRequest()).actionGet() // If i specify a name for an index that  
> > > doesn't exist I get an exception.
> > > 
> > > Before if I specified the index name I had created in the request I would  
> > > get an exception if it didn't exist, now even not even specifying the name I  
> > > get the exception, I need to make sure the index exists before continuing  
> > > but this makes it impossible since the check itself throws the exception.
> > > 
> > > Here is the link to the stacktrace: [http://www.pastie.org/1041486](http://www.pastie.org/1041486)

---

<div class="post-metadata">

**Author:** ![Samuel\_Doyle](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@Samuel\_Doyle](https://discuss.elastic.co/u/Samuel_Doyle)\
**Post date:** [July 12, 2010, 10:09pm UTC](https://discuss.elastic.co/t/seeing-many-new-exceptions-in-latest-master-build/3092/5 "2010-07-12T22:09:01Z")

</div>

Ok great, I'll give that a try, thanks.

On Mon, Jul 12, 2010 at 3:05 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> This might be because the index was created, but shards have not been  
> allocated to it yet. What you can do is use the cluster health API, here is  
> an example (using the new Java API):
> 
> client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();
> 
> -shay.banon
> 
> On Tue, Jul 13, 2010 at 12:57 AM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> 
> > Hi, yes that is what I am doing.
> > 
> > node =  
> > nodeBuilder().client(true).data(false).clusterName(clusterName).node()  
> > client = node.client()
> > 
> > I have what I'm doing in the initial post,
> > 
> > 1. delete index
> > 2. create index
> > 3. verify index is created via the status request because I encountered  
> > problems before where I would attempt to index but the index was not yet  
> > available/created and would throw the exception so I put this check in.  
> > My first attempt to check would include the index name in the status  
> > request but that to would throw an exception, so I just do the request  
> > without any name and it would work.  
> > Now it throws the exception.
> > 
> > On Mon, Jul 12, 2010 at 2:38 PM, Shay Banon \<[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)
> > 
> > > wrote:
> > 
> > > Not sure I understand exactly what you do and when you get an exception,  
> > > can you explain it a bit better? A few questions, how do you get a Client  
> > > instance, out of a Node?
> > > 
> > > On Mon, Jul 12, 2010 at 11:26 PM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> > > 
> > > > I'm many exceptions I have encountered previously, here is one to start  
> > > > with.
> > > > 
> > > > When I attempt to do a batch index, I delete the old index and recreate  
> > > > it. I then will check several times to see if the index exists using:
> > > > 
> > > > statusResponse = client.admin().indices().status(new  
> > > > IndicesStatusRequest()).actionGet() // If i specify a name for an index that  
> > > > doesn't exist I get an exception.
> > > > 
> > > > Before if I specified the index name I had created in the request I  
> > > > would get an exception if it didn't exist, now even not even specifying the  
> > > > name I get the exception, I need to make sure the index exists before  
> > > > continuing but this makes it impossible since the check itself throws the  
> > > > exception.
> > > > 
> > > > Here is the link to the stacktrace: [http://www.pastie.org/1041486](http://www.pastie.org/1041486)

---

<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:** [July 12, 2010, 10:10pm UTC](https://discuss.elastic.co/t/seeing-many-new-exceptions-in-latest-master-build/3092/6 "2010-07-12T22:10:37Z")

</div>

Let me just explain what it does, it will wait for 30 seconds (the default  
timeout value) for the cluster to be in yellow state, which means at least  
one shard per shard replica set has been allocated to a node.

-shay.banon

On Tue, Jul 13, 2010 at 1:09 AM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com) wrote:

> Ok great, I'll give that a try, thanks.
> 
> On Mon, Jul 12, 2010 at 3:05 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:
> 
> > This might be because the index was created, but shards have not been  
> > allocated to it yet. What you can do is use the cluster health API, here is  
> > an example (using the new Java API):
> > 
> > client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();
> > 
> > -shay.banon
> > 
> > On Tue, Jul 13, 2010 at 12:57 AM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> > 
> > > Hi, yes that is what I am doing.
> > > 
> > > node =  
> > > nodeBuilder().client(true).data(false).clusterName(clusterName).node()  
> > > client = node.client()
> > > 
> > > I have what I'm doing in the initial post,
> > > 
> > > 1. delete index
> > > 2. create index
> > > 3. verify index is created via the status request because I encountered  
> > > problems before where I would attempt to index but the index was not yet  
> > > available/created and would throw the exception so I put this check in.  
> > > My first attempt to check would include the index name in the status  
> > > request but that to would throw an exception, so I just do the request  
> > > without any name and it would work.  
> > > Now it throws the exception.
> > > 
> > > On Mon, Jul 12, 2010 at 2:38 PM, Shay Banon \<  
> > > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)\> wrote:
> > > 
> > > > Not sure I understand exactly what you do and when you get an exception,  
> > > > can you explain it a bit better? A few questions, how do you get a Client  
> > > > instance, out of a Node?
> > > > 
> > > > On Mon, Jul 12, 2010 at 11:26 PM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> > > > 
> > > > > I'm many exceptions I have encountered previously, here is one to start  
> > > > > with.
> > > > > 
> > > > > When I attempt to do a batch index, I delete the old index and recreate  
> > > > > it. I then will check several times to see if the index exists using:
> > > > > 
> > > > > statusResponse = client.admin().indices().status(new  
> > > > > IndicesStatusRequest()).actionGet() // If i specify a name for an index that  
> > > > > doesn't exist I get an exception.
> > > > > 
> > > > > Before if I specified the index name I had created in the request I  
> > > > > would get an exception if it didn't exist, now even not even specifying the  
> > > > > name I get the exception, I need to make sure the index exists before  
> > > > > continuing but this makes it impossible since the check itself throws the  
> > > > > exception.
> > > > > 
> > > > > Here is the link to the stacktrace: [http://www.pastie.org/1041486](http://www.pastie.org/1041486)

---

<div class="post-metadata">

**Author:** ![Samuel\_Doyle](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@Samuel\_Doyle](https://discuss.elastic.co/u/Samuel_Doyle)\
**Post date:** [July 13, 2010, 4:26am UTC](https://discuss.elastic.co/t/seeing-many-new-exceptions-in-latest-master-build/3092/7 "2010-07-13T04:26:36Z")

</div>

Hi, what about the case where I want to make sure the index has been fully  
deleted after issuing a delete request?

On Mon, Jul 12, 2010 at 3:10 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Let me just explain what it does, it will wait for 30 seconds (the default  
> timeout value) for the cluster to be in yellow state, which means at least  
> one shard per shard replica set has been allocated to a node.
> 
> -shay.banon
> 
> On Tue, Jul 13, 2010 at 1:09 AM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> 
> > Ok great, I'll give that a try, thanks.
> > 
> > On Mon, Jul 12, 2010 at 3:05 PM, Shay Banon \<[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)
> > 
> > > wrote:
> > 
> > > This might be because the index was created, but shards have not been  
> > > allocated to it yet. What you can do is use the cluster health API, here is  
> > > an example (using the new Java API):
> > > 
> > > client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();
> > > 
> > > -shay.banon
> > > 
> > > On Tue, Jul 13, 2010 at 12:57 AM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> > > 
> > > > Hi, yes that is what I am doing.
> > > > 
> > > > node =  
> > > > nodeBuilder().client(true).data(false).clusterName(clusterName).node()  
> > > > client = node.client()
> > > > 
> > > > I have what I'm doing in the initial post,
> > > > 
> > > > 1. delete index
> > > > 2. create index
> > > > 3. verify index is created via the status request because I encountered  
> > > > problems before where I would attempt to index but the index was not yet  
> > > > available/created and would throw the exception so I put this check in.  
> > > > My first attempt to check would include the index name in the status  
> > > > request but that to would throw an exception, so I just do the request  
> > > > without any name and it would work.  
> > > > Now it throws the exception.
> > > > 
> > > > On Mon, Jul 12, 2010 at 2:38 PM, Shay Banon \<  
> > > > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)\> wrote:
> > > > 
> > > > > Not sure I understand exactly what you do and when you get an  
> > > > > exception, can you explain it a bit better? A few questions, how do you get  
> > > > > a Client instance, out of a Node?
> > > > > 
> > > > > On Mon, Jul 12, 2010 at 11:26 PM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> > > > > 
> > > > > > I'm many exceptions I have encountered previously, here is one to  
> > > > > > start with.
> > > > > > 
> > > > > > When I attempt to do a batch index, I delete the old index and  
> > > > > > recreate it. I then will check several times to see if the index exists  
> > > > > > using:
> > > > > > 
> > > > > > statusResponse = client.admin().indices().status(new  
> > > > > > IndicesStatusRequest()).actionGet() // If i specify a name for an index that  
> > > > > > doesn't exist I get an exception.
> > > > > > 
> > > > > > Before if I specified the index name I had created in the request I  
> > > > > > would get an exception if it didn't exist, now even not even specifying the  
> > > > > > name I get the exception, I need to make sure the index exists before  
> > > > > > continuing but this makes it impossible since the check itself throws the  
> > > > > > exception.
> > > > > > 
> > > > > > Here is the link to the stacktrace: [http://www.pastie.org/1041486](http://www.pastie.org/1041486)

---

<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:** [July 13, 2010, 7:16am UTC](https://discuss.elastic.co/t/seeing-many-new-exceptions-in-latest-master-build/3092/8 "2010-07-13T07:16:36Z")

</div>

That does not suffer from the above problem. One the method returns, the  
index has deleted. Do you see something different?

-shay.banon

On Tue, Jul 13, 2010 at 7:26 AM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com) wrote:

> Hi, what about the case where I want to make sure the index has been fully  
> deleted after issuing a delete request?
> 
> On Mon, Jul 12, 2010 at 3:10 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:
> 
> > Let me just explain what it does, it will wait for 30 seconds (the default  
> > timeout value) for the cluster to be in yellow state, which means at least  
> > one shard per shard replica set has been allocated to a node.
> > 
> > -shay.banon
> > 
> > On Tue, Jul 13, 2010 at 1:09 AM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> > 
> > > Ok great, I'll give that a try, thanks.
> > > 
> > > On Mon, Jul 12, 2010 at 3:05 PM, Shay Banon \<  
> > > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)\> wrote:
> > > 
> > > > This might be because the index was created, but shards have not been  
> > > > allocated to it yet. What you can do is use the cluster health API, here is  
> > > > an example (using the new Java API):
> > > > 
> > > > client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();
> > > > 
> > > > -shay.banon
> > > > 
> > > > On Tue, Jul 13, 2010 at 12:57 AM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> > > > 
> > > > > Hi, yes that is what I am doing.
> > > > > 
> > > > > node =  
> > > > > nodeBuilder().client(true).data(false).clusterName(clusterName).node()  
> > > > > client = node.client()
> > > > > 
> > > > > I have what I'm doing in the initial post,
> > > > > 
> > > > > 1. delete index
> > > > > 2. create index
> > > > > 3. verify index is created via the status request because I encountered  
> > > > > problems before where I would attempt to index but the index was not yet  
> > > > > available/created and would throw the exception so I put this check in.  
> > > > > My first attempt to check would include the index name in the status  
> > > > > request but that to would throw an exception, so I just do the request  
> > > > > without any name and it would work.  
> > > > > Now it throws the exception.
> > > > > 
> > > > > On Mon, Jul 12, 2010 at 2:38 PM, Shay Banon \<  
> > > > > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)\> wrote:
> > > > > 
> > > > > > Not sure I understand exactly what you do and when you get an  
> > > > > > exception, can you explain it a bit better? A few questions, how do you get  
> > > > > > a Client instance, out of a Node?
> > > > > > 
> > > > > > On Mon, Jul 12, 2010 at 11:26 PM, Samuel Doyle \<[samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)
> > > > > > 
> > > > > > > wrote:
> > > > > > 
> > > > > > > I'm many exceptions I have encountered previously, here is one to  
> > > > > > > start with.
> > > > > > > 
> > > > > > > When I attempt to do a batch index, I delete the old index and  
> > > > > > > recreate it. I then will check several times to see if the index exists  
> > > > > > > using:
> > > > > > > 
> > > > > > > statusResponse = client.admin().indices().status(new  
> > > > > > > IndicesStatusRequest()).actionGet() // If i specify a name for an index that  
> > > > > > > doesn't exist I get an exception.
> > > > > > > 
> > > > > > > Before if I specified the index name I had created in the request I  
> > > > > > > would get an exception if it didn't exist, now even not even specifying the  
> > > > > > > name I get the exception, I need to make sure the index exists before  
> > > > > > > continuing but this makes it impossible since the check itself throws the  
> > > > > > > exception.
> > > > > > > 
> > > > > > > Here is the link to the stacktrace: [http://www.pastie.org/1041486](http://www.pastie.org/1041486)

---

<div class="post-metadata">

**Author:** ![Samuel\_Doyle](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@Samuel\_Doyle](https://discuss.elastic.co/u/Samuel_Doyle)\
**Post date:** [July 13, 2010, 9:51am UTC](https://discuss.elastic.co/t/seeing-many-new-exceptions-in-latest-master-build/3092/9 "2010-07-13T09:51:37Z")

</div>

I was following the same pattern as on the create where I would test using  
an IndicesStatusRequest after the DeleteIndexRequest to verify the delete.  
If this is not needed it is good to know.

Thanks

On Tue, Jul 13, 2010 at 12:16 AM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> That does not suffer from the above problem. One the method returns, the  
> index has deleted. Do you see something different?
> 
> -shay.banon
> 
> On Tue, Jul 13, 2010 at 7:26 AM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> 
> > Hi, what about the case where I want to make sure the index has been fully  
> > deleted after issuing a delete request?
> > 
> > On Mon, Jul 12, 2010 at 3:10 PM, Shay Banon \<[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)
> > 
> > > wrote:
> > 
> > > Let me just explain what it does, it will wait for 30 seconds (the  
> > > default timeout value) for the cluster to be in yellow state, which means at  
> > > least one shard per shard replica set has been allocated to a node.
> > > 
> > > -shay.banon
> > > 
> > > On Tue, Jul 13, 2010 at 1:09 AM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> > > 
> > > > Ok great, I'll give that a try, thanks.
> > > > 
> > > > On Mon, Jul 12, 2010 at 3:05 PM, Shay Banon \<  
> > > > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)\> wrote:
> > > > 
> > > > > This might be because the index was created, but shards have not been  
> > > > > allocated to it yet. What you can do is use the cluster health API, here is  
> > > > > an example (using the new Java API):
> > > > > 
> > > > > client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();
> > > > > 
> > > > > -shay.banon
> > > > > 
> > > > > On Tue, Jul 13, 2010 at 12:57 AM, Samuel Doyle [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)wrote:
> > > > > 
> > > > > > Hi, yes that is what I am doing.
> > > > > > 
> > > > > > node =  
> > > > > > nodeBuilder().client(true).data(false).clusterName(clusterName).node()  
> > > > > > client = node.client()
> > > > > > 
> > > > > > I have what I'm doing in the initial post,
> > > > > > 
> > > > > > 1. delete index
> > > > > > 2. create index
> > > > > > 3. verify index is created via the status request because I  
> > > > > > encountered problems before where I would attempt to index but the index was  
> > > > > > not yet available/created and would throw the exception so I put this check  
> > > > > > in.  
> > > > > > My first attempt to check would include the index name in the status  
> > > > > > request but that to would throw an exception, so I just do the request  
> > > > > > without any name and it would work.  
> > > > > > Now it throws the exception.
> > > > > > 
> > > > > > On Mon, Jul 12, 2010 at 2:38 PM, Shay Banon \<  
> > > > > > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)\> wrote:
> > > > > > 
> > > > > > > Not sure I understand exactly what you do and when you get an  
> > > > > > > exception, can you explain it a bit better? A few questions, how do you get  
> > > > > > > a Client instance, out of a Node?
> > > > > > > 
> > > > > > > On Mon, Jul 12, 2010 at 11:26 PM, Samuel Doyle \<  
> > > > > > > [samueldoyle@gmail.com](mailto:samueldoyle@gmail.com)\> wrote:
> > > > > > > 
> > > > > > > > I'm many exceptions I have encountered previously, here is one to  
> > > > > > > > start with.
> > > > > > > > 
> > > > > > > > When I attempt to do a batch index, I delete the old index and  
> > > > > > > > recreate it. I then will check several times to see if the index exists  
> > > > > > > > using:
> > > > > > > > 
> > > > > > > > statusResponse = client.admin().indices().status(new  
> > > > > > > > IndicesStatusRequest()).actionGet() // If i specify a name for an index that  
> > > > > > > > doesn't exist I get an exception.
> > > > > > > > 
> > > > > > > > Before if I specified the index name I had created in the request I  
> > > > > > > > would get an exception if it didn't exist, now even not even specifying the  
> > > > > > > > name I get the exception, I need to make sure the index exists before  
> > > > > > > > continuing but this makes it impossible since the check itself throws the  
> > > > > > > > exception.
> > > > > > > > 
> > > > > > > > Here is the link to the stacktrace: [http://www.pastie.org/1041486](http://www.pastie.org/1041486)

---

<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, 4:22am UTC](https://discuss.elastic.co/t/seeing-many-new-exceptions-in-latest-master-build/3092/10 "2017-07-06T04:22:21Z")

</div>


