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

Kibana failed to export or filter saved objects if result window is too large #116106

Closed
lystor opened this issue Oct 25, 2021 · 5 comments
Closed
Labels
bug Fixes for quality problems that affect the customer experience Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@lystor
Copy link

lystor commented Oct 25, 2021

Kibana version:
7.14.1

Elasticsearch version:
7.14.1

Server OS version:
Official Docker images.

Describe the bug:
Kibana fails to export or filter saved objects if their number exceeds 10.000.

Steps to reproduce:

  1. Create 11000 saved objects
  2. Run export saved objects

Expected behavior:

Screenshots (if relevant):
s1
s2

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):
{
"statusCode": 400,
"error": "Bad Request",
"message": "all shards failed: search_phase_execution_exception: [illegal_argument_exception] Reason: Result window is too large, from + size must be less than or equal to: [10000] but was [11000]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level setting.",
}

@lystor lystor added the bug Fixes for quality problems that affect the customer experience label Oct 25, 2021
@botelastic botelastic bot added the needs-team Issues missing a team label label Oct 25, 2021
@zaidizeeshan
Copy link

you need to find the related index name in elasticsearch error logs and use the below command to change the settings using curl. However, scroll api calls, index name need not be mentioned but you must try it for single index
curl -X PUT “https://localhost:9200/YOUR_INDEX_NAME/_settings” -H ‘Content-Type: application/json’ -d ‘{ “index” : { “max_result_window” : 11000 } }’
if you enabled x-pack security then you need to specify username also i.e.
curl -u elastic -X PUT “https://localhost:9200/YOUR_INDEX_NAME/_settings” -H ‘Content-Type: application/json’ -d ‘{ “index” : { “max_result_window” : 11000 } }’
output would be:

Enter host password for user 'elastic':
{"acknowledged":true}

or update all existing indices from the api

PUT _settings
{
  "index.max_result_window": 11000
}

you can also create the template to take effect on future indices that targets specific index patterns (or just * for global)

PUT _template/example
{
  "index_patterns": ["YOUR_INDEX_NAME*"],
  "settings": {
    "index.max_result_window": 11000
  }
}

PUT YOUR_INDEX_NAME

output would be:

GET YOUR_INDEX_NAME
...

{
  "YOUR_INDEX_NAME" : {
    "aliases" : { },
    "mappings" : { },
    "settings" : {
      "index" : {
        ...
        "max_result_window" : "11000",
        ...
      }
    }
  }
}

another way
if the above solutions didn't work for you then try to post the request using scroll_id and scroll_time without defining the indices. For scroll api calls, index name need not be mentioned.
you can this also:
POST <host_name>:<port_num>/_search?scroll=1m&scroll_id=<scroll_id>
ref.: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html
https://www.elastic.co/guide/en/elasticsearch/reference/current/paginate-search-results.html#scroll-search-results

@nickpeihl nickpeihl added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Dec 8, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Dec 8, 2021
@lukeelmers
Copy link
Member

I'm surprised to see this reported for 7.14, as we introduced support for exporting >10k objects in 7.12: #89915

Are you certain this is a 7.14 deployment?

Note that you will need to increase the savedObjects.maxImportExportSize in the Kibana config if you want to export more than 10k objects (which is the default).

@pgayvallet
Copy link
Contributor

pgayvallet commented Dec 9, 2021

I'm surprised to see this reported for 7.14, as we introduced support for exporting >10k objects in 7.12

The HTTP API supported it, but the UI didn't in 7.14. This was fixed on 7.16 in #118335

@lukeelmers
Copy link
Member

The HTTP API supported it, but the UI didn't in 7.14

Ah of course 🤦 Thanks for updating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

6 participants