DBAtlas · Database operations atlas

search_context_missing_exception: No search context found for id (scroll expired)

Elasticsearch

What 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.

Open in DBAtlas →

More from this engine