NodeJs: Error: Connect DevTools on Ubuntu

Hello all,

I tried to switch from a windows private instance to the NodeJs agent but it seems that the script has an issue when it tried to open Chrome DevTools.

First I had to edit wptdriver.sh to set :
declare chrome=“google-chrome”
(https://github.com/WPO-Foundation/webpagetest/blob/master/agent/js/wptdriver.sh#L91)
the variable is not set, is it normal ?

It thought it was ok because webdriver succeed to start chrome using the command:

./wptdriver.sh -s http://webpagetest -l Chrome 

But in the ouput:

node src/agent_main --serverUrl http://webpagetest --location Chrome --browser browser_local_chrome.BrowserLocalChrome --chromedriver /var/www/webpagetest/lib/webdriver/chromedriver/Linux x86_64/chromedriver-2.4 --chrome google-chrome
I Mar_10_16:41:50.355 browser_local_chrome.js:52 new BrowserLocalChrome : BrowserLocalChrome(/var/www/webpagetest/lib/webdriver/chromedriver/Linux x86_64/chromedriver-2.4, google-chrome)
I Mar_10_16:41:50.371 wpt_client.js:375 Client.<anonymous> : Get work: http://webpagetest/work/getwork.php?location=Chrome&f=json
....
I Mar_10_16:42:30.477 wpt_client.js:436 Client.processJobResponse_ : Got job: {"client_":{"domain":null,"_events":{},"_maxListeners":10,"app_":"<REDACTED>","baseUrl_":{"protocol":"http:","slashes":true,"auth":null,"host":"webpagetest","port":null,"hostname":"webpagetest","hash":null,"search":null,"query":null,"pathname":"/","path":"/","href":"http://webpagetest/"},"location_":"Chrome","currentJob_":null,"jobTimeout":120000},"task":{"Test ID":"140310_DH_D","url":"http://www.spotify.com","Capture Video":1,"runs":1,"browser":"google-chrome","orientation":"default"},"id":"140310_DH_D","runs":1,"captureVideo":true,"capturePackets":false,"isFirstViewOnly":false,"isReplay":false,"runNumber":1,"isCacheWarm":false,"resultFiles":[],"zipResultFiles":{}}
I Mar_10_16:42:30.479 agent_main.js:228 Agent.startJobRun_ : Running job 140310_DH_D run 1/1 cacheWarm=false
E Mar_10_16:42:30.572 process_utils.js:332 ChildProcess.<anonymous> : wpr status failed with exception: spawn ENOENT
W Mar_10_16:42:30.575 web_page_replay.js:124 WebPageReplay.<anonymous> : wpr status command failed: Error: wpr status failed, code -1, stderr[36] execvp(): No such file or directory
I Mar_10_16:42:30.664 browser_local_chrome.js:52 new BrowserLocalChrome : BrowserLocalChrome(/var/www/webpagetest/lib/webdriver/chromedriver/Linux x86_64/chromedriver-2.4, google-chrome)
I Mar_10_16:42:30.747 process_utils.js:354 unknown : Spawning: google-chrome --disable-fre --enable-benchmarking --metrics-recording-only '-remote-debugging-port=1234'
I Mar_10_16:42:31.275 process_utils.js:357 Socket.<anonymous> : google-chrome STDOUT: Nouvelle fenêtre ouverte dans la session du navigateur
I Mar_10_16:42:31.279 browser_base.js:64 BrowserLocalChrome.<anonymous> : Chrome EXIT code 0 signal null
E Mar_10_16:42:40.857 wd_server.js:1023 WebDriverServer.done_ : Run failed, stopping: Error: Connect DevTools
Wait timed out after 10066ms
    at /var/www/webpagetest/agent/js/node_modules/selenium-webdriver/lib/webdriver/promise.js:1210:29
    at /var/www/webpagetest/agent/js/node_modules/selenium-webdriver/lib/goog/base.js:1178:15
    at webdriver.promise.ControlFlow.runInNewFrame_ (/var/www/webpagetest/agent/js/node_modules/selenium-webdriver/lib/webdriver/promise.js:1438:20)
    at notify (/var/www/webpagetest/agent/js/node_modules/selenium-webdriver/lib/webdriver/promise.js:328:12)
    at then (/var/www/webpagetest/agent/js/node_modules/selenium-webdriver/lib/webdriver/promise.js:377:7)
    at Object.webdriver.promise.asap (/var/www/webpagetest/agent/js/node_modules/selenium-webdriver/lib/webdriver/promise.js:663:11)
    at webdriver.promise.ControlFlow.runInNewFrame_ (/var/www/webpagetest/agent/js/node_modules/selenium-webdriver/lib/webdriver/promise.js:1449:25)
    at pollCondition [as _onTimeout] (/var/www/webpagetest/agent/js/node_modules/selenium-webdriver/lib/webdriver/promise.js:1204:12)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
==== async task ====
Connect DevTools
    at webdriver.promise.ControlFlow.wait (/var/www/webpagetest/agent/js/node_modules/selenium-webdriver/lib/webdriver/promise.js:1195:15)
    at WebDriverServer.connectDevTools_ (/var/www/webpagetest/agent/js/src/wd_server.js:241:13)
    at WebDriverServer.startChrome_ (/var/www/webpagetest/agent/js/src/wd_server.js:230:8)
    at WebDriverServer.runPageLoad_ (/var/www/webpagetest/agent/js/src/wd_server.js:792:10)
    at WebDriverServer.runTest_ (/var/www/webpagetest/agent/js/src/wd_server.js:578:10)
    at webdriver.promise.ControlFlow.runInNewFrame_ (/var/www/webpagetest/agent/js/node_modules/selenium-webdriver/lib/webdriver/promise.js:1438:20)
    at webdriver.promise.ControlFlow.runEventLoop_ (/var/www/webpagetest/agent/js/node_modules/selenium-webdriver/lib/webdriver/promise.js:1303:8)
    at wrapper [as _onTimeout] (timers.js:252:14)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
==== async task ====
Run the test
    at app.schedule (/var/www/webpagetest/agent/js/src/process_utils.js:399:26)
    at WebDriverServer.connect (/var/www/webpagetest/agent/js/src/wd_server.js:890:13)
    at WebDriverServer.<anonymous> (/var/www/webpagetest/agent/js/src/wd_server.js:105:12)
    at process.EventEmitter.emit (events.js:98:17)
    at handleMessage (child_process.js:318:10)
    at Pipe.channel.onread (child_process.js:345:11)

Does someone has a clue?
wpr status failed with exception: spawn ENOENT” looks weird. Is it normal?

Thanks
I’m using webpagetest 2.13, Chrome Version 32.0.1700.77 on Ubuntu 13.10 and Node v0.10.21

I’m also getting an error with the NodeJS agent.

W Apr_15_14:34:41.055 process_utils.js:360 Socket. : chrome STDERR: execvp(): No such file or directory
E Apr_15_14:34:41.059 wd_server.js:1010 WebDriverServer.done_ : Run failed, stopping: Error: spawn ENOENT
at errnoException (child_process.js:988:11)
at Process.ChildProcess._handle.onexit (child_process.js:779:34)

Hi CaptainMat,

Did you manage to get anywhere with this? Im seeing the same problem on Ubuntu 14.04 with latest chrome stable, it looks like chrome is starting but not opening the debug port (1234) which I think devtools requires.

Cheers

Sam

Hi all,

I came across a similar issue recently when setting up a nodeJs agent on Centos, and eventually I found that the agent was trying to connect to DevTools on localhost:1234 - but localhost could not be resolved. Putting 127.0.0.1 localhost into /etc/hosts fixed that issue, for me at least.

-John.