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

Debugger connection check fails to work #25

Open
Wain-PC opened this issue Jul 13, 2017 · 5 comments
Open

Debugger connection check fails to work #25

Wain-PC opened this issue Jul 13, 2017 · 5 comments
Assignees

Comments

@Wain-PC
Copy link
Contributor

Wain-PC commented Jul 13, 2017

Hello!
I'm running speedracer under Linux, and for some reason Chrome fails to open port 9222 for debugging if I don't use sudo. The problem is that speedracer actually outputs the issue:
chrome-launcher chrome error: Error: connect ECONNREFUSED 127.0.0.1:9222 +4ms
(at least with debug output enabled) but doesn't stop after that. Here's the sample output:

DEBUG=* speedracer run race.js

  chrome-launcher locate chrome +0ms
  chrome-launcher trying: /Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary +0ms
  chrome-launcher auto locate chrome +1ms
  chrome-launcher chrome found: /usr/bin/google-chrome +8ms
  chrome-launcher spawn chrome with flags: --headless,--remote-debugging-port=9222,--disable-gpu,--disable-translate,--disable-extensions,--disable-background-networking,--safebrowsing-disable-auto-update,--disable-sync,--metrics-recording-only,--disable-default-apps,--no-first-run,--user-data-dir=/tmp,--js-flags="--expose-gc" +1ms
  chrome-launcher check debugger ready: 1 +2ms
  chrome-launcher chrome error: Error: connect ECONNREFUSED 127.0.0.1:9222 +4ms
  chrome-launcher check debugger ready: 2 +501ms
  chrome-launcher chrome ready +1ms
  server start server +0ms
  server listening on port: 3000 +3ms
  server serving directory: /home/speedracer +0ms
  runner-server listening on port: 3001 +0ms
  driver load file race.js +38ms
  director file loaded: race.js +114ms
  director no races found: race.js +3s

I assume stopping at failures like that and outputting them in non-debug mode could potentially save some time for other users. Thanks in advance!

@ngryman
Copy link
Collaborator

ngryman commented Jul 13, 2017

assume stopping at failures like that and outputting them in non-debug mode could potentially save some time for other users. Thanks in advance!

You're totally right 😆, I'm addressing this issue and many others in 0.3.0 (very slowly but surely).

Back to your problem...

chrome-launcher spawn chrome with flags: --headless,--remote-debugging-port=9222,--disable-gpu,--disable-translate,--disable-extensions,--disable-background-networking,--safebrowsing-disable-auto-update,--disable-sync,--metrics-recording-only,--disable-default-apps,--no-first-run,--user-data-dir=/tmp,--js-flags="--expose-gc" +1ms

This means that it did started Chrome.

chrome-launcher check debugger ready: 1 +2ms
chrome-launcher chrome error: Error: connect ECONNREFUSED 127.0.0.1:9222 +4ms
chrome-launcher check debugger ready: 2 +501ms
chrome-launcher chrome ready +1ms

Then comes the a period when Speed Racer waits for the debugger to answer, it usually takes some time so it retries several times. Here it tries on time, ECONNREFUSED 127.0.0.1:9222 means the debugger can't be reached because it's not ready yet. Then it retries a second time 500ms later and logs chrome-launcher chrome ready +1ms. Which means Chrome is started and Speed Racer is talking to it.

So your problem does not come from Chrome AFAIK.

director no races found: race.js +3s

It means that it can't find any race in /home/speedracer.

Would you mind giving me the command line you typed and the tree structure of this directory?

@ngryman ngryman self-assigned this Jul 13, 2017
@ngryman
Copy link
Collaborator

ngryman commented Oct 14, 2017

It might be related to #30 which has the same symptoms and matches with the date breaking changes have been introduced to rollup-stream.

Closing this for now.

@joaomilho
Copy link

I got a similar issue, but not the same:

DEBUG=* ./node_modules/.bin/speedracer run src/ui/EmailField/race.js

  chrome-launcher locate chrome +0ms
  chrome-launcher trying: /Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary +0ms
  chrome-launcher auto locate chrome +1ms
  chrome-launcher chrome found: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome +1ms
  chrome-launcher spawn chrome with flags: --headless,--remote-debugging-port=9222,--disable-gpu,--disable-translate,--disable-extensions,--disable-background-networking,--safebrowsing-disable-auto-update,--disable-sync,--metrics-recording-only,--disable-default-apps,--no-first-run,--user-data-dir=/var/folders/p_/zct4t9xd5_5gcl43kq_6wrm80000gn/T,--js-flags="--expose-gc" +0ms
  chrome-launcher check debugger ready: 1 +4ms
  chrome-launcher chrome error: Error: connect ECONNREFUSED 127.0.0.1:9222 +4ms
  chrome-launcher check debugger ready: 2 +504ms
  chrome-launcher chrome ready +2ms
  server start server +0ms
  server listening on port: 3000 +4ms
  server serving directory: /..... +0ms
  runner-server listening on port: 3001 +0ms
  driver load file src/ui/EmailField/race.js +29ms
  director file loaded: src/ui/EmailField/race.js +9ms
  bundler warning: options.entry is deprecated, use options.input +107ms
  runner-server client connected +90ms
  runner-server rcv file:start undefined +1ms
  runner-server rcv race:start my first async race +0ms
  driver start tracing +1ms
  director clear timeout +0ms
  driver tracing started +2ms
  runner-server ack race:start +0ms
  runner-server rcv race:finish my first async race +8ms
  driver stop tracing +0ms
  driver events collected 31 +3ms
  driver events collected 33 +0ms
  driver tracing complete +1ms
  director race finished my first async race (64 events) +0ms
  runner-server ack race:finish +1ms
  runner-server rcv file:finish undefined +8ms
  director total races: 1 +0ms
Cannot read property 'error' of undefined
TypeError: Cannot read property 'error' of undefined
    at TimelineModel.TimelineModel._extractCpuProfile (chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js:470:22)
    at TimelineModel.TimelineModel._injectJSFrameEvents (chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js:481:31)
    at TimelineModel.TimelineModel._processThreadEvents (chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js:504:23)
    at TimelineModel.TimelineModel.setEvents (chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js:197:16)
    at SandboxedModel.init (evalmachine.<anonymous>:133:25)
    at new ModelAPI (/...../node_modules/devtools-timeline-model/index.js:29:18)
    at new Report (/...../node_modules/speedracer/lib/report.js:14:21)
    at Race.createReport (/...../node_modules/speedracer/lib/race.js:44:19)
    at race (/...../node_modules/speedracer/bin/speedracer-run.js:150:16)
    at pReduce (/...../node_modules/p-map-series/index.js:8:26)

then...

# node -v
v8.11.3
# cat package.json| grep speedracer
"speedracer": "^0.2.1"

@joaomilho
Copy link

Trying the 0.3.0 tag I end up with director no races found: src/ui/EmailField/race.js +3s instead

@ngryman
Copy link
Collaborator

ngryman commented Sep 15, 2018

Hey, sorry for the late answer here. Would you mind posting me the content of src/ui/EmailField/race.js? Thanks!

@ngryman ngryman reopened this Sep 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants