# Optimizer: RangeError: Invalid string length

**URL:** <https://discuss.elastic.co/t/optimizer-rangeerror-invalid-string-length/109495>\
**Category:** Kibana\
**Created:** [November 28, 2017, 11:45pm UTC](https://discuss.elastic.co/t/optimizer-rangeerror-invalid-string-length/109495 "2017-11-28T23:45:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![geujvari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/geujvari/32/21017_2.png) [@geujvari](https://discuss.elastic.co/u/geujvari)\
**Post date:** [November 28, 2017, 11:45pm UTC](https://discuss.elastic.co/t/optimizer-rangeerror-invalid-string-length/109495/1 "2017-11-28T23:45:39Z")

</div>

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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [November 29, 2017, 9:00pm UTC](https://discuss.elastic.co/t/optimizer-rangeerror-invalid-string-length/109495/2 "2017-11-29T21:00:22Z")

</div>

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.

---

<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:** [December 27, 2017, 9:00pm UTC](https://discuss.elastic.co/t/optimizer-rangeerror-invalid-string-length/109495/3 "2017-12-27T21:00:41Z")

</div>

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