Skip to content

Bad error message when misspelling docs in _mget #23720

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
suederade opened this issue Mar 23, 2017 · 2 comments
Closed

Bad error message when misspelling docs in _mget #23720

suederade opened this issue Mar 23, 2017 · 2 comments
Labels
:Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. >enhancement

Comments

@suederade
Copy link

Elasticsearch version: 5.x

JVM version: 8

OS version: OSX 10.11.6

Description of the problem including expected versus actual behavior: When searching _mget and passing {"doc": []} (misspelling docs), should throw a better error message when seeing the array.

Steps to reproduce:
doc instead of docs:

GET _mget
{
  "doc" : [
    {
      "_index" : "orders-current",
      "_type" : "order",
      "_id" : 6
    },
    {
      "_index" : "products",
      "_type" : "product",
      "_id" : 4321
    }
  ]
}

Error:

{
  "error": {
    "root_cause": [
      {
        "type": "action_request_validation_exception",
        "reason": "Validation Failed: 1: no documents to get;"
      }
    ],
    "type": "action_request_validation_exception",
    "reason": "Validation Failed: 1: no documents to get;"
  },
  "status": 400
}

@dakrone

@olcbean
Copy link
Contributor

olcbean commented Mar 23, 2017

Do you mean that instead no documents to get; the msg should changed to Unknown key for a START_OBJECT in [doc]. (similar to the one displayed for search)?

@rjernst
Copy link
Member

rjernst commented Mar 23, 2017

Looks like the keys should be validated here. And the value type should also be validated as well. Right now it only looks for array. Anything else is silently ignored.

@rjernst rjernst added help wanted adoptme >enhancement :Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. labels Mar 23, 2017
LewayneNaidoo added a commit to LewayneNaidoo/elasticsearch that referenced this issue Mar 23, 2017
kblincoe added a commit to kblincoe/elasticsearch that referenced this issue Mar 23, 2017
LewayneNaidoo added a commit to LewayneNaidoo/elasticsearch that referenced this issue Mar 24, 2017
@jasontedor jasontedor removed the help wanted adoptme label Mar 25, 2017
kblincoe added a commit to kblincoe/elasticsearch that referenced this issue Apr 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. >enhancement
Projects
None yet
Development

No branches or pull requests

4 participants