Skip to content

Bulk write to multiple aliases throws 500 error starting in 5.5.3 #26975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
BradHarris opened this issue Oct 11, 2017 · 1 comment
Closed

Bulk write to multiple aliases throws 500 error starting in 5.5.3 #26975

BradHarris opened this issue Oct 11, 2017 · 1 comment

Comments

@BradHarris
Copy link

Elasticsearch version (bin/elasticsearch --version): 5.5.3

Plugins installed: x-pack (it comes with the docker version of ES)

JVM version (java -version):
openjdk version "1.8.0_141"
OpenJDK Runtime Environment (build 1.8.0_141-b16)
OpenJDK 64-Bit Server VM (build 25.141-b16, mixed mode)

OS version (uname -a if on a Unix-like system): docker image uses centos:7
Linux cf214e385aa3 4.10.0-33-generic #37-Ubuntu SMP Fri Aug 11 10:55:28 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:

Steps to reproduce:

Please include a minimal but complete recreation of the problem, including
(e.g.) index creation, mappings, settings, query etc. The easier you make for
us to reproduce it, the more likely that somebody will take the time to look at it.

  1. spin up a 5.5.3 ES instance with docker: docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:5.5.3
  2. run this script:
#!/usr/bin/env bash

# creates an index called my-data with 2 write aliases: write-alias-1 and write-alias-2
curl -u "elastic:changeme" -XPUT "http://localhost:9200/my-data" -H 'Content-Type: application/json' -d'
{
  "aliases": {
    "write-index-1": {},
    "write-index-2": {}
  }
}
'

# bulk writes 2 documents using the same _id but with different write aliases
curl -u "elastic:changeme" -XPOST "http://localhost:9200/_bulk?pretty" -H 'Content-Type: application/json' -d'
{"index":{"_index": "write-index-1","_type": "data", "_id": "1"}}
{"hello": "hello1"}
{"index":{"_index": "write-index-2","_type": "data", "_id": "1"}}
{"hello": "hello2"}
'

Provide logs (if relevant):
output from the bulk call:

{
  "took" : 0,
  "errors" : true,
  "items" : [
    {
      "index" : {
        "_index" : "my-data",
        "_type" : "data",
        "_id" : "1",
        "status" : 500,
        "error" : {
          "type" : "illegal_state_exception",
          "reason" : "Action indices:data/write/bulk[s] should operate on exactly 1 local index but was 2"
        }
      }
    },
    {
      "index" : {
        "_index" : "my-data",
        "_type" : "data",
        "_id" : "1",
        "status" : 500,
        "error" : {
          "type" : "illegal_state_exception",
          "reason" : "Action indices:data/write/bulk[s] should operate on exactly 1 local index but was 2"
        }
      }
    }
  ]
}

ES does not produce any logs with default logging level.

with 5.5.2 the script works as expected and the bulk writes return 200 level statuses

@jasontedor
Copy link
Member

This issue is an X-Pack issue, it happens inside the authorization service for bulk requests. We only handle open source issues here. May I ask you to please open a topic on the forum in the X-Pack category where we handle closed source issues (you can link to that topic from here)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants