# Optimizer fails when running yarn start in Kibana version 8

**URL:** <https://discuss.elastic.co/t/optimizer-fails-when-running-yarn-start-in-kibana-version-8/324142>\
**Category:** Kibana\
**Tags:** docker\
**Created:** [January 28, 2023, 12:49am UTC](https://discuss.elastic.co/t/optimizer-fails-when-running-yarn-start-in-kibana-version-8/324142 "2023-01-28T00:49:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssimmons](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@ssimmons](https://discuss.elastic.co/u/ssimmons)\
**Post date:** [January 28, 2023, 12:49am UTC](https://discuss.elastic.co/t/optimizer-fails-when-running-yarn-start-in-kibana-version-8/324142/1 "2023-01-28T00:49:30Z")

</div>

I'm in the process of upgrading our custom plugins to Kibana version 8. I'm trying to setup Kibana and Elasticsearch through docker. In the past, I built Kibana using a Dockerfile that would clone Kibana and then run yarn kbn bootstrap. I can still do this with Kibana 8. However, when I connect to the Kibana container and run a yarn start, it bombs out during the optimizer commands. I can never get it to run. It doesn't matter what subversion of 8 I run, I cannot get past the optimizer steps. Here's the type of errors I'm getting.

```auto
np bld log [22:56:29.127] [info][@kbn/optimizer] [6/146] initial bundle builds complete
 np bld log [22:56:39.280] [info][@kbn/optimizer] [9/146] initial bundle builds complete
 [@kbn/optimizer] fatal error Error: worker exitted unexpectedly with code null [last message: { bundleId: 'actions', type: 'compiler success', moduleCount: 12 }]
    at /kibana/node_modules/@kbn/optimizer/target_node/src/optimizer/observe_worker.js:147:13
    at /kibana/node_modules/rxjs/dist/cjs/internal/operators/map.js:10:37
    at OperatorSubscriber._this._next (/kibana/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js:33:21)
    at OperatorSubscriber.Subscriber.next (/kibana/node_modules/rxjs/dist/cjs/internal/Subscriber.js:51:18)
    at ChildProcess.handler (/kibana/node_modules/rxjs/dist/cjs/internal/observable/fromEvent.js:59:31)
    at ChildProcess.emit (node:events:525:35)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
error Command failed with exit code 1.

```

---

<div class="post-metadata">

**Author:** ![ssimmons](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@ssimmons](https://discuss.elastic.co/u/ssimmons)\
**Post date:** [February 14, 2023, 4:49pm UTC](https://discuss.elastic.co/t/optimizer-fails-when-running-yarn-start-in-kibana-version-8/324142/2 "2023-02-14T16:49:19Z")

</div>

I found the issue to my problem and wanted to leave an update here in case anyone else is trying to run a development version of Kibana version 8 within a docker container. There's a parameter within the `docker-compose.yml` file that is listed on the Kibana 8 setup pages called `mem_limit`. This is set to a little over 1Gb. I had to increase this to 4Gb to get the optizimation steps to work. Even with it set to 4Gb, it would still crash and I'd have to restart it a couple times before it would finish optimizing all the bundles.

---

<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:** [March 14, 2023, 4:49pm UTC](https://discuss.elastic.co/t/optimizer-fails-when-running-yarn-start-in-kibana-version-8/324142/3 "2023-03-14T16:49:43Z")

</div>

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