protractor: Running Protractor tests on Webdriver 2.47.1 gets - Error: Server terminated early with status 1

From https://github.com/SeleniumHQ/selenium/issues/1191:

Steps:

  1. Install Protractor 2.5.1 via npm
  2. Update webdriver/chrome: webriver-manager update (installs WebdriverJS 2.47.1)
  3. Run any Protractor test

Results: Two of four people on my team get the error below, and cannot ever run the tests until they downgrade webdriver. It works fine for the other two machines.

Impact:

Downgrading Webdriver to 2.45.0 fixes the problem. This occurs for 1/2 my team, and I found the same issue on StackOverflow

Error:

Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
[launcher] Process exited with error code 1
/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/async/nexttick.js:41
goog.global.setTimeout(function() { throw exception; }, 0);
                                          ^
Error: Server terminated early with status 1
  at Error (native)
  at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/remote/index.js:204:25
  at promise.ControlFlow.runInFrame_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:1857:20)
  at goog.defineClass.notify (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2448:25)
  at promise.Promise.notify_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:564:12)
  at Array.forEach (native)
  at promise.Promise.notifyAll_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:553:15)
  at goog.async.run.processWorkQueue (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/async/run.js:130:15)
  at runMicrotasksCallback (node.js:337:7)
  at process._tickCallback (node.js:355:11)

This is affecting a coworker’s machine, but not my own 😕

Downgrading to webdriver v2.45.0 (i.e. protractor v2.2.0) is not an option for us since we have upgraded to Node.js v4.2.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 32 (4 by maintainers)

Most upvoted comments

add directConnect: true to protractor.conf.js

@chriswong929 didn’t have webdriver-manager running, but installing java through brew cask seems to fix it!

brew update
brew cask install java

Then selenium starts successfully and webdriver opens Chrome as expected.

So, seems to be some incompatibility with the standard OS X Java installation…? Very strange 😕

Turns out not to be a protractor issue though

As suggested in previous post,

brew update
brew cask install java

solved for me.

EDIT: I believe that upgrading java through brew did solve my issue, but there was also an issue with my SOCKS proxy that was preventing a required connection which made it look like this wasn’t the case.

This hasn’t been an issue with the proxy in the past, so I think something has changed somewhere, but it seems pretty unlikely that it is a problem for the protractor team.


I am seeing this issue too, and installing Java via brew does not solve the issue for me.

> webdriver-manager start
selenium.pid: 5724
10:42:45.389 INFO - Launching a standalone Selenium Server
Setting system property webdriver.chrome.driver to /Users/alex/.node/lib/node_modules/webdriver-manager/selenium/chromedriver
10:42:45.431 INFO - Java: Oracle Corporation 25.66-b17
10:42:45.431 INFO - OS: Mac OS X 10.11.1 x86_64
10:42:45.444 INFO - v2.46.0, with Core v2.46.0. Built from revision 87c69e2
10:42:45.525 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform MAC
10:42:45.525 INFO - Driver class not found: com.opera.core.systems.OperaDriver
10:42:45.526 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
10:42:45.609 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
10:42:45.610 INFO - Selenium Server is up and running

Then upon running the supplied bare-bones test above (i.e. opening chrome, navigating to google.com):

10:50:30.389 INFO - Executing: [new session: Capabilities [{browserName=chrome}]])
10:50:30.401 INFO - Creating a new session for Capabilities [{browserName=chrome}]
Starting ChromeDriver 2.19.346063 (38b35413bd4a486d436a9749e090454bc9ff6708) on port 8561
Only local connections are allowed.
10:50:51.185 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'asterix.local', ip: '10.58.9.23', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.1', java.version: '1.8.0_66'
Driver info: driver.version: unknown
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
    at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:183)
    at org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSession.java:119)
    at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:95)
    at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:125)
    at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:58)
    at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:1)
    at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:111)
    at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:175)
    at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:202)
    at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:164)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:130)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
    at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:680)
    at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:571)
    at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
    at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
    at org.openqa.jetty.http.HttpServer.service(HttpServer.java:920)
    at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
    at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
    at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
    at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
    at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:358)
    at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:537)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'asterix.local', ip: '10.58.9.23', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.1', java.version: '1.8.0_66'
Driver info: driver.version: unknown
    at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:113)
    at org.openqa.selenium.remote.server.DefaultDriverProvider.newInstance(DefaultDriverProvider.java:97)
    at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:60)
    at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:222)
    at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:103)
    ... 9 more
Caused by: org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'asterix.local', ip: '10.58.9.23', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.1', java.version: '1.8.0_66'
Driver info: driver.version: ChromeDriver
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:589)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:141)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:138)
    ... 14 more
Caused by: java.lang.IllegalStateException: The process has not exited yet therefore no result is available ...
    at org.apache.commons.exec.DefaultExecuteResultHandler.getException(DefaultExecuteResultHandler.java:76)
    at org.openqa.selenium.os.UnixProcess.checkForError(UnixProcess.java:171)
    at org.openqa.selenium.os.CommandLine.checkForError(CommandLine.java:183)
    at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:169)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:63)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:568)
    ... 19 more
10:50:51.193 WARN - Exception: The process has not exited yet therefore no result is available ...

Unfortunately, not even downgrading to protractor v2.2 appears to solve this for me.

Following steps have resolved issue “Error: Another Selenium process is already running” for me as well, wasted last 2 hours trying to sort this out.

  • First install brew by following command : /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • then run following command ( as suggested by previously by @elliottsj 👍 ): brew cask install java
  • Just confirm java version by following (it should somewhat 1.8.___** ):
java -version

java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)

Thanks a lot guys

@chovy Try brew uninstall --force brew-cask; brew update.

See also Homebrew-Cask README.md / https://github.com/caskroom/homebrew-cask/pull/15381