# Scroll api error in 5.3

**URL:** <https://discuss.elastic.co/t/scroll-api-error-in-5-3/81019>\
**Category:** Elasticsearch\
**Created:** [April 3, 2017, 3:12pm UTC](https://discuss.elastic.co/t/scroll-api-error-in-5-3/81019 "2017-04-03T15:12:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guru\_Prashanth](https://avatars.discourse-cdn.com/v4/letter/g/ee7513/32.png) [@Guru\_Prashanth](https://discuss.elastic.co/u/Guru_Prashanth)\
**Post date:** [April 3, 2017, 3:12pm UTC](https://discuss.elastic.co/t/scroll-api-error-in-5-3/81019/1 "2017-04-03T15:12:52Z")

</div>

{ [Error: [illegal\_argument\_exception] Failed to parse request body]  
status: 400,  
displayName: 'BadRequest',  
message: '[illegal\_argument\_exception] Failed to parse request body',  
path: '/\_search/scroll',  
query: { scroll: '1m' },  
body: 'DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAAE5FkZMaEh3cjBDUi1HRlhLSE1LdWstZEEAAAAAAAABOhZGTGhId3IwQ1ItR0ZYS0hNS3VrLWRBAAAAAAAAATsWRkxoSHdyMENSLUdGWEtITUt1ay1kQQAAAAAAAAE8FkZMaEh3cjBDUi1HRlhLSE1LdWstZEEAAAAAAAABPRZGTGhId3IwQ1ItR0ZYS0hNS3VrLWRB',  
statusCode: 400,  
response: '{"error":{"root\_cause":[{"type":"illegal\_argument\_exception","reason":"Failed to parse request body"}],"type":"illegal\_argument\_exception","reason":"Failed to parse request body","caused\_by":{"type":"json\_parse\_exception","reason":"Unrecognized token 'DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAAE5FkZMaEh3cjBDUi1HRlhLSE1LdWstZEEAAAAAAAABOhZGTGhId3IwQ1ItR0ZYS0hNS3VrLWRBAAAAAAAAATsWRkxoSHdyMENSLUdGWEtITUt1ay1kQQAAAAAAAAE8FkZMaEh3cjBDUi1HRlhLSE1LdWstZEEAAAAAAAABPRZGTGhId3IwQ1ItR0ZYS0hNS3VrLWRB': was expecting ('true', 'false' or 'null')\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@3e41afb8; line: 1, column: 457]"}},"status":400}',  
toString: [Function],  
toJSON: [Function] }

I have implement scroll api in 5.2.2 elasticsearch. It works fine for 5.2.2 and other lower version. But It gives an above error in 5.3. Is there anything i have to change in 5.3?  
Here is my sample code.  
var data = [];  
client.search({  
index: source.index,  
scroll: '1m',  
body: bodyobj  
}, function getMoreUntilDone(err, res) {  
var cellValues = [];  
if (!err) {  
res.hits.hits.forEach(function(hit) {  
data.push(hit);  
});  
if (data.length\<res.hits.total && data.length \< sampleSize) {  
// now we can call scroll over and over  
client.scroll({  
scrollId: res.\_scroll\_id,  
scroll: '1m'  
}, getMoreUntilDone);  
return;  
}

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [April 3, 2017, 4:29pm UTC](https://discuss.elastic.co/t/scroll-api-error-in-5-3/81019/2 "2017-04-03T16:29:41Z")

</div>

I wonder if the client you are using is sending a content-type header for `application/json`. 5.3 had some changes around Content-Type. You are using an old, now deprecated way of using the scroll API. See the docs for the new way:  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html)

Even so, it should have continued to work unless something funny happened around Content-Type. It certainly should work in Content-Type is plain text.

---

<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:** [May 1, 2017, 4:29pm UTC](https://discuss.elastic.co/t/scroll-api-error-in-5-3/81019/3 "2017-05-01T16:29:55Z")

</div>

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