# Problem with downloading scan results by iteration

**URL:** <https://discuss.elastic.co/t/problem-with-downloading-scan-results-by-iteration/8654>\
**Category:** Elasticsearch\
**Created:** [August 6, 2012, 11:08pm UTC](https://discuss.elastic.co/t/problem-with-downloading-scan-results-by-iteration/8654 "2012-08-06T23:08:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abshkd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abshkd/32/2789_2.png) [@abshkd](https://discuss.elastic.co/u/abshkd)\
**Post date:** [August 6, 2012, 11:08pm UTC](https://discuss.elastic.co/t/problem-with-downloading-scan-results-by-iteration/8654/1 "2012-08-06T23:08:35Z")

</div>

I am trying to download a large result of a frequently updating ES index.

I am using python requests library to connect to the remote servers. After  
starting the scrolling process and making my first 2 scroll requests I get

socket.error: [Errno 10054] An existing connection was forcibly closed by  
the remote host

is this something to do with the web server of ES?

I am already hunting for python related issue but so far I have not found  
any specific issue. I have tried to set the keep-alive to on/off as well as  
reuse the connection pool (maybe ES doesnt like too many connections)

any clues?

thanks

---

<div class="post-metadata">

**Author:** ![abshkd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abshkd/32/2789_2.png) [@abshkd](https://discuss.elastic.co/u/abshkd)\
**Post date:** [August 6, 2012, 11:45pm UTC](https://discuss.elastic.co/t/problem-with-downloading-scan-results-by-iteration/8654/2 "2012-08-06T23:45:18Z")

</div>

> I traced the problem to an issue that I thought was solved.

When I start using the scroll\_id the first two requests are fine (start the  
scan request and then submit scroll\_id twice) but after that the \_scroll\_id  
seems to not change could that be a problem?

---

<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:17am UTC](https://discuss.elastic.co/t/problem-with-downloading-scan-results-by-iteration/8654/3 "2017-07-06T03:17:33Z")

</div>

Closed on July 6, 2017, 3:17am UTC


