search_context_missing_exception: No search context found for id (scroll expired)
ElasticsearchWhat does it mean?
The search context used by a scroll query no longer exists on the server. It usually appears when continuing with a stored scroll_id after the scroll context has timed out or been cleared.
Why does it happen?
The keep-alive specified for the scroll expired (too long a pause between requests); the context was cleared manually (clear scroll); or the context was lost when a node restarted. Scroll contexts are held in node memory, so their lifetime is limited.
How to fix it
Pass a sufficient keep-alive on every scroll request (e.g. scroll=5m) and shorten the delay between pages. In modern Elasticsearch, use search_after + Point in Time (PIT) instead of scroll for deep pagination; it is more scalable and the recommended method. Release contexts when finished (clear scroll) so memory is not wasted.
More from this engine
- invalid_index_name_exceptioninvalid_index_name_exception
- resource_not_found_exceptionresource_not_found_exception
- process_cluster_event_timeout_exceptionprocess_cluster_event_timeout_exception
- aliases_not_found_exceptionAliases missing
- snapshot_missing_exceptionSnapshot is missing
- index_template_missing_exceptionIndex template is missing
- settings_exceptionInvalid settings