Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled 'error' event when trying to run Lighthouse via a remote Android device #1476

Closed
rpkoller opened this issue Jan 16, 2017 · 3 comments

Comments

@rpkoller
Copy link

Hi I tried to run Lighthouse with a mobile device today but ran into and unhandled 'error' event. I am running OSX 10.11.6 all the latest patches applied. I have installed node 7.4 and android-platform-tools 25 via Homebrew. I have installed Lighthouse version 1.4.1 globally . The device I try to connect to is a Nexus 4. chrome://inspect/?trace works flawlessly. adb devices -l works always without any problems. I get:

$> adb devices -l
List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
01bd36e3e18cb702       device usb:4195549184X product:occam model:Nexus_4 device:mako

When i try the next step i get no returning output. No error but also no feedback of success:

adb forward tcp:9222 localabstract:chrome_devtools_remote

But when i try the last line listed on the project page with the site of a friend of mine i got the following error:

lighthouse --disable-device-emulation --disable-cpu-throttling https://www.climbingflex.com
events.js:160
     throw er; // Unhandled 'error' event
     ^

Error: socket hang up
   at createHangUpError (_http_client.js:253:15)
   at Socket.socketOnEnd (_http_client.js:345:23)
   at emitNone (events.js:91:20)
   at Socket.emit (events.js:185:7)
   at endReadableNT (_stream_readable.js:974:12)
   at _combinedTickCallback (internal/process/next_tick.js:74:11)
   at process._tickCallback (internal/process/next_tick.js:98:9)

But the odd thing is i've tried it a few times and i've always received the error. Now tried it another time and it worked?!?! Is it possible that it is linked to the following issue? #1464 If you need any further infos let me know. Best regards r.

@nathanjd
Copy link

I've had a similar issue. I got the same errors and behavior as you except I was never able to create a successful connection through lighthouse.

The root cause for me was that I had recently done a factory reset on the device and had yet to accept the chrome user agreement.

In general it seems chrome must be running on the device with no pending prompts for the socket connection to be successful.

@rpkoller
Copy link
Author

hmmm that's odd i did the other agreement part before for adb today and yesterday for chrome inspect. there were definitely no more prompts i agreed to inbetween the errors and the successful run afterwards. Maybe it needed a few rounds until the hickups were gone? but good to know regarding the prompts i keep an eye onto it in case it shows up again. thanks!

@paulirish
Copy link
Member

Nowadays you'll also need --port=9222.
We think this may not be an issue any longer, but please comment if you've run into this since 2.5.0+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants