# Unable to insert record using alias

**URL:** <https://discuss.elastic.co/t/unable-to-insert-record-using-alias/80529>\
**Category:** Elasticsearch\
**Created:** [March 29, 2017, 6:20pm UTC](https://discuss.elastic.co/t/unable-to-insert-record-using-alias/80529 "2017-03-29T18:20:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)\
**Post date:** [March 29, 2017, 6:20pm UTC](https://discuss.elastic.co/t/unable-to-insert-record-using-alias/80529/1 "2017-03-29T18:20:56Z")

</div>

Version: 2.4.1  
Mode: 3 node cluster

I have several indexes and one index holds an alias using which I can write the document into the index.  
When I try to insert record into an index, I am getting exception saying that there is more than one index holding the alias but if I check across all three nodes then there is only one write alias associated with that index. Below is the step

```
 curl -XPUT 1.1.1.3:9200/myindex_write/myindex/1 -d '
> {
> "user" : "kimchy",
> "post_date" : "2009-11-15T14:12:12",
> "message" : "trying out Elasticsearch"
> }'
{"error":{"root_cause":[{"type":"remote_transport_exception","reason":"[Node1][1.1.1.2:9300][indices:data/write/index]"}],
"type":"illegal_argument_exception","reason":"Alias [myindex_write] has more than one indices associated 
with it [[myindex_2017_03_28t04_35_34, myindex_2017_03_29t04_39_52]], 
can't execute a single index op"},"status":400}

 curl -XGET 1.1.1.3:9200/myindex_2017_03_28t04_35_34/_aliases?pretty
{
  "myindex_2017_03_28t04_35_34" : {
    "aliases" : {
      "myindex_read" : { }
    }
  }
}

 curl -XGET 1.1.1.3:9200/myindex_2017_03_29t04_39_52/_aliases?pretty
{
  "myindex_2017_03_29t04_39_52" : {
    "aliases" : {
      "myindex_read" : { },
      "myindex_write" : { }
    }
  }
}

curl -XGET 1.1.1.1:9200/myindex_2017_03_28t04_35_34/_aliases?pretty
{
  "myindex_2017_03_28t04_35_34" : {
    "aliases" : {
      "myindex_read" : { }
    }
  }
}

curl -XGET 1.1.1.1:9200/myindex_2017_03_29t04_39_52/_aliases?pretty
{
  "myindex_2017_03_29t04_39_52" : {
    "aliases" : {
      "myindex_read" : { },
      "myindex_write" : { }
    }
  }
}

curl -XGET 1.1.1.2:9200/myindex_2017_03_28t04_35_34/_aliases?pretty
{
  "myindex_2017_03_28t04_35_34" : {
    "aliases" : {
      "myindex_read" : { }
    }
  }
}

curl -XGET 1.1.1.2:9200/myindex_2017_03_29t04_39_52/_aliases?pretty
{
  "myindex_2017_03_29t04_39_52" : {
    "aliases" : {
      "myindex_read" : { },
      "myindex_write" : { }
    }
  }
}

```

Is this a known bug?

Regards,

---

<div class="post-metadata">

**Author:** ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)\
**Post date:** [March 29, 2017, 8:56pm UTC](https://discuss.elastic.co/t/unable-to-insert-record-using-alias/80529/2 "2017-03-29T20:56:57Z")

</div>

You can see that your alias does indeed point to two different indices from the error:

```
Alias [myindex_write] has more than one indices associated 
with it [[myindex_2017_03_28t04_35_34, myindex_2017_03_29t04_39_52]]

```

So Elasticsearch cannot resolve the concrete index for which index to send the operation.

Can you paste the output of `curl 1.1.1.3:9200/_aliases?pretty` ?

---

<div class="post-metadata">

**Author:** ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)\
**Post date:** [March 29, 2017, 9:08pm UTC](https://discuss.elastic.co/t/unable-to-insert-record-using-alias/80529/3 "2017-03-29T21:08:15Z")

</div>

The error says that there are two indexes associated. I have also added the alias list for myindex\_2017\_03\_28t04\_35\_34 and myindex\_2017\_03\_29t04\_39\_52.  
I will send the output in the direct message.

---

<div class="post-metadata">

**Author:** ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)\
**Post date:** [March 29, 2017, 9:10pm UTC](https://discuss.elastic.co/t/unable-to-insert-record-using-alias/80529/4 "2017-03-29T21:10:44Z")

</div>

Message is too big to send. can I mail?

---

<div class="post-metadata">

**Author:** ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)\
**Post date:** [March 29, 2017, 10:26pm UTC](https://discuss.elastic.co/t/unable-to-insert-record-using-alias/80529/5 "2017-03-29T22:26:52Z")

</div>

Perhaps you can past it at [https://gist.github.com/](https://gist.github.com/) (create a secret gist) and send me the link through a direct message here?

---

<div class="post-metadata">

**Author:** ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)\
**Post date:** [March 30, 2017, 5:57pm UTC](https://discuss.elastic.co/t/unable-to-insert-record-using-alias/80529/6 "2017-03-30T17:57:01Z")

</div>

Hi @dakrone,  
Any update on this? Did you get my DM?

---

<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:** [April 27, 2017, 5:57pm UTC](https://discuss.elastic.co/t/unable-to-insert-record-using-alias/80529/7 "2017-04-27T17:57:06Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
