Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError: Invalid string length #313

Closed
kadishmal opened this issue Dec 5, 2015 · 1 comment
Closed

RangeError: Invalid string length #313

kadishmal opened this issue Dec 5, 2015 · 1 comment

Comments

@kadishmal
Copy link

Perhaps for some reason ES sends an empty response which results in the following error.

 RangeError: Invalid string length
     at IncomingMessage.<anonymous> (/home/user/indexer-1.0.0/node_modules/elasticsearch/src/lib/connectors/http.js:171:34)
     at emitOne (events.js:77:13)
     at IncomingMessage.emit (events.js:169:7)
     at readableAddChunk (_stream_readable.js:146:16)
     at IncomingMessage.Readable.push (_stream_readable.js:110:10)
     at HTTPParser.parserOnBody (_http_common.js:109:22)
     at Socket.socketOnData (_http_client.js:311:20)
     at emitOne (events.js:77:13)
     at Socket.emit (events.js:169:7)
     at readableAddChunk (_stream_readable.js:146:16)
     at Socket.Readable.push (_stream_readable.js:110:10)
     at TCP.onread (net.js:523:20)

It happens in the following code:

request = this.hand.request(reqParams, function (_incoming) {
    ...
    incoming.on('data', function (d) {
==>       response += d;
    });
    ...

This happens with Node v5.0.0 and elasticsearch module v10.0.1.

@kadishmal
Copy link
Author

It seems to be related to the Out Of Memory issue when creating a string out of the large ES response. The solution was to decrease the number of hits to return by ES on scan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant