Skip to content

companies/_mget?_source_includes=countries.cities.name returns illegal_state_exception #93842

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
Marangal opened this issue Feb 15, 2023 · 1 comment
Labels
>bug needs:triage Requires assignment of a team area label

Comments

@Marangal
Copy link

Elasticsearch Version

8.5.1

Installed Plugins

none

Java Version

elastic cloud docker

OS Version

elastic cloud docker

Problem Description

When executing .../companies/_mget?_source_includes=countries.cities.name
I get for certain data following error:
"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"
}
}

Steps to Reproduce

  1. prepare data:
    {
    "docs": [
    {
    "_index": "companies",
    "_id": "companyA",
    "_version": 1,
    "_seq_no": 10832,
    "_primary_term": 1,
    "found": true,
    "_source": {
    "countries": [
    {
    "cities": [
    {
    "name": "brussel"
    }
    ]
    },
    {
    "cities": []
    }
    ]
    }
    }
    ]
    }

  2. Execute /companies/_mget?_source_includes=country.cities.name

When doing the same with following data it works:
{
"docs": [
{
"_index": "companies",
"_id": "companyB",
"_version": 1,
"_seq_no": 10832,
"_primary_term": 1,
"found": true,
"_source": {
"countries": [
{
"cities": [
{
"name": "brussel"
}
]
},
{
"cities": [
{
"name": "amsterdam"
}
]
}
]
}
}
]
}

This works too:

{
"docs": [
{
"_index": "companies",
"_id": "companyC",
"_version": 1,
"_seq_no": 10832,
"_primary_term": 1,
"found": true,
"_source": {
"countries": [
{
"cities": []
},
{
"cities": []
}
]
}
}
]
}

This works too:

{
"docs": [
{
"_index": "companies",
"_id": "companyD",
"_version": 1,
"_seq_no": 10832,
"_primary_term": 1,
"found": true,
"_source": {
"countries": [
{
"cities": [
{
"name": "brussel"
}
]
},
{
"cities": []
},
{
"cities": [
{
"name": "amsterdam"
}
]
}
]
}
}
]
}

Logs (if relevant)

Invalid NEST response built from a successful (200) low level call on POST: /articles/_mget?_source_includes=countries.cities.name

Audit trail of this API call:

Request:

{"ids":["companyA"]}

Response:

{
"docs": [
{
"_index": "companies",
"_type": "_doc",
"_id": "companyA",
"error": {
"root_cause": [
{
"type": "exception",
"reason": "Failed to get id [companyA] with includes/excludes set"
}
],
"type": "exception",
"reason": "Failed to get id [companyA] with includes/excludes set",
"caused_by": {
"type": "json_parse_exception",
"reason": "Unexpected problem: chain of filtered context broken\n at [Source: (org.elasticsearch.common.io.stream.ByteBufferStreamInput); line: 1, column: 2503]"
}
}
}
]
}

@Marangal Marangal added >bug needs:triage Requires assignment of a team area label labels Feb 15, 2023
@DaveCTurner
Copy link
Contributor

Looks like a duplicate of #92480, fixed in 8.6.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug needs:triage Requires assignment of a team area label
Projects
None yet
Development

No branches or pull requests

2 participants