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

get error "RangeError: Invalid string length" #10738

Closed
showmeall opened this issue Jan 11, 2017 · 3 comments
Closed

get error "RangeError: Invalid string length" #10738

showmeall opened this issue Jan 11, 2017 · 3 comments

Comments

@showmeall
Copy link

showmeall commented Jan 11, 2017

  • Version: v6.9.1
  • Platform: centos 7.2
  • Subsystem:

when we import data , get follow error, please help us .

/usr/lib/node_modules/elasticdump/lib/transports/elasticsearch.js:405
payload.body += JSON.stringify(elem._source) + '\n'
^
RangeError: Invalid string length
at Object.stringify (native)
at /usr/lib/node_modules/elasticdump/lib/transports/elasticsearch.js:405:26
at Array.forEach (native)
at elasticsearch.setData (/usr/lib/node_modules/elasticdump/lib/transports/elasticsearch.js:380:8)
at /usr/lib/node_modules/elasticdump/lib/transports/elasticsearch.js:177:12
at elasticsearch.version (/usr/lib/node_modules/elasticdump/lib/transports/elasticsearch.js:38:32)
at elasticsearch.set (/usr/lib/node_modules/elasticdump/lib/transports/elasticsearch.js:173:8)
at /usr/lib/node_modules/elasticdump/elasticdump.js:127:21
at file.completeBatch (/usr/lib/node_modules/elasticdump/lib/transports/file.js:92:10)
at Stream. (/usr/lib/node_modules/elasticdump/lib/transports/file.js:60:12)
@gibfahn
Copy link
Member

gibfahn commented Jan 11, 2017

Can you raise this in https://github.com/nodejs/help instead (or maybe in https://github.com/taskrabbit/elasticsearch-dump if that's the module you're having an issue with)?

If you can reproduce the issue with just the node core modules (i.e. you think it's a problem with node itself), feel free to comment on here and I'll reopen.

@gibfahn gibfahn closed this as completed Jan 11, 2017
@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt commented Jan 11, 2017

@showmeall , @gibfahn I suspect this is something connected with #9489 (see also #10687).

/******************************************************************************/
'use strict';
/******************************************************************************/
let maxString = '*'.repeat(Math.pow(2, 28) - 16);

console.log(maxString.length);

maxString += '*';

console.log(maxString.length);
268435440
test.js:8
maxString += '*';
^

RangeError: Invalid string length
    at Object.<anonymous> (e:\DOC\prg\js\node\-test\test.js:8:1)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:420:7)
    at startup (bootstrap_node.js:139:9)
    at bootstrap_node.js:535:3

@showmeall
Copy link
Author

ok, thanks, i see

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

3 participants