chrome-launcher icon indicating copy to clipboard operation
chrome-launcher copied to clipboard

Does not open URL when launched from WSLv2

Open Stanzilla opened this issue 4 years ago • 8 comments

Provide the steps to reproduce

  1. Run LH on google.com

What is the current behavior?

Chrome opens to about:blank

What is the expected behavior?

Chrome opens to google.com

Environment Information

  • Affected Channels: Node
  • Lighthouse version: 6.0.0-beta.0
  • Chrome version: 84.0.4120.0 (Official Build) canary (64-bit) (cohort: Clang-64)
  • Node.js version: v13.13.0
  • Operating System: Windows 10 2004 with WSLv2

Related issues

Lighthouse is installed inside of WSL, if I then run it from zsh/bash, it opens a blank Chrome video instead of the URL I passed

Stanzilla avatar Apr 20 '20 11:04 Stanzilla

Thanks for filing @Stanzilla!

Just to be clear Chrome should always open to about:blank before navigating anywhere else when run from the CLI or node. Are you saying that Chrome then never eventually navigates to google.com and generates a report? Would you be able to share log output or the resulting file in that case?

patrickhulce avatar Apr 20 '20 15:04 patrickhulce

Yup, pretty much.

image

This is as far as it gets.

Stanzilla avatar Apr 20 '20 15:04 Stanzilla

Oh hey, I just had to wait for longer:

................... +501ms       
                                                                                         ChromeLauncher:error connect ECONNREFUSED 127.0.0.1:42915 +1ms     

ChromeLauncher:error Logging contents of /mnt/c/Users/Stan/AppData/Local/lighthouse.37098622/chrome-err.log +1ms        ChromeLauncher:error                                                                                                    

ChromeLauncher:error DevTools listening on ws://127.0.0.1:42915/devtools/browser/64782eb6-9eb0-4b6e-92a9-b7139bc7ff08   ChromeLauncher:error  +0ms                                                                                            Unable to connect to Chrome  

Stanzilla avatar Apr 20 '20 16:04 Stanzilla

Interesting, can you access Chrome ports if Lighthouse isn't involved at all?

i.e. start Chrome manually with a remote debugging port and try to hit its URL

something like

$ /mnt/c/Program\ Files/Google/Chrome/Application/chrome.exe --remote-debugging-port=9222
$ curl http://localhost:9222/json/list
[ {
   "description": "",
   "devtoolsFrontendUrl": "/devtools/inspector.html?ws=localhost:9222/devtools/page/ED195C56A295627721FBB5E64E3968A0",
   "id": "ED195C56A295627721FBB5E64E3968A0",
   "title": "New Tab",
   "type": "page",
   "url": "chrome://newtab/",
   "webSocketDebuggerUrl": "ws://localhost:9222/devtools/page/ED195C56A295627721FBB5E64E3968A0"
} ]

patrickhulce avatar Apr 20 '20 16:04 patrickhulce

Nope, connection refused.

Stanzilla avatar Apr 20 '20 16:04 Stanzilla

Hm, seems like there are intermittent WSL issues with localhost binding https://github.com/microsoft/WSL/issues/4636 maybe try some of the remediation techniques there?

Restarting LxssManager from windows services worked for me. I hope it keeps on working 🤞

Seemed to have some success for folks.

cc @wardpeet do you use WSL and do you remember encountering anything like this?

patrickhulce avatar Apr 20 '20 16:04 patrickhulce

Sadly I do not use Wsl. Also wsl2 isn't available yet for me. I can give wsl v1 another go, it worked in the past

wardpeet avatar Apr 20 '20 17:04 wardpeet

Restarting LxssManager did not do the trick, sadly.

@wardpeet WSLv2 is currently in the release preview ring

Stanzilla avatar Apr 20 '20 17:04 Stanzilla