Kibana reporting plugin fails to launch chrome (puppeteer)

Hi, I'm running Kibana 7.7.1 in docker and I get the following errors in output:

{"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:\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. 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.

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

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:

/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

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

Running headless_shell binary gives

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:

# 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
[0609/] Failed to read DnsConfig.

DevTools listening on ws://
[0609/] Failed to read DnsConfig.

In puppeteer instructions for alpine it has:

# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.

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.

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

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

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

 FATAL  ExtractError: Failed to extract the browser archive

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.

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