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

Discover returns bad request error when one doc has a field with 1000000+ Bytes #78947

Closed
jguay opened this issue Sep 30, 2020 · 2 comments
Closed
Assignees
Labels
Feature:Discover Discover Application Feature:Highlight Highlighting of content via query Feature:Search Querying infrastructure in Kibana

Comments

@jguay
Copy link
Contributor

jguay commented Sep 30, 2020

Kibana version:
7.9.2
Elasticsearch version:
7.9.1
Describe the bug:
This is a result of elastic/elasticsearch#52155 and the fact by default highlighting is enabled on Discover application (disabling it in advanced options)
Steps to reproduce:

  1. Create a document with one million bytes, for example :
echo '{ "foo" : "' > payload.json
for i in {1..70000}; do printf 'brown fox test ' >> payload.json; done
echo '"}' >> payload.json
curl -H 'Content-type: application/json' -k -u elastic:changeme -XPOST https://localhost:9200/test/_doc -d @payload.json
  1. Create an index pattern for that index
  2. Go to Discover and see the error in screenshot below
    Browser network trace shows response from elasticsearch was :
{"statusCode":400,"error":"Bad Request","message":"[status_exception] error while executing search","attributes":{"error":{"type":"status_exception","reason":"error while executing search","caused_by":{"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"test","node":"ZsGX5OPCQ8WYjKZsBkZG9g","reason":{"type":"illegal_argument_exception","reason":"The length of [foo] field of [lI-O2XQBFxy84PJko7GD] doc of [test] index has exceeded [1000000] - maximum allowed to be analyzed for highlighting. This maximum can be set by changing the [index.highlight.max_analyzed_offset] index level setting. For large texts, indexing with offsets or term vectors is recommended!"}}],"caused_by":{"type":"illegal_argument_exception","reason":"The length of [foo] field of [lI-O2XQBFxy84PJko7GD] doc of [test] index has exceeded [1000000] - maximum allowed to be analyzed for highlighting. This maximum can be set by changing the [index.highlight.max_analyzed_offset] index level setting. For large texts, indexing with offsets or term vectors is recommended!","caused_by":{"type":"illegal_argument_exception","reason":"The length of [foo] field of [lI-O2XQBFxy84PJko7GD] doc of [test] index has exceeded [1000000] - maximum allowed to be analyzed for highlighting. This maximum can be set by changing the [index.highlight.max_analyzed_offset] index level setting. For large texts, indexing with offsets or term vectors is recommended!"}}}}}}

Stack trace from screenshot :

search_phase_execution_exception
all shards failed

Error: Bad Request
    at Fetch._callee3$ (https://localhost:5601/33984/bundles/core/core.entry.js:34:109213)
    at l (https://localhost:5601/33984/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:368:155323)
    at Generator._invoke (https://localhost:5601/33984/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:368:155076)
    at Generator.forEach.e.<computed> [as next] (https://localhost:5601/33984/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:368:155680)
    at fetch_asyncGeneratorStep (https://localhost:5601/33984/bundles/core/core.entry.js:34:102354)
    at _next (https://localhost:5601/33984/bundles/core/core.entry.js:34:102670)

Expected behavior:
More meaningful error - or no error

Screenshots (if relevant):
Screenshot 2020-09-29 at 12 12 45

Any additional context:
I am mostly opening this to ensure this is tracked along with elastic/elasticsearch#52155, the latest proposition of a fix to return partial highlighting instead of error at elasticsearch level should require no change on kibana (the previous proposition with some ignore_above if it is what is implemented would required kibana code change)

@jguay jguay added Feature:Highlight Highlighting of content via query Feature:Discover Discover Application labels Sep 30, 2020
@kertal kertal added Feature:Search Querying infrastructure in Kibana Team:AppArch labels Oct 16, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@kertal
Copy link
Member

kertal commented Oct 16, 2020

this may have improved with recent error message alignment (because there's a clear message in the return: doc of [test] index has exceeded [1000000] - maximum allowed to be analyzed for highlighting. This maximum can be set by changing the [index.highlight.max_analyzed_offset] index level setting...), but should be checked (FYI: @lizozom )

@lizozom lizozom self-assigned this Oct 19, 2020
@lizozom lizozom closed this as completed Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Discover Discover Application Feature:Highlight Highlighting of content via query Feature:Search Querying infrastructure in Kibana
Projects
None yet
Development

No branches or pull requests

4 participants