meteor-webdriver icon indicating copy to clipboard operation
meteor-webdriver copied to clipboard

ChromeDriver failed to start

Open djhi opened this issue 10 years ago • 15 comments

ChromeDriver failed to start in 5 seconds

[xolvio:cucumber] Cucumber is running
[xolvio:webdriver] getChromeDriver called
[xolvio:webdriver] startChromeDriver called
[xolvio:webdriver] Entering _startChromeDriver
[xolvio:webdriver] Spawning phantom process binary /home/gildas/.meteor/packages/xolvio_webdriver/.0.5.2.1c9pccx++os+web.browser+web.cordova/npm/node_modules/chromedriver/lib/chromedriver/chromedriver
[xolvio:webdriver] Spawned phantom process with pid 845
[xolvio:webdriver] Finished _startChromeDriver
(STDERR) ChromeDriver failed to start in 5  seconds /home/gildas/.meteor/packages/xolvio_webdriver/.0.5.2.1c9pccx++os+web.browser+web.cordova/npm/node_modules/chromedriver/lib/chromedriver/chromedriver
(STDERR) 
(STDERR) events.js:72
(STDERR)         throw er; // Unhandled 'error' event
(STDERR)               ^
(STDERR) Error: Phantom failed to start
(STDERR)   at [object Object]._onTimeout (/home/gildas/projects/payfacile/.meteor/local/build/programs/server/packages/xolvio_webdriver.js:386:13)
(STDERR)   at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)
(STDERR) 

While investigating, I found something strange: if I look at the files in /home/gildas/.meteor/packages/xolvio_webdriver/.0.5.2.1c9pccx++os+web.browser+web.cordova/npm/node_modules/chromedriver/lib/chromedriver/ as mentionned in the logs, I find a chromedriver_mac32.zip. Does it mean that an 32bits OSX version is installed ?

djhi avatar Mar 10 '15 09:03 djhi

btw, the logs are a little confusing: Phantom instead of chromedriver wrong copy/paste ;)

djhi avatar Mar 10 '15 09:03 djhi

Sound like the 32 but version could be the issue. What happens if you try to run the chrome driver binary manually from a terminal?

/home/gildas/.meteor/packages/xolvio_webdriver/.0.5.2.1c9pccx++os+web.browser+web.cordova/npm/node_modules/chromedriver/lib/chromedriver/chromedriver

SamHatoum avatar Mar 10 '15 13:03 SamHatoum

I think when someone installs the webdriver package, https://github.com/giggio/node-chromedriver/blob/master/install.js should be executed again but this doesn't happen (the same issue like with the phantomjs npm package). This happens just when you run npm install chromedriver.

ghost avatar Mar 10 '15 14:03 ghost

@samhatoum executing the command returns

cannot execute binary file: Exec format error

@Sanjo You mean that the prb occurs only if I have installed chromedriver with npm ?

djhi avatar Mar 10 '15 14:03 djhi

Oh nice catch. It's because npm runs another script for install which Meteor doesn't do when you include npms.

SamHatoum avatar Mar 10 '15 14:03 SamHatoum

Oh ok, :+1: @Sanjo

djhi avatar Mar 10 '15 14:03 djhi

@djhi try to run node /home/gildas/.meteor/packages/xolvio_webdriver/.0.5.2.1c9pccx++os+web.browser+web.cordova/npm/node_modules/chromedriver/install.js

That might fix it (for now)

SamHatoum avatar Mar 10 '15 14:03 SamHatoum

:+1: it works

djhi avatar Mar 10 '15 14:03 djhi

awesome, I'll get a fix out soon

SamHatoum avatar Mar 10 '15 14:03 SamHatoum

However, it does not run headlessly (which may be normal, I admit I have little knowledge about this)

djhi avatar Mar 10 '15 14:03 djhi

that's correct. chrome driver is intended for either debugging, or if you don't want to run phantom at all. I don't have a good way of making chromedriver headless.

It can be run inside a docker container with some virtual frame buffers, but it wouldn't be an easy meteor add xolvio:webdriver installer.

I'm all open to ideas :)

SamHatoum avatar Mar 10 '15 14:03 SamHatoum

Ok, phantom is good enough anyway and easier to use for CI. Thanks a lot for this package btw :) Really great work. Can't wait for the parallel version!

djhi avatar Mar 10 '15 14:03 djhi

On Linux this may work: https://github.com/Sanjo/meteor-karma/issues/4#issuecomment-73928206

ghost avatar Mar 10 '15 14:03 ghost

@Sanjo nope, this makes chrome fail to start

events.js:72
         throw er; // Unhandled 'error' event
               ^
RuntimeError: RuntimeError
(UnknownError:13) An unknown server-side error occurred while processing the command.
Problem: unknown error: Chrome failed to start: exited abnormally
Driver info: chromedriver=2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf),platform=Linux 3.13.0-45-generic x86_64)

djhi avatar Mar 15 '15 22:03 djhi

Finally found a way to use ChromeDrivrer and not be annoyed with multiple Google Chrome windows openning and stealing focus: I use devilspie and have 2 worspaces set in my Cinnamon. For those interested, here's the devilspie script to save under $HOME/.devilspie/chromedriver.ds

; generated_rule chromedriver
( if 
 ( begin 
    ( contains ( application_name ) "Google Chrome" )
  ) 
  ( begin 
    ( set_workspace 2 )
    ( println "match" )
  )
)

NOTES: For people using xfce: replace set_workspace with set_viewport There is a gnome GUI for devilspie, gdevilspie

PS: It's not perfect:

  • I still loose focus for a second when a new window is started. But the annoyance is very short as it give me back my focus
  • It will apply on all Google chrome windows. I use chromium for web browsing so it's fine for me
  • On very few occasions, I've been switched automatically on the 2nd workspace. Only happened once but it might occurs from time to time.

djhi avatar Mar 17 '15 09:03 djhi