Skip to content
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

`GET _mapping/X` causes illegal_state_exception and status 500 #21916

Closed
cwurm opened this Issue Dec 1, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@cwurm
Copy link
Member

cwurm commented Dec 1, 2016

Elasticsearch version: 5.0.1 (Elastic Cloud)
Plugins installed: [x-pack, ingest-, analysis-, etc.]
JVM version: (Elastic Cloud)
OS version: (Elastic Cloud)

Description of the problem including expected versus actual behavior:
Sending a query of the form GET _mapping/X returns an error, but probably not the one it should:

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_state_exception",
        "reason": "Failed to close the XContentBuilder"
      }
    ],
    "type": "illegal_state_exception",
    "reason": "Failed to close the XContentBuilder",
    "caused_by": {
      "type": "i_o_exception",
      "reason": "Unclosed object or array found"
    }
  },
  "status": 500
}
@rjernst

This comment has been minimized.

Copy link
Member

rjernst commented Dec 1, 2016

I can reproduce this and am investigating.

rjernst added a commit to rjernst/elasticsearch that referenced this issue Dec 1, 2016

Mappings: Fix get mapping when no indexes exist to not fail in respon…
…se generation

When there are no indexes, get mapping has a series of special cases.
Two of those expect the response object already started, and the other
two respond with an exception. Those two cases (types passed in but no
indexes and vice versa) would fail in their error response generation
because it did not expect an object to already be started in the json
generator. This change moves the object start to where it is needed for
the empty responses.

closes elastic#21916

rjernst added a commit that referenced this issue Dec 2, 2016

Mappings: Fix get mapping when no indexes exist to not fail in respon…
…se generation (#21924)

When there are no indexes, get mapping has a series of special cases.
Two of those expect the response object already started, and the other
two respond with an exception. Those two cases (types passed in but no
indexes and vice versa) would fail in their error response generation
because it did not expect an object to already be started in the json
generator. This change moves the object start to where it is needed for
the empty responses.

closes #21916

rjernst added a commit that referenced this issue Dec 2, 2016

Mappings: Fix get mapping when no indexes exist to not fail in respon…
…se generation (#21924)

When there are no indexes, get mapping has a series of special cases.
Two of those expect the response object already started, and the other
two respond with an exception. Those two cases (types passed in but no
indexes and vice versa) would fail in their error response generation
because it did not expect an object to already be started in the json
generator. This change moves the object start to where it is needed for
the empty responses.

closes #21916

rjernst added a commit that referenced this issue Dec 2, 2016

Mappings: Fix get mapping when no indexes exist to not fail in respon…
…se generation (#21924)

When there are no indexes, get mapping has a series of special cases.
Two of those expect the response object already started, and the other
two respond with an exception. Those two cases (types passed in but no
indexes and vice versa) would fail in their error response generation
because it did not expect an object to already be started in the json
generator. This change moves the object start to where it is needed for
the empty responses.

closes #21916

rjernst added a commit that referenced this issue Dec 2, 2016

Mappings: Fix get mapping when no indexes exist to not fail in respon…
…se generation (#21924)

When there are no indexes, get mapping has a series of special cases.
Two of those expect the response object already started, and the other
two respond with an exception. Those two cases (types passed in but no
indexes and vice versa) would fail in their error response generation
because it did not expect an object to already be started in the json
generator. This change moves the object start to where it is needed for
the empty responses.

closes #21916
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.