We are running selenium tests against Chrome 46 on Selenium grid and we got the below error frequently:
Exception in thread "main" org.openqa.selenium.WebDriverException: Error forwarding the new session Error forwarding the request Read timed out
Command duration or timeout: 662.06 seconds
Build info: version: '2.46.0', revision: '61506a4624b13675f24581e453592342b7485d71', time: '2015-06-04 10:22:50'
System info: host: 'IE00079760', ip: '192.168.56.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_17'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:605)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242)
at org.openqa.selenium.remote.RemoteWebDriver.
at org.openqa.selenium.remote.RemoteWebDriver.
at webdriver.WebdriverExample.main(WebdriverExample.java:69)
Caused by: org.openqa.selenium.WebDriverException: Error forwarding the new session Error forwarding the request Read timed out
Build info: version: '2.46.0', revision: '61506a4624b13675f24581e453592342b7485d71', time: '2015-06-04 10:22:50'
System info: host: 'IE00079760', ip: '192.168.56.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_17'
Driver info: driver.version: unknown
at org.openqa.grid.web.servlet.handler.RequestHandler.process(RequestHandler.java:114)
at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:83)
at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:67)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.seleniumhq.jetty7.servlet.ServletHolder.handle(ServletHolder.java:565)
at org.seleniumhq.jetty7.servlet.ServletHandler.doHandle(ServletHandler.java:479)
at org.seleniumhq.jetty7.server.session.SessionHandler.doHandle(SessionHandler.java:225)
at org.seleniumhq.jetty7.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
at org.seleniumhq.jetty7.servlet.ServletHandler.doScope(ServletHandler.java:406)
at org.seleniumhq.jetty7.server.session.SessionHandler.doScope(SessionHandler.java:186)
at org.seleniumhq.jetty7.server.handler.ContextHandler.doScope(ContextHandler.java:965)
at org.seleniumhq.jetty7.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.seleniumhq.jetty7.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.seleniumhq.jetty7.server.Server.handle(Server.java:349)
at org.seleniumhq.jetty7.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
at org.seleniumhq.jetty7.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47)
at org.seleniumhq.jetty7.server.AbstractHttpConnection.content(AbstractHttpConnection.java:894)
at org.seleniumhq.jetty7.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:948)
at org.seleniumhq.jetty7.http.HttpParser.parseNext(HttpParser.java:857)
at org.seleniumhq.jetty7.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.seleniumhq.jetty7.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:66)
at org.seleniumhq.jetty7.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:254)
at org.seleniumhq.jetty7.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
at org.seleniumhq.jetty7.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
at java.lang.Thread.run(Thread.java:745)
Selenium version: 2.47.1
Browser: Google Chrome 46.0.2490.86
Chrome driver version: 2.20
Selenium grid node configuration is:
{
"capabilities":
[
{
"browserName": chrome,
"maxInstances": 5,
"extension.sikuliCapability": True
} ],
"configuration": {
"host":<redacted>,
"port":5555,
"cleanUpCycle":2000,
"timeout":30000,
"register": True,
"registerCycle": 5000,
"browserTimeout":60000,
"hubHost":<redacted>
"hubPort":4444,
"proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession":5,
"registerCycle":5000,
"nodePolling":2000,
"unregisterIfStillDownAfter":60000,
"downPollingLimit":10,
"nodeStatusCheckTimeout":10000,
"servlets":"com.ericsson.taf.selenium.node.sikuli.SikuliExtensionServlet,com.ericsson.taf.selenium.node.upload.FileUploadServlet,com.ericsson.taf.selenium.node.download.FileDownloadServlet"
}
}
We need help to fix this issue, so if anyone get idea about this issue, please leave a comment.
Thanks very much.
Zhao
are there any logs on the node? can you start your node with the -debug and -log
Hi Lukies,
Thanks very much for your reply.
Actually we are using selenium grid extra on our grid, and when this issue happen we can find the following error message in session log:
{
"timestamp": "2015-11-12 16:28:40.698",
"port": "5555",
"host": "141.137.235.209",
"requested_capabilities": {
"platform": "ANY",
"browserName": "chrome",
"version": ""
},
"external_key": "Session b209d08c-d73e-4c35-913a-25e45e9ba2e9, did not get an external key after 120 seconds.\nMore info: {timestamp\u003d2015-11-12 16:28:40.698, port\u003d5555, host\u003d141.137.235.209, requested_capabilities\u003d{platform\u003dANY, browserName\u003dchrome, version\u003d}, external_key\u003dNot Yet Assigned, internal_key\u003db209d08c-d73e-4c35-913a-25e45e9ba2e9}",
"internal_key": "b209d08c-d73e-4c35-913a-25e45e9ba2e9"
}
It looks like there was issue on external_key of the session.
This suggests to me that the browser failed to start on the node, which is why getting the startup logs on the node itself would be good. If you can't get that info with selenium grid extras, then you'll need to log a bug with that project since there's nothing more to go on here for us.
We took off the selenium grid extra from our grid, and start our hub and node with the -debug and -log, then we re-produced this issue and here is the log when this issue happened:
Hub:
15:26:56.103 INFO [1734] org.openqa.grid.web.servlet.handler.RequestHandler - Got a request to create a new session: Capabilities [{platform=LINUX, browserName=chrome, version=}]
15:26:56.104 INFO [9] org.openqa.grid.internal.ProxySet - Available nodes: [http://141.137.235.197:5555]
15:26:56.104 INFO [9] org.openqa.grid.internal.BaseRemoteProxy - Trying to create a new session on node http://141.137.235.197:5555
15:26:56.104 INFO [9] org.openqa.grid.internal.TestSlot - Trying to create a new session on test slot {extension.sikuliCapability=false, platform=LINUX, seleniumProtocol=WebDriver, browserName=chrome, maxInstances=10}
15:26:56.105 DEBUG [1734] org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Closing connections idle longer than 100 MILLISECONDS
15:26:56.105 DEBUG [1734] org.apache.http.client.protocol.RequestAddCookies - CookieSpec selected: default
15:26:56.106 DEBUG [1734] org.apache.http.client.protocol.RequestAuthCache - Auth cache not set in the context
15:26:56.106 DEBUG [1734] org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection request: [route: {}->http://141.137.235.197:5555][total kept alive: 1; route allocated: 2 of 2000; total allocated: 2 of 2000]
15:26:56.106 DEBUG [1734] org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection leased: [id: 118235][route: {}->http://141.137.235.197:5555][total kept alive: 0; route allocated: 2 of 2000; total allocated: 2 of 2000]
15:26:56.106 DEBUG [1734] org.apache.http.impl.execchain.MainClientExec - Stale connection check
15:26:56.107 DEBUG [1734] org.apache.http.wire - http-outgoing-118235 << "[read] I/O error: Read timed out"
15:26:56.108 DEBUG [1734] org.apache.http.impl.execchain.MainClientExec - Executing request POST /wd/hub/session HTTP/1.1
15:26:56.108 DEBUG [1734] org.apache.http.impl.execchain.MainClientExec - Target auth state: UNCHALLENGED
15:26:56.108 DEBUG [1734] org.apache.http.impl.execchain.MainClientExec - Proxy auth state: UNCHALLENGED
15:26:56.108 DEBUG [1734] org.apache.http.headers - http-outgoing-118235 >> POST /wd/hub/session HTTP/1.1
15:26:56.108 DEBUG [1734] org.apache.http.headers - http-outgoing-118235 >> Host: 141.137.235.252:4444
15:26:56.109 DEBUG [1734] org.apache.http.headers - http-outgoing-118235 >> Content-Type: application/json; charset=utf-8
15:26:56.109 DEBUG [1734] org.apache.http.headers - http-outgoing-118235 >> User-Agent: Apache-HttpClient/4.4.1 (Java/1.7.0_17)
15:26:56.109 DEBUG [1734] org.apache.http.headers - http-outgoing-118235 >> Connection: keep-alive
15:26:56.109 DEBUG [1734] org.apache.http.headers - http-outgoing-118235 >> Accept-Encoding: gzip,deflate
15:26:56.109 DEBUG [1734] org.apache.http.headers - http-outgoing-118235 >> Content-Length: 80
15:26:56.109 DEBUG [1734] org.apache.http.wire - http-outgoing-118235 >> "POST /wd/hub/session HTTP/1.1[\r][\n]"
15:26:56.110 DEBUG [1734] org.apache.http.wire - http-outgoing-118235 >> "Host: 141.137.235.252:4444[\r][\n]"
15:26:56.110 DEBUG [1734] org.apache.http.wire - http-outgoing-118235 >> "Content-Type: application/json; charset=utf-8[\r][\n]"
15:26:56.110 DEBUG [1734] org.apache.http.wire - http-outgoing-118235 >> "User-Agent: Apache-HttpClient/4.4.1 (Java/1.7.0_17)[\r][\n]"
15:26:56.110 DEBUG [1734] org.apache.http.wire - http-outgoing-118235 >> "Connection: keep-alive[\r][\n]"
15:26:56.110 DEBUG [1734] org.apache.http.wire - http-outgoing-118235 >> "Accept-Encoding: gzip,deflate[\r][\n]"
15:26:56.111 DEBUG [1734] org.apache.http.wire - http-outgoing-118235 >> "Content-Length: 80[\r][\n]"
15:26:56.111 DEBUG [1734] org.apache.http.wire - http-outgoing-118235 >> "[\r][\n]"
15:26:56.111 DEBUG [1734] org.apache.http.wire - http-outgoing-118235 >> "{"desiredCapabilities":{"platform":"LINUX","browserName":"chrome","version":""}}"
15:37:58.212 DEBUG [1734] org.apache.http.wire - http-outgoing-118235 << "[read] I/O error: Read timed out"
15:37:58.212 DEBUG [1734] org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-118235: Close connection
15:37:58.213 DEBUG [1734] org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-118235: Shutdown connection
15:37:58.213 DEBUG [1734] org.apache.http.impl.execchain.MainClientExec - Connection discarded
15:37:58.213 DEBUG [1734] org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-118235: Close connection
15:37:58.213 DEBUG [1734] org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection released: [id: 118235][route: {}->http://141.137.235.197:5555][total kept alive: 1; route allocated: 1 of 2000; total allocated: 1 of 2000]
Node:
15:26:58.543 INFO [1457] org.openqa.selenium.remote.server.DefaultDriverProvider - Creating a new session for Capabilities [{platform=LINUX, browserName=chrome, version=}]
15:26:58.544 DEBUG [1457] org.openqa.selenium.remote.RemoteWebDriver - Executing: newSession [null, newSession {desiredCapabilities=Capabilities [{platform=LINUX, browserName=chrome, version=}]}]
15:26:58.544 DEBUG [1457] org.openqa.selenium.net.UrlChecker - Waiting for [http://localhost:17490/status]
15:26:58.545 DEBUG [1452] org.openqa.selenium.net.UrlChecker - Polling http://localhost:17490/status
15:26:59.045 DEBUG [1452] org.openqa.selenium.net.UrlChecker - Polling http://localhost:17490/status
15:26:59.046 DEBUG [1452] sun.net.www.protocol.http.HttpURLConnection - sun.net.www.MessageHeader@78a3941a5 pairs: {GET /status HTTP/1.1: null}{User-Agent: Java/1.7.0_79}{Host: localhost:17490}{Accept: text/html, image/gif, image/jpeg, _; q=.2, */_; q=.2}{Connection: keep-alive}
15:26:59.047 DEBUG [1452] sun.net.www.protocol.http.HttpURLConnection - sun.net.www.MessageHeader@3b5074d64 pairs: {null: HTTP/1.1 200 OK}{Content-Length: 141}{Content-Type: application/json; charset=utf-8}{Connection: close}
15:26:59.048 DEBUG [1457] org.apache.http.client.protocol.RequestAddCookies - CookieSpec selected: default
15:26:59.048 DEBUG [1457] org.apache.http.client.protocol.RequestAuthCache - Auth cache not set in the context
15:26:59.048 DEBUG [1457] org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection request: [route: {}->http://localhost:17490][total kept alive: 0; route allocated: 0 of 2000; total allocated: 6 of 2000]
15:26:59.048 DEBUG [1457] org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection leased: [id: 6801][route: {}->http://localhost:17490][total kept alive: 0; route allocated: 1 of 2000; total allocated: 7 of 2000]
15:26:59.048 DEBUG [1457] org.apache.http.impl.execchain.MainClientExec - Opening connection {}->http://localhost:17490
15:26:59.049 DEBUG [1457] org.apache.http.impl.conn.DefaultHttpClientConnectionOperator - Connecting to localhost/127.0.0.1:17490
15:26:59.049 DEBUG [1457] org.apache.http.impl.conn.DefaultHttpClientConnectionOperator - Connection established 127.0.0.1:58848<->127.0.0.1:17490
15:26:59.049 DEBUG [1457] org.apache.http.impl.execchain.MainClientExec - Executing request POST /session HTTP/1.1
15:26:59.049 DEBUG [1457] org.apache.http.impl.execchain.MainClientExec - Target auth state: UNCHALLENGED
15:26:59.049 DEBUG [1457] org.apache.http.impl.execchain.MainClientExec - Proxy auth state: UNCHALLENGED
15:26:59.053 DEBUG [1457] org.apache.http.headers - http-outgoing-6801 >> POST /session HTTP/1.1
15:26:59.053 DEBUG [1457] org.apache.http.headers - http-outgoing-6801 >> Content-Type: application/json; charset=utf-8
15:26:59.053 DEBUG [1457] org.apache.http.headers - http-outgoing-6801 >> Content-Length: 80
15:26:59.054 DEBUG [1457] org.apache.http.headers - http-outgoing-6801 >> Host: localhost:17490
15:26:59.054 DEBUG [1457] org.apache.http.headers - http-outgoing-6801 >> Connection: Keep-Alive
15:26:59.054 DEBUG [1457] org.apache.http.headers - http-outgoing-6801 >> User-Agent: Apache-HttpClient/4.4.1 (Java/1.7.0_79)
15:26:59.054 DEBUG [1457] org.apache.http.headers - http-outgoing-6801 >> Accept-Encoding: gzip,deflate
15:26:59.054 DEBUG [1457] org.apache.http.wire - http-outgoing-6801 >> "POST /session HTTP/1.1[\r][\n]"
15:26:59.054 DEBUG [1457] org.apache.http.wire - http-outgoing-6801 >> "Content-Type: application/json; charset=utf-8[\r][\n]"
15:26:59.054 DEBUG [1457] org.apache.http.wire - http-outgoing-6801 >> "Content-Length: 80[\r][\n]"
15:26:59.054 DEBUG [1457] org.apache.http.wire - http-outgoing-6801 >> "Host: localhost:17490[\r][\n]"
15:26:59.054 DEBUG [1457] org.apache.http.wire - http-outgoing-6801 >> "Connection: Keep-Alive[\r][\n]"
15:26:59.054 DEBUG [1457] org.apache.http.wire - http-outgoing-6801 >> "User-Agent: Apache-HttpClient/4.4.1 (Java/1.7.0_79)[\r][\n]"
15:26:59.055 DEBUG [1457] org.apache.http.wire - http-outgoing-6801 >> "Accept-Encoding: gzip,deflate[\r][\n]"
15:26:59.055 DEBUG [1457] org.apache.http.wire - http-outgoing-6801 >> "[\r][\n]"
15:26:59.055 DEBUG [1457] org.apache.http.wire - http-outgoing-6801 >> "{"desiredCapabilities":{"platform":"LINUX","browserName":"chrome","version":""}}"
From debug log on the hub, we found I/O error "DEBUG [1734] org.apache.http.wire - http-outgoing-118235 << "[read] I/O error: Read timed out" during this issue happened.
Do you have any idea about this error?
Thanks very much.
Zhao
I'm seeing the same intermittent error. I'm continuing to investigate to see if I can nail down a more precise set of repro steps.
One observation I will note is I see the error logged by the grid server but my tests don't encounter the session error until about a minute later. This is complete conjecture, but it makes me think a thread is getting into a bad state and then the next time that thread is used the process of setting up the session fails.
I'll post more if I find anything. Thanks.
Did you find anything else?
I am having this same issue sometimes on my tests, using selenium grid 2.53 (latest version).
07:05:25.603 [chrome #01-5] PID: 44505
07:05:25.603 [chrome #01-5] Specs: /var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/mock-tests/tests/account/desktop/my-profile-page-add-change-username-0-4-spec.js
07:05:25.603 [chrome #01-5]
07:05:25.603 [chrome #01-5] Using the selenium server at http://10.216.1.49:4444/wd/hub
07:05:25.603 [chrome #01-5]
07:05:25.603 [chrome #01-5] /var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/selenium-webdriver/error.js:26
07:05:25.603 [chrome #01-5] constructor(opt_error) {
07:05:25.603 [chrome #01-5] ^
07:05:25.603 [chrome #01-5] WebDriverError: Error forwarding the new session Error forwarding the request Read timed out
07:05:25.603 [chrome #01-5] at WebDriverError (/var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/selenium-webdriver/error.js:26:26)
07:05:25.604 [chrome #01-5] at Object.checkLegacyResponse (/var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/selenium-webdriver/error.js:580:13)
07:05:25.604 [chrome #01-5] at /var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/selenium-webdriver/lib/webdriver.js:64:13
07:05:25.604 [chrome #01-5] at Promise.invokeCallback_ (/var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/selenium-webdriver/lib/promise.js:1329:14)
07:05:25.604 [chrome #01-5] at TaskQueue.execute_ (/var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/selenium-webdriver/lib/promise.js:2790:14)
07:05:25.604 [chrome #01-5] at TaskQueue.executeNext_ (/var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/selenium-webdriver/lib/promise.js:2773:21)
07:05:25.604 [chrome #01-5] at /var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/selenium-webdriver/lib/promise.js:2652:27
07:05:25.604 [chrome #01-5] at /var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/selenium-webdriver/lib/promise.js:639:7
07:05:25.604 [chrome #01-5] at process._tickCallback (node.js:405:9)
07:05:25.604 [chrome #01-5] From: Task: WebDriver.createSession()
07:05:25.604 [chrome #01-5] at acquireSession (/var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/selenium-webdriver/lib/webdriver.js:62:22)
07:05:25.604 [chrome #01-5] at Function.createSession (/var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/selenium-webdriver/lib/webdriver.js:295:12)
07:05:25.604 [chrome #01-5] at Builder.build (/var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/selenium-webdriver/builder.js:458:24)
07:05:25.604 [chrome #01-5] at [object Object].DriverProvider.getNewDriver (/var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/protractor/built/driverProviders/driverProvider.js:42:27)
07:05:25.604 [chrome #01-5] at [object Object].Runner.createBrowser (/var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/protractor/built/runner.js:203:37)
07:05:25.604 [chrome #01-5] at /var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/protractor/built/runner.js:293:21
07:05:25.604 [chrome #01-5] at _fulfilled (/var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/q/q.js:834:54)
07:05:25.605 [chrome #01-5] at self.promiseDispatch.done (/var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/q/q.js:863:30)
07:05:25.605 [chrome #01-5] at Promise.promise.promiseDispatch (/var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/q/q.js:796:13)
07:05:25.605 [chrome #01-5] at /var/lib/go-agent-2/pipelines/FrontEnd-TVG4-Dev/workspace/tvg-tvg4-angular/tests/web-tests/node_modules/q/q.js:556:49
Hi, I have exactly same problem with grid 2.53
Caused by: org.openqa.selenium.WebDriverException: Error forwarding the new session Error forwarding the request Read timed out
It looks like chrome browser didn't started
it happens for 5-10 tests each iteration
Same issue here. Tests randomly fail with error:
06:01:33 [1;31mError retrieving a new session from the selenium server[0m
06:01:33 { status: [33m13[39m,
06:01:33 value:
06:01:33 { message: [32m'Error forwarding the new session Error forwarding the request Read timed out'[39m,
06:01:33 class: [32m'org.openqa.grid.common.exception.GridException'[39m } }
06:01:33
06:01:33 [0;31m
06:01:33 Connection refused! Is selenium server started?
Hub is on Linux, Node is on Windows 7, using Chrome browser. Tests ran with Jenkins.
I have exactly the same VM, (same RAM setup, etc), but Windows 10 and it's working perfectly. Also I didn't test it yet, but I'm sure that previous version of selenium server (or _browser drivers_) worked properly on Windows 7. I'm guessing that it's some regression after going to 2.50+. I will test it with 2.49 on my Win7 and if that doesn't help, I will try to test on older browser drivers and report back to you. Cheers!
Same error ... started when I added another nod with another chrome driver ... so there are 2 x nodes that register chrome driver on the grid.
org.openqa.selenium.WebDriverException: Error forwarding the new session Error forwarding the request Read timed out
Command duration or timeout: 134.52 seconds
Build info: version: '2.52.0', revision: '4c2593cfc3689a7fcd7be52549167e5ccc93ad28', time: '2016-02-11 11:22:43'
System info: host: 'USB-ETBUILD5', ip: '10.43.40.103', os.name: 'Windows Server 2012 R2', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_91'
Driver info: com.englishtown.driver.ChromeRemoteWebDriver
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:308)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:385)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:118)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)
at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.springTestContextPrepareTestInstance(AbstractTestNGSpringContextTests.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:514)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:215)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:178)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:782)
at org.testng.TestRunner.run(TestRunner.java:632)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
at org.testng.SuiteRunner.run(SuiteRunner.java:268)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
at org.testng.TestNG.run(TestNG.java:1064)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:132)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeSingleClass(TestNGDirectoryTestSuite.java:112)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:99)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:147)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Hi,
Same issue with Selenium 2.49, 2.50, 3.0 Beta2 and Chromdriver 2.22, on Debian 8 (for all nodes/hub).
14:36:10.573 DEBUG [20] org.apache.http.wire - http-outgoing-0 << "[read] I/O error: Read timed out"
yeah... still same issue... Actually we did workaround, we just
catch WebDriverException during driver = initBrowser(); and if it appear we just trying to do it few times more... but it still takes extra time because when it happen it takes ~600 sec :(
I am seeing this when using remote driver with no grid...just a local client. It happens randomly in the lab.
[20:01:48][com.contoso.app:app-web-ui-test] 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.
[20:01:48][com.contoso.app:app-web-ui-test] Build info: version: '2.52.0', revision: '4c2593cfc3689a7fcd7be52549167e5ccc93ad28', time: '2016-02-11 11:22:43'
[20:01:48][com.contoso.app:app-web-ui-test] System info: host: 'dvbldpm007', ip: '10.240.7.110', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.3', java.version: '1.8.0_65'
[20:01:48][com.contoso.app:app-web-ui-test] Driver info: driver.version: ChromeDriver
[20:01:48][com.contoso.app:app-web-ui-test] at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:665) ~[selenium-remote-driver-2.52.0.jar:na]
[20:01:48][com.contoso.app:app-web-ui-test] at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249) ~[selenium-remote-driver-2.52.0.jar:na]
[20:01:48][com.contoso.app:app-web-ui-test] at org.openqa.selenium.remote.RemoteWebDriver.
[20:01:48][com.contoso.app:app-web-ui-test] at org.openqa.selenium.remote.RemoteWebDriver.
[20:01:48][com.contoso.app:app-web-ui-test] at org.openqa.selenium.chrome.ChromeDriver.
[20:01:48][com.contoso.app:app-web-ui-test] at org.openqa.selenium.chrome.ChromeDriver.
[20:01:48][com.contoso.app:app-web-ui-test] at com.contososoftware.test.server.vizportalUILib.utils.ElectronBrowser.prepareDriver(ElectronBrowser.java:53) ~[app-web-ui-lib-1.0-SNAPSHOT.jar:na]
[20:01:48][com.contoso.app:app-web-ui-test] at com.contososoftware.test.server.vizportalUILib.utils.BrowserBase.
[20:01:48][com.contoso.app:app-web-ui-test] at com.contososoftware.test.server.vizportalUILib.utils.ChromeBrowser.
[20:01:48][com.contoso.app:app-web-ui-test] at com.contososoftware.test.server.vizportalUILib.utils.ElectronBrowser.
[20:01:48][com.contoso.app:app-web-ui-test] at com.contososoftware.test.server.vizportalUILib.utils.BrowserFactory.create(BrowserFactory.java:69) ~[app-web-ui-lib-1.0-SNAPSHOT.jar:na]
[20:01:48][com.contoso.app:app-web-ui-test] at com.contososoftware.test.server.vizportalUILib.utils.WebDriverInstance.registerBrowser(WebDriverInstance.java:53) ~[app-web-ui-lib-1.0-SNAPSHOT.jar:na]
[20:01:48][com.contoso.app:app-web-ui-test] at com.contososoftware.test.server.vizportalUILib.utils.WebDriverInstance.registerAndActivateBrowser(WebDriverInstance.java:69) ~[app-web-ui-lib-1.0-SNAPSHOT.jar:na]
[20:01:48][com.contoso.app:app-web-ui-test] at com.contoso.app.test.webuilib.app.appDesktopApp.getBrowser(appDesktopApp.java:269) [app-web-ui-lib-1.0-SNAPSHOT.jar:na]
[20:01:48][com.contoso.app:app-web-ui-test] at com.contoso.app.test.webuilib.app.appDesktopApp.waitForAppToStart(appDesktopApp.java:153) [app-web-ui-lib-1.0-SNAPSHOT.jar:na]
[20:01:48][com.contoso.app:app-web-ui-test] at com.contoso.app.test.webuilib.app.appDesktopApp.start(appDesktopApp.java:111) [app-web-ui-lib-1.0-SNAPSHOT.jar:na]
[20:01:48][com.contoso.app:app-web-ui-test] at com.contoso.app.test.webuilib.app.appAppManager.startApplication(appAppManager.java:57) [app-web-ui-lib-1.0-SNAPSHOT.jar:na]
[20:01:48][com.contoso.app:app-web-ui-test] at com.contoso.app.test.DesktopTestE2E.testSetup(DesktopTestE2E.java:55) [test-classes/:na]
[20:01:48][com.contoso.app:app-web-ui-test] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_65]
[20:01:48][com.contoso.app:app-web-ui-test] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_65]
[20:01:48][com.contoso.app:app-web-ui-test] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_65]
[20:01:48][com.contoso.app:app-web-ui-test] at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_65]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at com.contoso.app.test.testrules.ScreenShotRule$1.evaluate(ScreenShotRule.java:28) [test-classes/:na]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.rules.RunRules.evaluate(RunRules.java:20) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.Suite.runChild(Suite.java:128) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.Suite.runChild(Suite.java:27) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367) [surefire-junit4-2.19.1.jar:2.19.1]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274) [surefire-junit4-2.19.1.jar:2.19.1]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238) [surefire-junit4-2.19.1.jar:2.19.1]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161) [surefire-junit4-2.19.1.jar:2.19.1]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290) [surefire-booter-2.19.1.jar:2.19.1]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242) [surefire-booter-2.19.1.jar:2.19.1]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121) [surefire-booter-2.19.1.jar:2.19.1]
[20:01:48][com.contoso.app:app-web-ui-test] Caused by: org.openqa.selenium.WebDriverException: java.net.SocketTimeoutException: Read timed out
[20:01:48][com.contoso.app:app-web-ui-test] Build info: version: '2.52.0', revision: '4c2593cfc3689a7fcd7be52549167e5ccc93ad28', time: '2016-02-11 11:22:43'
[20:01:48][com.contoso.app:app-web-ui-test] System info: host: 'dvbldpm007', ip: '10.240.7.110', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.3', java.version: '1.8.0_65'
[20:01:48][com.contoso.app:app-web-ui-test] Driver info: driver.version: ChromeDriver
[20:01:48][com.contoso.app:app-web-ui-test] at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:91) ~[selenium-remote-driver-2.52.0.jar:na]
[20:01:48][com.contoso.app:app-web-ui-test] at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:644) ~[selenium-remote-driver-2.52.0.jar:na]
[20:01:48][com.contoso.app:app-web-ui-test] ... 54 common frames omitted
[20:01:48][com.contoso.app:app-web-ui-test] Caused by: java.net.SocketTimeoutException: Read timed out
[20:01:48][com.contoso.app:app-web-ui-test] at java.net.SocketInputStream.socketRead0(Native Method) ~[na:1.8.0_65]
[20:01:48][com.contoso.app:app-web-ui-test] at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) ~[na:1.8.0_65]
[20:01:48][com.contoso.app:app-web-ui-test] at java.net.SocketInputStream.read(SocketInputStream.java:170) ~[na:1.8.0_65]
[20:01:48][com.contoso.app:app-web-ui-test] at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[na:1.8.0_65]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.http.impl.conn.LoggingInputStream.read(LoggingInputStream.java:87) ~[httpclient-4.5.1.jar:4.5.1]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:139) ~[httpcore-4.4.3.jar:4.4.3]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:155) ~[httpcore-4.4.3.jar:4.4.3]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:284) ~[httpcore-4.4.3.jar:4.4.3]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:140) ~[httpclient-4.5.1.jar:4.5.1]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57) ~[httpclient-4.5.1.jar:4.5.1]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:261) ~[httpcore-4.4.3.jar:4.4.3]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:165) ~[httpcore-4.4.3.jar:4.4.3]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:167) ~[httpclient-4.5.1.jar:4.5.1]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:272) ~[httpcore-4.4.3.jar:4.4.3]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:124) ~[httpcore-4.4.3.jar:4.4.3]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:271) ~[httpclient-4.5.1.jar:4.5.1]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184) ~[httpclient-4.5.1.jar:4.5.1]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88) ~[httpclient-4.5.1.jar:4.5.1]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) ~[httpclient-4.5.1.jar:4.5.1]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) ~[httpclient-4.5.1.jar:4.5.1]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71) ~[httpclient-4.5.1.jar:4.5.1]
[20:01:48][com.contoso.app:app-web-ui-test] at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55) ~[httpclient-4.5.1.jar:4.5.1]
[20:01:48][com.contoso.app:app-web-ui-test] at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:144) ~[selenium-remote-driver-2.52.0.jar:na]
[20:01:48][com.contoso.app:app-web-ui-test] at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:90) ~[selenium-remote-driver-2.52.0.jar:na]
[20:01:48][com.contoso.app:app-web-ui-test] at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142) ~[selenium-remote-driver-2.52.0.jar:na]
[20:01:48][com.contoso.app:app-web-ui-test] at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82) ~[selenium-remote-driver-2.52.0.jar:na]
[20:01:48][com.contoso.app:app-web-ui-test] ... 55 common frames omitted
The same problem
12:04:41 Error: Error forwarding the new session Error forwarding the request Connect to *******:5677 [*******/*******] failed: Connection refused
12:04:41
I see the same issue. Can reproduce it with the following steps:
See the error...
I have this defect for a long time (webdriver 2.53.1). Here is a workaround, retry it in several times:
final RemoteWebDriver[] rwd = new RemoteWebDriver[1];
new WebDriverActionExecutor().execute(new IWebDriverAction() {
@Override
public void execute() {
rwd[0] = new RemoteWebDriver(addressOfRemoteServer, capabilities);
}
});
public interface IWebDriverAction {
/**
* execute webdriver action immediately
*/
public void execute();
}
import org.openqa.selenium.WebDriverException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Created by Kenny Wang on 8/22/2016.
* for resolving UnreachableBrowserException by retry last operation
*/
public class WebDriverActionExecutor {
private final Logger logger = LoggerFactory.getLogger(WebDriverActionExecutor.class);
private int max_retry_times;
public WebDriverActionExecutor() {
this(3);
}
public WebDriverActionExecutor(int max_retry_times) {
this.max_retry_times = max_retry_times;
}
public void execute(IWebDriverAction action) {
execute(action, WebDriverException.class);
}
/**
* @param action
* @param exceptionType any exception such as UnreachableBrowserException, TimeoutException, WebDriverException
* @param <T>
*/
public <T extends Exception> void execute(IWebDriverAction action, Class<T> exceptionType) {
execute(action, 0, exceptionType);
}
private <T extends Exception> void execute(IWebDriverAction action, int retries, Class<T> exceptionType) {
if (retries > max_retry_times) {
throw new RuntimeException("exceed retry times");
} else {
if (retries > 0) {
logger.warn("{} occurred, retry {}", exceptionType.getName(), retries);
}
try {
action.execute();
} catch (Exception e) {
if (exceptionType.isInstance(e)) {
execute(action, ++retries, exceptionType);
} else {
throw new RuntimeException(e);
}
}
}
}
}
hello, am getting this same problem. Hoping this issue is being resolved soon.
Debug logs from the failing node below
- `13:43:19.403 DEBUG - Handling: GET /status
- 13:43:19.403 DEBUG - Executing: org.openqa.selenium.remote.server.handler.Status@2e7b4534)
- 13:43:19.403 DEBUG - Done: org.openqa.selenium.remote.server.handler.Status@2e7b4534
- 13:43:19.403 DEBUG - Finished: GET /status
- 13:43:19.785 DEBUG - CookieSpec selected: default
- 13:43:19.785 DEBUG - Auth cache not set in the context
- 13:43:19.785 DEBUG - Connection request: [route: {}->http://hub.qagrid.xxxx:4444][total kept alive: 1; route allocated: 2 of 2000; total allocated: 2 of 2000]
- 13:43:19.786 DEBUG - http-outgoing-1 << "[read] I/O error: Read timed out"
- 13:43:19.786 DEBUG - Connection leased: [id: 1][route: {}->http://hub.qagrid.rgp.test-gs.com:4444][total kept alive: 0; route allocated: 2 of 2000; total allocated: 2 of 2000]
- 13:43:19.786 DEBUG - Stale connection check
- 13:43:19.788 DEBUG - http-outgoing-1 << "[read] I/O error: Read timed out"
- 13:43:19.788 DEBUG - http-outgoing-1: set socket timeout to 10800000
- 13:43:19.788 DEBUG - Executing request GET /grid/api/proxy?id=http://node1.qagrid.xxx:5555 HTTP/1.1
- 13:43:19.788 DEBUG - Target auth state: UNCHALLENGED
- 13:43:19.788 DEBUG - Proxy auth state: UNCHALLENGED
- 13:43:19.788 DEBUG - http-outgoing-1 >> GET /grid/api/proxy?id=http://node1.qagrid.xxxx:5555 HTTP/1.1
- 13:43:19.788 DEBUG - http-outgoing-1 >> Host: hub.qagrid.xxxx:4444
- 13:43:19.788 DEBUG - http-outgoing-1 >> Connection: Keep-Alive
- 13:43:19.788 DEBUG - http-outgoing-1 >> User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_121)
- 13:43:19.788 DEBUG - http-outgoing-1 >> Accept-Encoding: gzip,deflate
- 13:43:19.789 DEBUG - http-outgoing-1 >> "GET /grid/api/proxy?id=http://node1.qagrid.xxx:5555 HTTP/1.1[\r][\n]"
- 13:43:19.789 DEBUG - http-outgoing-1 >> "Host: hub.qagrid.xxx:4444[\r][\n]"
- 13:43:19.789 DEBUG - http-outgoing-1 >> "Connection: Keep-Alive[\r][\n]"
- 13:43:19.789 DEBUG - http-outgoing-1 >> "User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_121)[\r][\n]"
- 13:43:19.789 DEBUG - http-outgoing-1 >> "Accept-Encoding: gzip,deflate[\r][\n]"
- 13:43:19.789 DEBUG - http-outgoing-1 >> "[\r][\n]"
- 13:43:19.791 DEBUG - http-outgoing-1 << "HTTP/1.1 200 OK[\r][\n]"
- 13:43:19.791 DEBUG - http-outgoing-1 << "Date: Mon, 06 Mar 2017 13:43:18 GMT[\r][\n]"
- 13:43:19.792 DEBUG - http-outgoing-1 << "Content-Type: application/json; charset=UTF-8[\r][\n]"
- 13:43:19.792 DEBUG - http-outgoing-1 << "Content-Length: 927[\r][\n]"
- 13:43:19.792 DEBUG - http-outgoing-1 << "Server: Jetty(9.2.15.v20160210)[\r][\n]"
- 13:43:19.792 DEBUG - http-outgoing-1 << "[\r][\n]"
- 13:43:19.792 DEBUG - http-outgoing-1 << "{"success":true,"msg":"proxy found !","id":"http://node1.qagrid.rgp.test-gs.com:5555","request":{"class":"org.openqa.grid.common.RegistrationRequest","name":null,"description":null,"configuration":{"hubHost":"hub.qagrid.rgp.test-gs.com","hubPort":4444,"id":"http://node1.qagrid.xxxx:5555","capabilities":[{"browserName":"chrome","seleniumProtocol":"WebDriver","maxInstances":10,"version":"56.0.2924.87","platform":"LINUX"}],"downPollingLimit":2,"hub":"http://hub.qagridxxx:4444/grid/register","nodePolling":5000,"nodeStatusCheckTimeout":5000,"proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy","register":true,"registerCycle":5000,"unregisterIfStillDownAfter":60000,"cleanUpCycle":null,"custom":{},"host":"node1.qagrid.rgp.test-gs.com","maxSession":10,"servlets":[],"withoutServlets":[],"browserTimeout":0,"debug":false,"jettyMaxThreads":null,"log":null,"port":5555,"role":"node","timeout":30}}}"
- 13:43:19.792 DEBUG - http-outgoing-1 << HTTP/1.1 200 OK
- 13:43:19.792 DEBUG - http-outgoing-1 << Date: Mon, 06 Mar 2017 13:43:18 GMT
- 13:43:19.792 DEBUG - http-outgoing-1 << Content-Type: application/json; charset=UTF-8
- 13:43:19.792 DEBUG - http-outgoing-1 << Content-Length: 927
- 13:43:19.792 DEBUG - http-outgoing-1 << Server: Jetty(9.2.15.v20160210)
- 13:43:19.792 DEBUG - Connection can be kept alive indefinitely
- 13:43:19.793 DEBUG - Connection [id: 1][route: {}->http://hub.qagrid.xxx:4444] can be kept alive indefinitely
- 13:43:19.793 DEBUG - Connection released: [id: 1][route: {}->http://hub.qagrid.xxx:4444][total kept alive: 1; route allocated: 2 of 2000; total allocated: 2 of 2000]
- 13:43:19.793 DEBUG - The node is already present on the hub. Skipping registration.`
The combination of /dev/urandom:/dev/random and browserTimeOut property value (now set to 45) has helped me fix this issue in my tests.
Reference: http://stackoverflow.com/questions/26021181/not-enough-entropy-to-support-dev-random-in-docker-containers-running-in-boot2d
This is still happening for me
Please take a look at http://stackoverflow.com/questions/43394478/selenium-nodes-are-getting-reconnected-to-hub
Still happening with 3.4 - makes frequent test execution with Chrome impossible.
DEBUG - http-outgoing-1 << "[read] I/O error: Read timed out" is just a debug message, you can ignore it. Apache HttpClient attempts to reuse existing connections, and before using a connection it checks its aliveness.
WebDriverException: Error forwarding the new session means that the selected node could not handle new session request, must probably it could not start browser. But no one of the comment in this issue provide enough info to understand why this happens.
Taking into account the fact that both Grid and the drivers evolved, I'm closing this issue as "can't reproduce". If someone hits "Error forwarding the new session" again please raise a new issue with uptodate logs.
Hello! This issue is still happening and still random.
For node-chrome:3.9.1
Caused by: org.openqa.selenium.WebDriverException: Error forwarding the new session new session request for webdriver should contain a location header or an 'application/json;charset=UTF-8' response body with the session ID.
Command duration or timeout: 600.01 seconds
Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:01:39.354Z'
System info: host: '77b6ec99110a', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.43-17.38.amzn1.x86_64', java.version: '1.8.0_141'
Driver info: driver.version: DisposableWebDriver
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:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:123)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:600)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
at org.openqa.selenium.remote.RemoteWebDriver.
at org.openqa.selenium.remote.RemoteWebDriver.
at com.XXXX. MYXXXX.common.utils.DisposableWebDriver.createWebDriver(DisposableWebDriver.java:45)
... 41 more
Caused by: org.openqa.grid.common.exception.GridException: Error forwarding the new session new session request for webdriver should contain a location header or an 'application/json;charset=UTF-8' response body with the session ID.
at org.openqa.grid.web.servlet.handler.RequestHandler.process(RequestHandler.java:117)
at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:84)
at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:841)
at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:535)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.seleniumhq.jetty9.server.Server.handle(Server.java:564)
at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:317)
at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:251)
at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:110)
at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.seleniumhq.jetty9.util.thread.Invocable.invokePreferred(Invocable.java:128)
at org.seleniumhq.jetty9.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
... 1 more
We are seeing this issue as well.
3.9.1 here

@barancev should we open a new issue? seems a few of us are having this with 3.9.1
@barancev I have the same issue with 3.9.1 Node Windows 10 Hub Linux CentOS7
org.openqa.selenium.WebDriverException: Error forwarding the new session Request timed out waiting for a node to become available.
Command duration or timeout: 90.00 seconds
Build info: version: '3.9.1', revision: '63f7b50', time: '2018-02-07T22:25:02.294Z'
os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-327.36.3.el7.x86_64', java.version: '1.8.0_101'
Driver info: driver.version: RemoteWebDriver
at sun.reflect.GeneratedConstructorAccessor81.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:123)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:138)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
at org.openqa.selenium.remote.RemoteWebDriver.
at org.openqa.selenium.remote.RemoteWebDriver.
at com.defensative.framework.web.config.Settings.getDriver(Settings.java:302)
at com.defensative.framework.web.config.Settings.getDriver(Settings.java:230)
at com.defensative.framework.adapters.TestSessionListener.onTestStart(TestSessionListener.java:81)
at org.testng.internal.Invoker.runTestListeners(Invoker.java:1739)
at org.testng.internal.Invoker.runTestListeners(Invoker.java:1714)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:640)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
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: org.openqa.grid.common.exception.GridException: Error forwarding the new session Request timed out waiting for a node to become available.
at org.openqa.grid.web.servlet.handler.RequestHandler.process(RequestHandler.java:117)
at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:84)
at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:860)
at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:535)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.seleniumhq.jetty9.server.Server.handle(Server.java:530)
at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:347)
at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:256)
at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.seleniumhq.jetty9.io.FillInterest.fillable(FillInterest.java:102)
at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at org.seleniumhq.jetty9.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
... 1 more
Hello! This issue is still happening
WebDriverError: Error forwarding the new session Error forwarding the request Read timed out
at Object.checkLegacyResponse.
details config:
chromedriver :2.35
Node.js 8.9 version
selenium grid 3.9.1 with 2 node for automation.
Please help me
Just encountered the same error with Selenium 3.12
Still encounter this issue randomly when I run my test using selenium grid....
File "/usr/local/lib/python3.6/site-packages/selenium-3.14.1-py3.6.egg/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python3.6/site-packages/selenium-3.14.1-py3.6.egg/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python3.6/site-packages/selenium-3.14.1-py3.6.egg/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.6/site-packages/selenium-3.14.1-py3.6.egg/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Error forwarding the new session Error forwarding the request unexpected end of stream on Connection{192.168.144.7:40003, proxy=DIRECT hostAddress=/192.168.144.7:40003 cipherSuite=none protocol=http/1.1}
Stacktrace:
at org.openqa.grid.web.servlet.handler.RequestHandler.process (RequestHandler.java:118)
at org.openqa.grid.web.servlet.DriverServlet.process (DriverServlet.java:85)
at org.openqa.grid.web.servlet.DriverServlet.doPost (DriverServlet.java:69)
at javax.servlet.http.HttpServlet.service (HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service (HttpServlet.java:790)
at org.seleniumhq.jetty9.servlet.ServletHolder.handle (ServletHolder.java:860)
at org.seleniumhq.jetty9.servlet.ServletHandler$CachedChain.doFilter (ServletHandler.java:1650)
at io.prometheus.client.filter.MetricsFilter.doFilter (MetricsFilter.java:170)
at org.seleniumhq.jetty9.servlet.ServletHandler$CachedChain.doFilter (ServletHandler.java:1637)
at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle (ServletHandler.java:533)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle (ScopedHandler.java:143)
at org.seleniumhq.jetty9.security.SecurityHandler.handle (SecurityHandler.java:548)
at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle (HandlerWrapper.java:132)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle (ScopedHandler.java:190)
at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle (SessionHandler.java:1595)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle (ScopedHandler.java:188)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle (ContextHandler.java:1253)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope (ScopedHandler.java:168)
at org.seleniumhq.jetty9.servlet.ServletHandler.doScope (ServletHandler.java:473)
at org.seleniumhq.jetty9.server.session.SessionHandler.doScope (SessionHandler.java:1564)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope (ScopedHandler.java:166)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope (ContextHandler.java:1155)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle (ScopedHandler.java:141)
at org.seleniumhq.jetty9.server.handler.StatisticsHandler.handle (StatisticsHandler.java:169)
at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle (HandlerWrapper.java:132)
at org.seleniumhq.jetty9.server.Server.handle (Server.java:530)
at org.seleniumhq.jetty9.server.HttpChannel.handle (HttpChannel.java:347)
at org.seleniumhq.jetty9.server.HttpConnection.onFillable (HttpConnection.java:256)
at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded (AbstractConnection.java:279)
at org.seleniumhq.jetty9.io.FillInterest.fillable (FillInterest.java:102)
at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run (ChannelEndPoint.java:124)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce (EatWhatYouKill.java:247)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.produce (EatWhatYouKill.java:140)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run (EatWhatYouKill.java:131)
at org.seleniumhq.jetty9.util.thread.ReservedThreadExecutor$ReservedThread.run (ReservedThreadExecutor.java:382)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob (QueuedThreadPool.java:708)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run (QueuedThreadPool.java:626)
at java.lang.Thread.run (Thread.java:748)
I am also having the same issue with Selenium Grid with Chrome node hosted on Linux (Openshift)
Selenium version: '3.14.0'
Starting Selenium Hub with configuration:
{
"host": "0.0.0.0",
"port": 4444,
"role": "hub",
"maxSession": 3,
"newSessionWaitTimeout": 30,
"capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
"throwOnCapabilityNotPresent": true,
"jettyMaxThreads": 100,
"cleanUpCycle": 300,
"browserTimeout": 30,
"timeout": 300,
"debug": true
}
Here are the chrome capabilities
: {
"class": "org.openqa.grid.common.RegistrationRequest",
"configuration": {
"browserTimeout": 0,
"capabilities": [
{
"applicationName": "",
"browserName": "chrome",
"maxInstances": 5,
"platform": "LINUX",
"platformName": "LINUX",
"seleniumProtocol": "WebDriver",
"server:CONFIG_UUID": "2be46ca5-834a-4587-a46f-d1ad7a3e4201",
"version": "69.0.3497.100"
}
],
"custom": {
},
"debug": false,
"downPollingLimit": 2,
"enablePlatformVerification": true,
"host": "100.78.7.170",
"hub": "http:\u002f\u002fselenium-hub:4444\u002fgrid\u002fregister",
"id": "http:\u002f\u002f100.78.7.170:5555",
"maxSession": 1,
"nodePolling": 5000,
"nodeStatusCheckTimeout": 5000,
"port": 5555,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"register": true,
"registerCycle": 5000,
"remoteHost": "http:\u002f\u002f100.78.7.170:5555",
"role": "node",
"servlets": [
],
"timeout": 1800,
"unregisterIfStillDownAfter": 60000,
"withoutServlets": [
]
},
"description": null,
"name": null
}
23:47:05.416 DEBUG [RegistrationServlet.process] - getting the following registration request
Error StackTrace
File "/opt/app-root/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 156, in __init__
self.start_session(capabilities, browser_profile)
File "/opt/app-root/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 251, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/opt/app-root/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 320, in execute
self.error_handler.check_response(response)
File "/opt/app-root/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Error forwarding the new session Request timed out waiting for a node to become available.
Stacktrace:
at org.openqa.grid.web.servlet.handler.RequestHandler.process (RequestHandler.java:118)
at org.openqa.grid.web.servlet.DriverServlet.process (DriverServlet.java:85)
at org.openqa.grid.web.servlet.DriverServlet.doPost (DriverServlet.java:69)
at javax.servlet.http.HttpServlet.service (HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service (HttpServlet.java:790)
at org.seleniumhq.jetty9.servlet.ServletHolder.handle (ServletHolder.java:860)
at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle (ServletHandler.java:535)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle (ScopedHandler.java:143)
at org.seleniumhq.jetty9.security.SecurityHandler.handle (SecurityHandler.java:548)
at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle (HandlerWrapper.java:132)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle (ScopedHandler.java:190)
at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle (SessionHandler.java:1595)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextHandle (ScopedHandler.java:188)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle (ContextHandler.java:1253)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope (ScopedHandler.java:168)
at org.seleniumhq.jetty9.servlet.ServletHandler.doScope (ServletHandler.java:473)
at org.seleniumhq.jetty9.server.session.SessionHandler.doScope (SessionHandler.java:1564)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.nextScope (ScopedHandler.java:166)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope (ContextHandler.java:1155)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle (ScopedHandler.java:141)
at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle (HandlerWrapper.java:132)
at org.seleniumhq.jetty9.server.Server.handle (Server.java:530)
at org.seleniumhq.jetty9.server.HttpChannel.handle (HttpChannel.java:347)
at org.seleniumhq.jetty9.server.HttpConnection.onFillable (HttpConnection.java:256)
at org.seleniumhq.jetty9.io.AbstractConnection$ReadCallback.succeeded (AbstractConnection.java:279)
at org.seleniumhq.jetty9.io.FillInterest.fillable (FillInterest.java:102)
at org.seleniumhq.jetty9.io.ChannelEndPoint$2.run (ChannelEndPoint.java:124)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.doProduce (EatWhatYouKill.java:247)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.produce (EatWhatYouKill.java:140)
at org.seleniumhq.jetty9.util.thread.strategy.EatWhatYouKill.run (EatWhatYouKill.java:131)
at org.seleniumhq.jetty9.util.thread.ReservedThreadExecutor$ReservedThread.run (ReservedThreadExecutor.java:382)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob (QueuedThreadPool.java:708)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$2.run (QueuedThreadPool.java:626)
at java.lang.Thread.run (Thread.java:748)
Is there a stable Firefox browser, selenium-server-standalone jar and geckodriver version that works with Selenium grid (remotewebdriver) and not standalone ? Gecko driver seems to support standalone browsers but not remoteweb drivers. I'd really really appreciate if someone could share a working combination.
Hello!
I have fixed this issue using the same number of maxSession and maxInstances as the number of CPUs on the machine(the host where do you have the selenium node/nodes).
In my case is a hardware limitation, but this is not documented.
Please try and let me know if this fix is working for you.
Most helpful comment
Still happening with 3.4 - makes frequent test execution with Chrome impossible.