# Kibana reporting plugin fails to launch chrome (puppeteer)

**URL:** <https://discuss.elastic.co/t/kibana-reporting-plugin-fails-to-launch-chrome-puppeteer/236195>\
**Category:** Kibana\
**Tags:** docker\
**Created:** [June 8, 2020, 3:09pm UTC](https://discuss.elastic.co/t/kibana-reporting-plugin-fails-to-launch-chrome-puppeteer/236195 "2020-06-08T15:09:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chingis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chingis/32/69906_2.png) [@chingis](https://discuss.elastic.co/u/chingis)\
**Post date:** [June 8, 2020, 3:09pm UTC](https://discuss.elastic.co/t/kibana-reporting-plugin-fails-to-launch-chrome-puppeteer/236195/1 "2020-06-08T15:09:44Z")

</div>

Hi, I'm running Kibana 7.7.1 in [docker](https://github.com/wodby/kibana) and I get the following errors in output:

```auto
{"tags":["error","reporting"],"pid":1,"message":"The Reporting plugin encountered issues launching Chromium in a self-test. You may have trouble generating reports."}
{"tags":["error","reporting"],"pid":1,"message":"Error: Failed to launch chrome! spawn /usr/share/kibana/data/headless_shell-linux/headless_shell ENOENT\n\n\nTROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md\n\n at onClose (/usr/share/kibana/node_modules/puppeteer-core/lib/Launcher.js:349:14)\n at ChildProcess.helper.addEventListener.error (/usr/share/kibana/node_modules/puppeteer-core/lib/Launcher.js:340:64)\n at ChildProcess.emit (events.js:198:13)\n at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)\n at onErrorNT (internal/child_process.js:415:16)\n at process._tickCallback (internal/process/next_tick.js:63:19)"}
{"tags":["warning","reporting"],"pid":1,"message":"See Chromium's log output at \"/usr/share/kibana/data/headless_shell-linux/chrome_debug.log\""}
{"tags":["error","reporting"],"pid":1,"message":"Error: Could not close browser client handle!\n at browserFactory.test.then.browser (/usr/share/kibana/x-pack/legacy/plugins/reporting/server/lib/validate/validate_browser.js:26:15)\n at process._tickCallback (internal/process/next_tick.js:68:7)"}
{"tags":["warning","reporting"],"pid":1,"message":"Reporting plugin self-check generated a warning: Error: Could not close browser client handle!"}

```

I've installed all packages [recommended by puppeteer](https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#running-on-alpine). I'm not sure how to fix this because there's no logs. File `/usr/share/kibana/data/headless_shell-linux/chrome_debug.log` does not exist. Adding the env var `DEBUG="puppeteer:*"` did not add anything to output.

---

<div class="post-metadata">

**Author:** ![joelgriffith](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joelgriffith/32/53738_2.png) [@joelgriffith](https://discuss.elastic.co/u/joelgriffith)\
**Post date:** [June 9, 2020, 3:03pm UTC](https://discuss.elastic.co/t/kibana-reporting-plugin-fails-to-launch-chrome-puppeteer/236195/2 "2020-06-09T15:03:11Z")

</div>

Hey there! Sorry to hear about your troubles launching the browser. This line is very telling:

> [@chingis](#):
>
> `/usr/share/kibana/data/headless_shell-linux/headless_shell ENOENT `

Which means that the chromium binary we build for reporting isn't in the file-system. Can you try and run this command to see if it works:

```auto
/usr/share/kibana/data/headless_shell-linux/headless_shell --disable-translate --disable-extensions --disable-background-networking --safebrowsing-disable-auto-update --disable-sync --metrics-recording-only --disable-default-apps --mute-audio --no-first-run --disable-gpu --no-sandbox --headless --hide-scrollbars --window-size=400,400 --remote-debugging-port=9221 https://example.com/

```

If not, then the binary didn't unpack or install during Kibana startup.

---

<div class="post-metadata">

**Author:** ![chingis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chingis/32/69906_2.png) [@chingis](https://discuss.elastic.co/u/chingis)\
**Post date:** [June 9, 2020, 4:26pm UTC](https://discuss.elastic.co/t/kibana-reporting-plugin-fails-to-launch-chrome-puppeteer/236195/3 "2020-06-09T16:26:10Z")

</div>

Running headless\_shell binary gives

```auto
sh: ./data/headless_shell-linux/headless_shell: not found

```

Maybe it has something to do with the alpine linux. I install chromium package from alpine repository, is there a way for Kibana to use it instead?

If I run `chromium-browser` it works:

```auto
# chromium-browser --disable-translate --disable-extensions --disable-background-networking --safebrowsing-disable-auto-update --disable-sync --met
rics-recording-only --disable-default-apps --mute-audio --no-first-run --disable-gpu --no-sandbox --headless --hide-scrollbars --window-size=400,400 --remote-debugging-port=9221 https://examp
le.com/
[0609/162157.780868:WARNING:dns_config_service_posix.cc(341)] Failed to read DnsConfig.

DevTools listening on ws://127.0.0.1:9221/devtools/browser/f203575c-b6f0-4bbb-b04c-51cbe6013fca
[0609/162157.850912:WARNING:dns_config_service_posix.cc(341)] Failed to read DnsConfig.

```

In [puppeteer instructions](https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#running-on-alpine) for alpine it has:

```auto
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
    PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser

```

---

<div class="post-metadata">

**Author:** ![joelgriffith](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joelgriffith/32/53738_2.png) [@joelgriffith](https://discuss.elastic.co/u/joelgriffith)\
**Post date:** [June 9, 2020, 11:15pm UTC](https://discuss.elastic.co/t/kibana-reporting-plugin-fails-to-launch-chrome-puppeteer/236195/4 "2020-06-09T23:15:00Z")

</div>

I'd suggest trying out a symlink from `/usr/share/kibana/data/headless_shell-linux/headless_shell` to point to your already-installed chromium at `chromium-browser`.

There's a few caveats: we do roll our own binary, so I'd also suggest looking at startup logs on why that binary isn't there. Things like WebGL visualizations are known to work on our chromium build, but might not on your prior-installed version.

---

<div class="post-metadata">

**Author:** ![chingis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chingis/32/69906_2.png) [@chingis](https://discuss.elastic.co/u/chingis)\
**Post date:** [June 10, 2020, 1:02pm UTC](https://discuss.elastic.co/t/kibana-reporting-plugin-fails-to-launch-chrome-puppeteer/236195/5 "2020-06-10T13:02:02Z")

</div>

I'm sorry I wasn't clear – the binary `/usr/share/kibana/data/headless_shell-linux/headless_shell` is actually there but when I run it I get

```auto
sh: ./data/headless_shell-linux/headless_shell: not found

```

Thus, symlinking causes a fail on startup with the error:

```auto
 FATAL ExtractError: Failed to extract the browser archive

```

---

<div class="post-metadata">

**Author:** ![chingis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chingis/32/69906_2.png) [@chingis](https://discuss.elastic.co/u/chingis)\
**Post date:** [June 10, 2020, 1:18pm UTC](https://discuss.elastic.co/t/kibana-reporting-plugin-fails-to-launch-chrome-puppeteer/236195/6 "2020-06-10T13:18:57Z")

</div>

What is the correct way to reinstall kibana's node modules? I can add the env vars I mentioned above so pupeeteer won't download chrome during installation and instead will use the one from alpine packages? I tried deleting `node_modules` and running `npm install` but that did nothing.

---

<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:** [July 8, 2020, 1:19pm UTC](https://discuss.elastic.co/t/kibana-reporting-plugin-fails-to-launch-chrome-puppeteer/236195/7 "2020-07-08T13:19:02Z")

</div>

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