# Creating brand new index gets index already exists exception

**URL:** <https://discuss.elastic.co/t/creating-brand-new-index-gets-index-already-exists-exception/13321>\
**Category:** Elasticsearch\
**Created:** [August 24, 2013, 7:09pm UTC](https://discuss.elastic.co/t/creating-brand-new-index-gets-index-already-exists-exception/13321 "2013-08-24T19:09:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tinou\_Bao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tinou_bao/32/1736_2.png) [@Tinou\_Bao](https://discuss.elastic.co/u/Tinou_Bao)\
**Post date:** [August 24, 2013, 7:09pm UTC](https://discuss.elastic.co/t/creating-brand-new-index-gets-index-already-exists-exception/13321/1 "2013-08-24T19:09:03Z")

</div>

What I've noticed is after my cluster (0.19.12) has been running for a few  
days, trying to create a brand new index fails with an index already exists  
exception. This is a brand new index, with a different, unique name. The  
"type" is the same. So I might have:

index\_a, type book mapping  
index\_b, type book mapping

then I try to create index\_c, type book mapping, and get an index already  
exists exception. Using the "head" plugin, I see the index gets created,  
but it exists in a funky state. The primary seems OK, but the replica is  
"unassigned".

During this time, "head" reports the cluster as red. But queries against  
existing indexes seem OK.

I manually delete the bad index\_c then restart the cluster. Now my code can  
create index\_c. A few minutes later, it can also create index\_d.

Only thing that seems consistent is that the cluster

1. has been running for at least a few days. It's like after a few days the  
cluster has some issues?
2. restarting the cluster solves the issue

Obviously I don't want to restart the cluster because I'm trying to  
automatically create these indexes....

Any ideas?

-T

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [August 24, 2013, 7:15pm UTC](https://discuss.elastic.co/t/creating-brand-new-index-gets-index-already-exists-exception/13321/2 "2013-08-24T19:15:45Z")

</div>

You might have had a split-brain scenario where different nodes in the  
cluster were forming sub-clusters. How many nodes do you have and what is  
your replica count for those indexes?

Cheers,

Ivan

On Sat, Aug 24, 2013 at 12:09 PM, Tinou Bao [tinou.bao@gmail.com](mailto:tinou.bao@gmail.com) wrote:

> What I've noticed is after my cluster (0.19.12) has been running for a few  
> days, trying to create a brand new index fails with an index already exists  
> exception. This is a brand new index, with a different, unique name. The  
> "type" is the same. So I might have:
> 
> index\_a, type book mapping  
> index\_b, type book mapping
> 
> then I try to create index\_c, type book mapping, and get an index already  
> exists exception. Using the "head" plugin, I see the index gets created,  
> but it exists in a funky state. The primary seems OK, but the replica is  
> "unassigned".
> 
> During this time, "head" reports the cluster as red. But queries against  
> existing indexes seem OK.
> 
> I manually delete the bad index\_c then restart the cluster. Now my code  
> can create index\_c. A few minutes later, it can also create index\_d.
> 
> Only thing that seems consistent is that the cluster
> 
> 1. has been running for at least a few days. It's like after a few days  
> the cluster has some issues?
> 2. restarting the cluster solves the issue
> 
> Obviously I don't want to restart the cluster because I'm trying to  
> automatically create these indexes....
> 
> Any ideas?
> 
> -T
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Tinou\_Bao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tinou_bao/32/1736_2.png) [@Tinou\_Bao](https://discuss.elastic.co/u/Tinou_Bao)\
**Post date:** [August 24, 2013, 7:23pm UTC](https://discuss.elastic.co/t/creating-brand-new-index-gets-index-already-exists-exception/13321/3 "2013-08-24T19:23:26Z")

</div>

I have 2 master nodes, 2 data nodes. I set replica count to 1. I was  
concerned with the split-brain issue, so I did set

discovery.zen.minimum\_master\_nodes: 2

in the conf files for master and data nodes. Figured if network  
partitioned, then I would get some other error, like "not enough masters."

-T

On Saturday, August 24, 2013 12:15:45 PM UTC-7, Ivan Brusic wrote:

> You might have had a split-brain scenario where different nodes in the  
> cluster were forming sub-clusters. How many nodes do you have and what is  
> your replica count for those indexes?
> 
> Cheers,
> 
> Ivan
> 
> On Sat, Aug 24, 2013 at 12:09 PM, Tinou Bao \<[tino...@gmail.com](mailto:tino...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > What I've noticed is after my cluster (0.19.12) has been running for a  
> > few days, trying to create a brand new index fails with an index already  
> > exists exception. This is a brand new index, with a different, unique name.  
> > The "type" is the same. So I might have:
> > 
> > index\_a, type book mapping  
> > index\_b, type book mapping
> > 
> > then I try to create index\_c, type book mapping, and get an index already  
> > exists exception. Using the "head" plugin, I see the index gets created,  
> > but it exists in a funky state. The primary seems OK, but the replica is  
> > "unassigned".
> > 
> > During this time, "head" reports the cluster as red. But queries against  
> > existing indexes seem OK.
> > 
> > I manually delete the bad index\_c then restart the cluster. Now my code  
> > can create index\_c. A few minutes later, it can also create index\_d.
> > 
> > Only thing that seems consistent is that the cluster
> > 
> > 1. has been running for at least a few days. It's like after a few days  
> > the cluster has some issues?
> > 2. restarting the cluster solves the issue
> > 
> > Obviously I don't want to restart the cluster because I'm trying to  
> > automatically create these indexes....
> > 
> > Any ideas?
> > 
> > -T
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Tinou\_Bao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tinou_bao/32/1736_2.png) [@Tinou\_Bao](https://discuss.elastic.co/u/Tinou_Bao)\
**Post date:** [August 25, 2013, 9:58pm UTC](https://discuss.elastic.co/t/creating-brand-new-index-gets-index-already-exists-exception/13321/4 "2013-08-25T21:58:54Z")

</div>

Realize that the master nodes publish to a virtual IP while the data nodes  
servers are not setup with any virtual IPs. Wondering if this is a  
potential issue. Does zen discovery have issues with VIPs?

-T

On Saturday, August 24, 2013 12:09:03 PM UTC-7, Tinou Bao wrote:

> What I've noticed is after my cluster (0.19.12) has been running for a few  
> days, trying to create a brand new index fails with an index already exists  
> exception. This is a brand new index, with a different, unique name. The  
> "type" is the same. So I might have:
> 
> index\_a, type book mapping  
> index\_b, type book mapping
> 
> then I try to create index\_c, type book mapping, and get an index already  
> exists exception. Using the "head" plugin, I see the index gets created,  
> but it exists in a funky state. The primary seems OK, but the replica is  
> "unassigned".
> 
> During this time, "head" reports the cluster as red. But queries against  
> existing indexes seem OK.
> 
> I manually delete the bad index\_c then restart the cluster. Now my code  
> can create index\_c. A few minutes later, it can also create index\_d.
> 
> Only thing that seems consistent is that the cluster
> 
> 1. has been running for at least a few days. It's like after a few days  
> the cluster has some issues?
> 2. restarting the cluster solves the issue
> 
> Obviously I don't want to restart the cluster because I'm trying to  
> automatically create these indexes....
> 
> Any ideas?
> 
> -T

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:19am UTC](https://discuss.elastic.co/t/creating-brand-new-index-gets-index-already-exists-exception/13321/5 "2017-07-06T02:19:51Z")

</div>


