lighthouse: ECONNREFUSED error, I don't understand...
Hi, I am on CentOS 7 with google-chrome installed (version 59) and node version 8.2.1
I run this code
const chromeLauncher = require('chrome-launcher');
chromeLauncher.launch({
startingUrl: 'https://google.com',
chromeFlags: ['--headless', '--disable-gpu']
}).then(chrome => {
console.log(`Chrome debugging port running on ${chrome.port}`);
});
and it will return error like this.
(node:31716) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: connect ECONNREFUSED 127.0.0.1:33416
(node:31716) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I don’t undestand that error, why it can’t connect to that port? Is there any special settings needed on network side?
Thanks in advance.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 3
- Comments: 19 (3 by maintainers)
Commits related to this issue
- Fix CI build See https://github.com/GoogleChrome/lighthouse/issues/2726#issuecomment-318890564 — committed to studiometa/performance-leaderboard by deleted user 3 years ago
- Fix CI build See https://github.com/GoogleChrome/lighthouse/issues/2726#issuecomment-318890564 — committed to studiometa/performance-leaderboard by deleted user 3 years ago
- Fix CI build See https://github.com/GoogleChrome/lighthouse/issues/2726#issuecomment-318890564 — committed to studiometa/performance-leaderboard by deleted user 3 years ago
@sonyarianto, I was experimenting the same issue on Chrome 60 and adding
--no-sandbox
flag solved the problem.@cancerberoSgx You can do so via the command line, just pass the flags to --chrome-flags, like so:
lighthouse <url> --chrome-flags="--no-sandbox --headless --disable-gpu"
@carloslfu Yes, it solve my problem by adding
--no-sandbox
@carloslfu How do you even figure that out??? I mean, thank you, but like how
Hello @zwhitchcox . I found the solution by using command line e.g.
lighthouse https://google.com
. Then this error is shown: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.
As per other replies, I get
Error: connect ECONNREFUSED ::1:61099
using Node 17 or above (on Mac 13.2).Works fine with Node v16.17.1.
@braincomb I tried adding
lighthouse <url> --chrome-flags="--no-sandbox --headless --disable-gpu"
however the same issue persists with me. I’m on Windows 10 and the Lighthouse CLI worked fine just days ago (well it refused to close the tab so I was left with hundreds of blank chrome tabs but otherwise fine 😆 ) and now suddenly doesn’t work. I get the sameECONNREFUSED
error andUnable to connect to Chrome
after waiting for upwards of ten seconds. It logs dozens ofwaiting for browser
messages every 500ms or so. This is a very high priority for me because without this tool we cannot log data, we cannot update graphs and we cannot track progress and won’t have accurate data to present. Thank you.UPDATE: reverted node 17 to node 16 and it worked (plus a lot of debugging other solutions already mentioned)
I didn’t had luck with the command lighthouse - same error as carloslfu. I did had luck using lightouse programmatically and passing --no-sandbox to chromeLauncher.launch() - if possible I would recommend to add this flag to documentation since this blocks new users 😦 thanks