Protractor tests fail on chrome v56 & v57 - chrome not reachable
I run Protractor tests on an Ubuntu 16 server via xvfb. This was working fine with 4.0.14 and google-chrome-stable v54. When I updated to Protractor 5.1.1 (which requires Chrome v55+), and chrome 57 (latest), my tests stopped working, and would timeout with:
[chrome #01-1] WebDriverError: chrome not reachable
[chrome #01-1] (Driver info: chromedriver=2.28.455506 (18f6627e265f442aeec9b6661a49fe819aeeea1f),platform=Linux 4.4.0-67-generic x86_64)
[chrome #01-1] at WebDriverError (./node_modules/selenium-webdriver/lib/error.js:27:5)
[chrome #01-1] at Object.checkLegacyResponse (./node_modules/selenium-webdriver/lib/error.js:505:15)
[chrome #01-1] at parseHttpResponse (./node_modules/selenium-webdriver/lib/http.js:509:13)
[chrome #01-1] at doSend.then.response (./node_modules/selenium-webdriver/lib/http.js:440:13)
[chrome #01-1] at process._tickCallback (internal/process/next_tick.js:103:7)
[chrome #01-1] From: Task: WebDriver.createSession()
[chrome #01-1] at Function.createSession (./node_modules/selenium-webdriver/lib/webdriver.js:777:24)
[chrome #01-1] at Function.createSession (./node_modules/selenium-webdriver/chrome.js:709:29)
[chrome #01-1] at Direct.getNewDriver (./node_modules/protractor/lib/driverProviders/direct.ts:90:25)
[chrome #01-1] at Runner.createBrowser (./node_modules/protractor/lib/runner.ts:225:39)
[chrome #01-1] at q.then.then (./node_modules/protractor/lib/runner.ts:391:27)
[chrome #01-1] at _fulfilled (./node_modules/q/q.js:834:54)
[chrome #01-1] at self.promiseDispatch.done (./node_modules/q/q.js:863:30)
[chrome #01-1] at Promise.promise.promiseDispatch (./node_modules/q/q.js:796:13)
[chrome #01-1] at ./node_modules/q/q.js:556:49
[chrome #01-1] at runSingle (./node_modules/q/q.js:137:13)
Impact:
Does not occur with chrome v54 or v55
Occurs with both directConnect and when specifying the correct seleniumServerJar in config
Occurs with latest Protractor v4x and v5x
Node v6.10.0
Hmm, these issues can be tough to debug; i've seen this happen intermittently on Debian boxes with versions of Chromedriver/Selenium and it's usually fixed by a patch in either of those projects.
There's often nothing that we can do in Protractor core but we can try to remove as many variables as possible. Do you have an example repository that I can use to try and repro on an ubuntu VM? I'm assuming this probably happens regardless of the code, but do you also experience it running the example repo?
Also, what is your exact chrome version?
Yeah, this one was a total pain to debug. This definitely seems like a chrome issue, but wanted to see if maybe this was known, or my brain is just being dumb. I sent it to chrome... so we'll see.
Solution for now is DO NOT UPGRADE CHROME PAST v55 UNDER ANY CIRCUMSTANCE :)
Also... in an unrelated issue... GO BUCKY!!!1!
Sounds good i'll leave this open for a bit to collect any additional information; i'll plan on closing it in a week or so since the resolution needs to be external. Thanks for picking things up with chrome. Go bucky indeed :)

Sweet! (as in 16) Thanks, Nick.
I am also having the same problem on my mac.
@joshuacano (and anyone else) can you post your full specs:
- Protractor Version
- Chrome version (Probably 57 😄 )
- Chromedriver version
- Selenium Standalone version
- Whether or not you can reproduce it with the example
I'm not able to reproduce on OSX
Update web driver for chrome v57
This occurs for me as well, whether I use Xvfb or the new --headless configuration, with
Protractor 5.1.0, Chrome 57.0.2987.110, ChromeDriver 2.28, Selenium 3.3.1.
So I cannot run Protractor at all on a CI server (CodeBuild on Ubuntu 14.04).
So I'm not crazy! Well... about this.
@dinvlad, I was able to run my CI by reverting to Chrome v55, which works with Protractor 5.x.
Interesting, this could be a nix + chrome issue then
~~Actually, looks like Karma is not runnable on that system either.~~ So ~~most~~ probably the nix (I think it's Amazon's own Docker image, to which unfortunately I have no access other than through CI). On Cloud9, which also runs 14.04, both frameworks run fine with the same settings (but only for Xvfb).
Without Xvfb, I was able to run Karma using the '--headless' option for Chrome as well on Cloud9. But Protractor refuses to eat it for some reason (it does run Chrome with that option, but still hangs). That could indicate Protractor's issue.
@qualityshepherd, could you try running Chrome with
--headless --disable-gpu --remote-debugging-port=9222, both in Karma and Protractor configs? Would be interesting to see if that fixes your setup in both cases or either one or not at all. https://github.com/angular/protractor/issues/4146#issuecomment-288870475
@NickTomlin Apologies for not responding earlier. I could not reproduce the problem via the standalone example you gave. I diagnosed the issue and it is related to running an old version of karma with the latest protractor. I had to upgrade karma to get this to work correctly.
So I've got a bit more consistency with this. Karma runs fine for 57 both on what I consider "local" system (Cloud9), even though it's headless, and "remote" (CI on AWS), but only when I use --headless flag instead of Xvfb (which is nice by itself). Alternatively, Karma also runs fine with Xvfb on the "local" system.
However, Protractor fails to run with this flag on either system. I use the same Chrome flags for both frameworks. At this point it appears that either Protractor or ChromeDriver are unable to communicate with Chrome given these flags. Protractor still does run with Xvfb on the "local" system though (a bit of good news).
UPDATE: Got it to work!
According to https://bugs.chromium.org/p/chromedriver/issues/detail?id=878, it's ChromeDriver that doesn't like mixing Chrome's --remote-debugging-port option, because it's connecting over that same port if I understand that correctly. So I've just removed that option from Protractor config, and voila:
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: [
"--headless",
"--disable-gpu"
],
},
},
@qualityshepherd, you might be interested in using this option instead of Xvfb - see if that solves your issues as well. Granted that doesn't address the problem with Xvfb itself, but if we can avoid another tool that's even better, IMO.
Neat! I was not aware of the --headless option. I learned something today! TMYK. Thanks @dinvlad, I'll give it a go.
For others, here's the gist...
[rant] Wasted another day on this today. There is a problem, on linux (ubuntu 16.04), and protractor 5.1.1, and chromedriver 2.28-2.29, and chrome 56+. It does not work and lucky for me, my automation requires it.
Have I mentioned that automation is silly and should be avoided? [/rant]
What's failing?
I'm going to go ahead and close this since it seems to be a chromedriver issue and there's nothing really actionable on the protractor side of things. Sounds like there are a few ongoing threads here that it might be useful to collect even if this issue closes.
It may be worth creating (and then answering) a StackOverflow question about this as "documentation" as well.
Thanks for doing digging and discovery here; y'all are awesome 😄
Yeah, there's some weird stuff going on in chromedriver currently. I can't quite nail down the exact issue. My rant above was a day where my ci build stopped working (likely Codeship change), which was a similar issue to this one. I got it fixed, then the next morning, my fix broke :) Fun times.
I was also seeing funky behavior using the later chromedriver version... which seems to resolve only when backing up to v2.25 (with chrome v55). Which is what I'm running successfully now.
I think there's also an issue whereby Protractor will select the older chromedriver installed (eg. if you had 2.27 & 2.29, i'll use 2.27). Assuming this is not the expected behavior (@NickTomlin?), this is very likely causing some of the random issues people are reporting around the internets.