protractor: 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
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 2
- Comments: 35 (6 by maintainers)
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:@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.
Agreed… I’d love to see all the browsers allow headless runs. I’d love to run Safari at all 🚎
Oh Safari… the new IE6
SOLVED:
I found some time to investigate this, and finally figured it out. Something in Chrome v56+ changed, so that if you’re running it via Protractor (or anything), on a Linux server, as root, it will not start and fail your tests.
Yes, yes… don’t run as root. Whatever. This really sucked because it worked up to v56, and I didn’t see a notice of the change. It also took days to debug and refactor around.
So there you go… the solution is to not run chrome as root. Create a new user to run your tests with. But add them to sudoers so you can start xvfb 😉
FYI guys, --headless is neat but it’s extremely new. It’s only in Chrome 59, which as of this date is still in beta. You might see chromedriver bugs specific to headless or specific to that version of chrome.
Issues like this are most likely not related to Protractor, but to the combination of Selenium Standalone server, chromedriver, and Chrome that you’re using.
Except for cases where Protractor is accidentally using an outdated chromedriver or failing to download it, those are things we can fix. We’ve had some issues with people having a globally installed version of webdriver-manager that was different than their project, which can sometimes cause problems like that.
Interesting, this could be a nix + chrome issue then
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 😄
With latest version of Chrome, Protractor not working. I am just able to load the URL. Further commands like sendleys,getText etc are not working. No error shown in log.
Chrome version: 66 Protractor- 5.3.0 ChromeDriver- 2.38 selenium-server-standalone- 3.12.0
This occurs for me as well, whether I use
Xvfb
or the new--headless
configuration, withProtractor 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).
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 😃