question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scroll api 5.3 throwing error

See original GitHub issue
var allTitles = [];
var i =0;

var elasticsearch = require('elasticsearch');

var client = new elasticsearch.Client({
    host: 'localhost:9200',
 });
// first we do a search, and specify a scroll timeout
client.search({
  index: 'movies',
  scroll: '30s', 
  size:1,
  _source : 'title'
}, function getMoreUntilDone(error, response) {
  // collect the title from each response

  console.log('i',i++);


  console.log(JSON.stringify(response));

  response.hits.hits.forEach(function (hit) {
    allTitles.push(hit._source.title);
  });
  if (response.hits.total > allTitles.length) {
    // ask elasticsearch for the next set of hits from this search
    client.scroll({
       scrollId: response._scroll_id,
        scroll: '30s', 
    }, getMoreUntilDone);
  } else {
    console.log('every "test" title', allTitles);
  }
});

when I running the code throwing error

{
  "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 'DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAAHKFnV6a2NabEh4VDZLQmdzUzY0Y2tpd0EAAAAAAAAByxZ1emtjWmxIeFQ2S0Jnc1M2NGNraXdBAAAAAAAAAcwWdXprY1psSHhUNktCZ3NTNjRja2l3QQAAAAAAAAHOFnV6a2NabEh4VDZLQmdzUzY0Y2tpd0EAAAAAAAABzRZ1emtjWmxIeFQ2S0Jnc1M2NGNraXdB': was expecting ('true', 'false' or 'null')\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@67ba4d99; line: 1, column: 457]"
    }
  },
  "status": 400
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
spalgercommented, Apr 5, 2017

Upgrading to 13.0.0-rc1 should fix your issue

1reaction
kaipicommented, Aug 21, 2017

This is still valid issue, still not working with elastic 5.5 and elasticsearch.js v13.3.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scroll api error in 5.3 - Elasticsearch - Discuss the Elastic Stack
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...
Read more >
ElasticSearch Scroll API not going past 10000 limit
As I said, the exception no search context for id {id} is usually being thrown because an iteration lasts longer than the scroll...
Read more >
Scroll Versions for Confluence - Atlassian Marketplace
Scroll Versions for Confluence ... Server 6.2.0 - 6.15.102019-05-06Fixed Viewport search throwing an error when using versioned or translated space Download.
Read more >
Changelog - Cypress Documentation
Cypress now throws an error if any Cypress commands are invoked from inside a ... This fixes an issue observed where the reporter...
Read more >
Exceptions - Manual - PHP
(The variable was required prior to PHP 8.0.0.) The first catch block a thrown exception or error encounters that matches the type of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found