lighthousebot
lighthousebot copied to clipboard
Cannot run the lighthouse_ci container (nonheadless) locally
I am just trying to run the lighthouse locally for a sample any website and see report generated on my Ubuntu machine.
I followed ReadMe! for building the image for full-chrome
And then execute
docker run -it --rm --cap-add=SYS_ADMIN lighthouse_ci https://example.com
But getting the error as
[ ok ] Starting system message bus: dbus.
sh: 0: Can't open /chromeuser-script_nonheadless.sh
ChromeLauncher No debugging port found on port 9222, launching a new Chrome. +0ms
ChromeLauncher Waiting for browser. +24ms
ChromeLauncher Waiting for browser... +0ms
ChromeLauncher Waiting for browser....................................................................................................... +501ms
ChromeLauncher:error connect ECONNREFUSED 127.0.0.1:9222 +1ms
ChromeLauncher:error Logging contents of /tmp/lighthouse.cZohn3u/chrome-err.log +0ms
ChromeLauncher:error [61:61:0606/124640.016489:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
ChromeLauncher:error +0ms
Not sure if it is a real issue but any help will be appreciable.
same happens to me.
I builded docker with docker_build.sh
and run below command
[root]# docker run -it --rm --cap-add=SYS_ADMIN lighthouse_ci https://example.com
ChromeLauncher No debugging port found on port 9222, launching a new Chrome. +0ms
ChromeLauncher Waiting for browser. +37ms
ChromeLauncher Waiting for browser... +1ms
ChromeLauncher Waiting for browser..... +503ms
ChromeLauncher Waiting for browser....... +501ms
ChromeLauncher Waiting for browser......... +502ms
ChromeLauncher Waiting for browser........... +502ms
ChromeLauncher Waiting for browser............. +502ms
ChromeLauncher Waiting for browser............... +502ms
ChromeLauncher:error connect ECONNREFUSED 127.0.0.1:9222 +1ms
ChromeLauncher:error Logging contents of /tmp/lighthouse.nAr07XQ/chrome-err.log +1ms
ChromeLauncher:error [0807/062901.788984:FATAL:zygote_host_impl_linux.cc(116)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
ChromeLauncher:error Failed to generate minidump. +6ms
Unable to connect to Chrome
thx for reading.
Just did a fresh checkout and not seeing this myself when using Dockerfile.nonheadless
. I'm using Docker 18.0.6 on Mac.
sh: 0: Can't open /chromeuser-script_nonheadless.sh
Looks suspicious. Do you have that file in your checkout, inside builder/
?
@asayamakk try launching headful chrome with --disable-sandbox
in https://github.com/ebidel/lighthouse-ci/blob/master/builder/chromeuser-script_nonheadless.sh or add it to --chrome-flags
in https://github.com/ebidel/lighthouse-ci/blob/master/builder/entrypoint.sh#L6.
I'm using --no-sandbox
at https://github.com/ebidel/lighthouse-ci/blob/master/builder/chromeuser-script_nonheadless.sh in combination with this change to make the service successfully find the chrome instance:
diff --git a/builder/server.js b/builder/server.js
index 8b57f39..3fe8b6c 100644
--- a/builder/server.js
+++ b/builder/server.js
@@ -27,7 +27,7 @@ function getDefaultArgs(outputPath, format) {
return [
`--output-path=${outputPath}`,
`--output=${format}`,
- '--port=0', // choose random port every time so we launch a new instance of Chrome.
+ '--port=9222', // pointing at chrome's remote debugging port
// Note: this is a noop when using Dockerfile.nonheadless b/c Chrome is already launched.
'--chrome-flags="--headless"',
];