# Scansearch failure

**URL:** <https://discuss.elastic.co/t/scansearch-failure/9846>\
**Category:** Elasticsearch\
**Created:** [November 27, 2012, 4:33pm UTC](https://discuss.elastic.co/t/scansearch-failure/9846 "2012-11-27T16:33:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arni\_Sumarlidason](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arni_sumarlidason/32/2229_2.png) [@Arni\_Sumarlidason](https://discuss.elastic.co/u/Arni_Sumarlidason)\
**Post date:** [November 27, 2012, 4:33pm UTC](https://discuss.elastic.co/t/scansearch-failure/9846/1 "2012-11-27T16:33:14Z")

</div>

Good Morning,

After initiating a scan search, After receiving about 44 pages, I receive  
numerous exceptions on the server, like so,  
[2012-11-27 11:10:27,966][DEBUG][action.search.type] [Mercator] [3]  
Failed to execute query phase  
org.elasticsearch.search.SearchContextMissingException: No search context  
found for id [3]  
at  
org.elasticsearch.search.SearchService.findContext(SearchService.java:451)  
at  
org.elasticsearch.search.SearchService.executeScan(SearchService.java:200)  
at  
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteScan(SearchServiceTransportAction.java:412)

```
    at 

```

org.elasticsearch.action.search.type.TransportSearchScrollScanAction$  
AsyncAction.executePhase(TransportSearchScrollScanAction.java:204)  
at  
org.elasticsearch.action.search.type.TransportSearchScrollScanAction$  
AsyncAction.access$700(TransportSearchScrollScanAction.java:81)  
at  
org.elasticsearch.action.search.type.TransportSearchScrollScanAction$  
AsyncAction$2.run(TransportSearchScrollScanAction.java:177)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

```
    at 

```

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

```
    at java.lang.Thread.run(Thread.java:662) 

```

After a few more partial page retrievals, like so,  
{"\_scroll\_id":"c2NhbjsyOzI6UTNYLXBKdmRRZTZjdzV5QTRYbEJfdzs0OllJcy1rOUdxVF9TNzBLNnU3ekVuT2c7MTt0b3RhbF9oaXRzOjEzNzA1Ow==","took":63,"timed\_out":false,"\_shards":{"total":6,"successful":4,"failed":2,"failures":[{"status":500,"reason":"SearchContextMissingException[No  
search context found for id  
[2]]"},{"status":500,"reason":"RemoteTransportException[[Ortelius][inet[/10.100.201.157:9300]][search/phase/scan/scroll]];  
nested: SearchContextMissingException[No search context found for id [1]];

With each subsequent retrieval, failure rate increases, eventually to total  
failure.

Is this due to cluster health? or am I doing something wrong? I noticed the  
scroll\_id sent back from the server grows shorter and short, is that  
normal?

any help would be greatly appreciated..

--

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [November 27, 2012, 4:34pm UTC](https://discuss.elastic.co/t/scansearch-failure/9846/2 "2012-11-27T16:34:40Z")

</div>

> After initiating a scan search, After receiving about 44 pages, I  
> receive numerous exceptions on the server, like so,  
> [2012-11-27 11:10:27,966][DEBUG][action.search.type] [Mercator]  
> [3] Failed to execute query phase  
> org.elasticsearch.search.SearchContextMissingException: No search  
> context found for id [3]

It sounds like you aren't using the new scroll\_id that is returned with  
every scroll request. Also remember that you need to pass a new 'scroll'  
param with each new scroll request.

clint

--

---

<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:** [July 6, 2017, 3:02am UTC](https://discuss.elastic.co/t/scansearch-failure/9846/3 "2017-07-06T03:02:40Z")

</div>


