Unable to insert record using alias

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,

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 ?

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.

Message is too big to send. can I mail?

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

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

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