Optimizer: RangeError: Invalid string length

Hello, I'm using Kibana 5.5 together with ES 5.5.
I'm writing my custom plugin, based on the kibana-plugin generator.

It was working for a long time, but recently I cannot start kibana, because I got the following error message:

server    log   [23:36:26.503] [info][listening] Server running at https://localhost:5603
server    log   [23:36:26.507] [info][status][ui settings] Status changed from uninitialized to green - Ready
/vagrant/files/kibana/node_modules/webpack/lib/Compiler.js:295
		this.outputFileSystem.writeFile(this.recordsOutputPath, JSON.stringify(this.records, undefined, 2), callback);
		                                                             ^

RangeError: Invalid string length
    at join (native)
    at Object.stringify (native)
    at Compiler.writeFile (/vagrant/files/kibana/node_modules/webpack/lib/Compiler.js:295:64)
    at Compiler.<anonymous> (/vagrant/files/kibana/node_modules/webpack/lib/Compiler.js:291:13)
    at /vagrant/files/kibana/node_modules/mkdirp/index.js:48:26
    at FSReqWrap.oncomplete (fs.js:123:15)
 optimizer crashed  with status code 1
child_process.js:504
    throw err;
    ^

Error: Command failed: bin/kibana --dev --plugin-path /vagrant/files/mavir-frsz --max_old_space_size 3048 --loglevel info --dev
    at checkExecSyncError (child_process.js:481:13)
    at execFileSync (child_process.js:501:13)
    at module.exports (/vagrant/files/mavir-frsz/node_modules/@elastic/plugin-helpers/tasks/start/start_action.js:13:3)
    at run (/vagrant/files/mavir-frsz/node_modules/@elastic/plugin-helpers/lib/run.js:9:10)
    at /vagrant/files/mavir-frsz/node_modules/@elastic/plugin-helpers/cli.js:25:7
    at Command.actionWrapper (/vagrant/files/mavir-frsz/node_modules/@elastic/plugin-helpers/cli.js:12:8)
    at Command.listener (/vagrant/files/mavir-frsz/node_modules/commander/index.js:300:8)
    at emitTwo (events.js:106:13)
    at Command.emit (events.js:191:7)
    at Command.parseArgs (/vagrant/files/mavir-frsz/node_modules/commander/index.js:635:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mavir-frsz@0.0.0 start: `plugin-helpers start "--max_old_space_size=3048" "--loglevel" "info" "--dev"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the mavir-frsz@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2017-11-28T23_37_32_167Z-debug.log
Connection to 127.0.0.1 closed.

What can I do to solve this?

It looks like an OOM error. Can you try bumping max old space size? It's something we're working on but in the meantime most us set it to 8gb.

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