# ScanError while scrolling more than 10k docs

**URL:** <https://discuss.elastic.co/t/scanerror-while-scrolling-more-than-10k-docs/345517>\
**Category:** Elasticsearch\
**Created:** [October 22, 2023, 1:54am UTC](https://discuss.elastic.co/t/scanerror-while-scrolling-more-than-10k-docs/345517 "2023-10-22T01:54:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mans4singh](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@mans4singh](https://discuss.elastic.co/u/mans4singh)\
**Post date:** [October 22, 2023, 1:54am UTC](https://discuss.elastic.co/t/scanerror-while-scrolling-more-than-10k-docs/345517/1 "2023-10-22T01:54:32Z")

</div>

Hi:

I am getting ScanError (ScanError('Scroll request has only succeeded on 7 (+5 skipped) shards out of 15.')) when the search results is large (mostly when it is more than 10k).

I have a few questions about it:

1. What is the underlying reasons for this issue ?
2. Is this related to number of shards or the number of search results ?
3. Is there a way to handle this by some elasticsearch property setting or query parameters or scaling or shard count/settings ?
4. I found a suggestion that can avoid this by using the flag (raise\_on\_error in the python library) but that will result in suppressing the exception and returning incomplete results.

Please let me know what's the correct way of solving this issue.

Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 22, 2023, 4:51am UTC](https://discuss.elastic.co/t/scanerror-while-scrolling-more-than-10k-docs/345517/2 "2023-10-22T04:51:47Z")

</div>

What is your version?  
What does your code look like?  
Did you try the PIT + search after method?

The [scroll doc](https://www.elastic.co/guide/en/elasticsearch/reference/current/scroll-api.html) is saying:

> We no longer recommend using the scroll API for deep pagination. If you need to preserve the index state while paging through more than 10,000 hits, use the [`search_after`](https://www.elastic.co/guide/en/elasticsearch/reference/current/paginate-search-results.html#search-after) parameter with a point in time (PIT).

---

<div class="post-metadata">

**Author:** ![mans4singh](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@mans4singh](https://discuss.elastic.co/u/mans4singh)\
**Post date:** [October 23, 2023, 5:23am UTC](https://discuss.elastic.co/t/scanerror-while-scrolling-more-than-10k-docs/345517/3 "2023-10-23T05:23:24Z")

</div>

Hi @dadoonet - I am actually using opensearch 2.5 and i believe the errors is the same as some user have mentioned above.

Do you know what is the reason for the error ?

Thanks for the PIT reference.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 23, 2023, 5:23am UTC](https://discuss.elastic.co/t/scanerror-while-scrolling-more-than-10k-docs/345517/4 "2023-10-23T05:23:24Z")

</div>

OpenSearch/OpenDistro are AWS run products and differ from the original Elasticsearch and Kibana products that Elastic builds and maintains. You may need to contact them directly for further assistance.

(This is an automated response from your friendly Elastic bot. Please report this post if you have any suggestions or concerns :elasticheart: )

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 23, 2023, 8:35am UTC](https://discuss.elastic.co/t/scanerror-while-scrolling-more-than-10k-docs/345517/5 "2023-10-23T08:35:00Z")

</div>

We can't help. The product is not the same and the API are not the same anymore.  
I'd recommend to switch to the real Elasticsearch. Think about what is there yet like Security, Monitoring, Reporting, SQL, Canvas, Maps UI, Alerting and built-in solutions named [Observability](https://www.elastic.co/observability), [Security](https://www.elastic.co/security), [Enterprise Search](https://www.elastic.co/enterprise-search) and what is coming next like the new powerful ES|QL engine 🙂 ...

---

<div class="post-metadata">

**Author:** ![mans4singh](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@mans4singh](https://discuss.elastic.co/u/mans4singh)\
**Post date:** [October 23, 2023, 4:08pm UTC](https://discuss.elastic.co/t/scanerror-while-scrolling-more-than-10k-docs/345517/6 "2023-10-23T16:08:08Z")

</div>

Thanks @dadoonet.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 20, 2023, 4:09pm UTC](https://discuss.elastic.co/t/scanerror-while-scrolling-more-than-10k-docs/345517/7 "2023-11-20T16:09:03Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
