Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selenium grid resets connection #646

Closed
ViljarVoidula opened this issue Jan 5, 2018 · 4 comments
Closed

Selenium grid resets connection #646

ViljarVoidula opened this issue Jan 5, 2018 · 4 comments

Comments

@ViljarVoidula
Copy link

Meta -

Image(s):
<hub,firefox_node_debug>
Docker-Selenium Image Version(s):
3.8.1-chlorine
Docker Version:
Docker version 17.09.1-ce, build 19e2cf6
OS:
Ubuntu 16.04 x64
4.10.0-42-generic

Expected Behavior -

Firefox node not dropping connection

Actual Behavior -

selenium-hub    | 10:58:30.509 DEBUG - Opening connection {}->http://172.18.0.4:5555
selenium-hub    | 10:58:30.509 DEBUG - Connecting to /172.18.0.4:5555
selenium-hub    | 10:58:30.510 DEBUG - Connection established 172.18.0.2:44878<->172.18.0.4:5555
selenium-hub    | 10:58:30.510 DEBUG - http-outgoing-6: set socket timeout to 6602000
selenium-hub    | 10:58:30.510 DEBUG - Executing request POST /wd/hub/session HTTP/1.1
selenium-hub    | 10:58:30.510 DEBUG - Target auth state: UNCHALLENGED
selenium-hub    | 10:58:30.510 DEBUG - Proxy auth state: UNCHALLENGED
selenium-hub    | 10:58:30.510 DEBUG - http-outgoing-6 >> POST /wd/hub/session HTTP/1.1
selenium-hub    | 10:58:30.510 DEBUG - http-outgoing-6 >> Connection: close
selenium-hub    | 10:58:30.511 DEBUG - http-outgoing-6 >> Host: 127.0.0.1:4444
selenium-hub    | 10:58:30.511 DEBUG - http-outgoing-6 >> Content-Type: application/json; charset=UTF-8
selenium-hub    | 10:58:30.511 DEBUG - http-outgoing-6 >> Content-Length: 545
selenium-hub    | 10:58:30.511 DEBUG - http-outgoing-6 >> User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_151)
selenium-hub    | 10:58:30.511 DEBUG - http-outgoing-6 >> Accept-Encoding: gzip,deflate
selenium-hub    | 10:58:30.511 DEBUG - http-outgoing-6 >> "POST /wd/hub/session HTTP/1.1[\r][\n]"
selenium-hub    | 10:58:30.512 DEBUG - http-outgoing-6 >> "Connection: close[\r][\n]"
selenium-hub    | 10:58:30.512 DEBUG - http-outgoing-6 >> "Host: 127.0.0.1:4444[\r][\n]"
selenium-hub    | 10:58:30.512 DEBUG - http-outgoing-6 >> "Content-Type: application/json; charset=UTF-8[\r][\n]"
selenium-hub    | 10:58:30.512 DEBUG - http-outgoing-6 >> "Content-Length: 545[\r][\n]"
selenium-hub    | 10:58:30.512 DEBUG - http-outgoing-6 >> "User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_151)[\r][\n]"
selenium-hub    | 10:58:30.512 DEBUG - http-outgoing-6 >> "Accept-Encoding: gzip,deflate[\r][\n]"
selenium-hub    | 10:58:30.512 DEBUG - http-outgoing-6 >> "[\r][\n]"
selenium-hub    | 10:58:30.512 DEBUG - http-outgoing-6 >> "{[\n]"
selenium-hub    | 10:58:30.513 DEBUG - http-outgoing-6 >> "  "desiredCapabilities": {"acceptSslCerts":true,"browserName":"firefox","javascriptEnabled":true,"log":true,"marionette":true,"name":"default","se:CONFIG_UUID":"1dccac46-516f-4d8f-9865-edab74893374"},[\n]"
selenium-hub    | 10:58:30.513 DEBUG - http-outgoing-6 >> "  "capabilities": {[\n]"
selenium-hub    | 10:58:30.513 DEBUG - http-outgoing-6 >> "    "desiredCapabilities": {"acceptSslCerts":true,"browserName":"firefox","javascriptEnabled":true,"log":true,"marionette":true,"name":"default","se:CONFIG_UUID":"1dccac46-516f-4d8f-9865-edab74893374"},[\n]"
selenium-hub    | 10:58:30.513 DEBUG - http-outgoing-6 >> "    "firstMatch": [[\n]"
selenium-hub    | 10:58:30.513 DEBUG - http-outgoing-6 >> "      {"browserName":"firefox","se:CONFIG_UUID":"1dccac46-516f-4d8f-9865-edab74893374"}[\n]"
selenium-hub    | 10:58:30.513 DEBUG - http-outgoing-6 >> "    ][\n]"
selenium-hub    | 10:58:30.513 DEBUG - http-outgoing-6 >> "  }[\n]"
selenium-hub    | 10:58:30.513 DEBUG - http-outgoing-6 >> "}"
firefox_1       | 2018-01-05 10:58:30.516:INFO:osjshC.ROOT:qtp1016925085-14: org.openqa.selenium.remote.server.WebDriverServlet-3b0090a4: Initialising WebDriverServlet
firefox_1       | 10:58:30.536 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.BeginSession@44ea83f
firefox_1       | 10:58:30.541 INFO - /session: Executing POST on /session (handler: BeginSession)
firefox_1       | 10:58:30.626 INFO - Capabilities are: Capabilities {acceptSslCerts: true, browserName: firefox, javascriptEnabled: true, log: true,marionette: true, name: default}
firefox_1       | 10:58:30.628 INFO - Capabilities {acceptSslCerts: true, browserName: firefox, javascriptEnabled: true, log: true, marionette: true,name: default} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.firefox.GeckoDriverService)
firefox_1       | 1515149910671 geckodriver     INFO    geckodriver 0.19.1
firefox_1       | 1515149910678 geckodriver     INFO    Listening on 127.0.0.1:31819
firefox_1       | 1515149910841 mozrunner::runner       INFO    Running command: "/usr/bin/firefox" "-marionette" "-profile" "/tmp/rust_mozprofile.KjkHHCmcV3O1"
firefox_1       | 1515149911372 Marionette      INFO    Enabled via --marionette
firefox_1       | Failed to read: session.screen0.titlebar.left
firefox_1       | Setting default value
firefox_1       | Failed to read: session.screen0.titlebar.right
firefox_1       | Setting default value
firefox_1       | 1515149912686 Marionette      INFO    Listening on port 45203
firefox_1       | 1515149912815 Marionette      DEBUG   Register listener.js for window 2147483649
firefox_1       | 10:58:32.848 INFO - Detected dialect: W3C
selenium-hub    | 10:58:32.874 DEBUG - http-outgoing-6 << "HTTP/1.1 200 OK[\r][\n]"
selenium-hub    | 10:58:32.874 DEBUG - http-outgoing-6 << "Connection: close[\r][\n]"
selenium-hub    | 10:58:32.874 DEBUG - http-outgoing-6 << "Date: Fri, 05 Jan 2018 10:58:30 GMT[\r][\n]"
selenium-hub    | 10:58:32.874 DEBUG - http-outgoing-6 << "Expires: Thu, 01 Jan 1970 00:00:00 GMT[\r][\n]"
selenium-hub    | 10:58:32.875 DEBUG - http-outgoing-6 << "Cache-Control: no-cache[\r][\n]"
selenium-hub    | 10:58:32.875 DEBUG - http-outgoing-6 << "Content-Type: application/json;charset=utf-8[\r][\n]"
selenium-hub    | 10:58:32.875 DEBUG - http-outgoing-6 << "Content-Length: 473[\r][\n]"
selenium-hub    | 10:58:32.875 DEBUG - http-outgoing-6 << "Server: Jetty(9.4.7.v20170914)[\r][\n]"
selenium-hub    | 10:58:32.875 DEBUG - http-outgoing-6 << "[\r][\n]"
selenium-hub    | 10:58:32.875 DEBUG - http-outgoing-6 << "{"value":{"sessionId":"974cc51f-39ea-4bd7-a325-4fe554e93c0b","capabilities":{"moz:profile":"/tmp/rust_mozprofile.KjkHHCmcV3O1","rotatable":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"pageLoadStrategy":"normal","moz:headless":false,"moz:accessibilityChecks":false,"acceptInsecureCerts":false,"browserVersion":"57.0.2","platformVersion":"4.10.0-42-generic","moz:processID":114,"browserName":"firefox","platformName":"linux","moz:webdriverClick":false}}}"
selenium-hub    | 10:58:32.876 DEBUG - http-outgoing-6 << HTTP/1.1 200 OK
selenium-hub    | 10:58:32.876 DEBUG - http-outgoing-6 << Connection: close
selenium-hub    | 10:58:32.876 DEBUG - http-outgoing-6 << Date: Fri, 05 Jan 2018 10:58:30 GMT
selenium-hub    | 10:58:32.876 DEBUG - http-outgoing-6 << Expires: Thu, 01 Jan 1970 00:00:00 GMT
selenium-hub    | 10:58:32.876 DEBUG - http-outgoing-6 << Cache-Control: no-cache
selenium-hub    | 10:58:32.876 DEBUG - http-outgoing-6 << Content-Type: application/json;charset=utf-8
selenium-hub    | 10:58:32.876 DEBUG - http-outgoing-6 << Content-Length: 473
selenium-hub    | 10:58:32.876 DEBUG - http-outgoing-6 << Server: Jetty(9.4.7.v20170914)
selenium-hub    | 10:58:32.923 DEBUG - http-outgoing-6: Close connection
selenium-hub    | 10:58:32.924 DEBUG - Connection discarded

Using nightwatch JS as testframework:
output:
`Running: Open player
INFO Request: POST /wd/hub/session

  • data: {"desiredCapabilities":{"browserName":"firefox","javascriptEnabled":true,"acceptSslCerts":true,"platform":"ANY","marionette":true,"log":true,"name":"default"}}
  • headers: {"Content-Type":"application/json; charset=utf-8","Content-Length":159}
    INFO Response 200 POST /wd/hub/session (2526ms) { value:
    { sessionId: '974cc51f-39ea-4bd7-a325-4fe554e93c0b',
    capabilities:
    { 'moz:profile': '/tmp/rust_mozprofile.KjkHHCmcV3O1',
    rotatable: false,
    timeouts: { implicit: 0, pageLoad: 300000, script: 30000 },
    pageLoadStrategy: 'normal',
    'moz:headless': false,
    'moz:accessibilityChecks': false,
    acceptInsecureCerts: false,
    browserVersion: '57.0.2',
    platformVersion: '4.10.0-42-generic',
    'moz:processID': 114,
    browserName: 'firefox',
    platformName: 'linux',
    'moz:webdriverClick': false } } }

Error retrieving a new session from the selenium server

Connection refused! Is selenium server started?
{ value:
{ sessionId: '974cc51f-39ea-4bd7-a325-4fe554e93c0b',
capabilities:
{ 'moz:profile': '/tmp/rust_mozprofile.KjkHHCmcV3O1',
rotatable: false,
timeouts: [Object],
pageLoadStrategy: 'normal',
'moz:headless': false,
'moz:accessibilityChecks': false,
acceptInsecureCerts: false,
browserVersion: '57.0.2',
platformVersion: '4.10.0-42-generic',
'moz:processID': 114,
browserName: 'firefox',
platformName: 'linux',
'moz:webdriverClick': false } } }`

@diemol
Copy link
Member

diemol commented Jan 5, 2018

Hi @ViljarVoidula,

Could you please help us by providing:

  • The docker command used to start the containers
  • A reduced sample code that we can use to reproduce the issue? It would be nice to have a little setup with Nightwatch.

@ViljarVoidula
Copy link
Author

ViljarVoidula commented Jan 5, 2018

@diemol Thank You so much for fast response. I did setup a repository so the problem would be easy to reproduce . https://github.com/ViljarVoidula/nightwatch-selenium-firefox. You will need https://yarnpkg.com/en/docs/install . I did find issue facing quite similar problem in geckodriver mozilla/geckodriver#1015 . Maybe my problem is duplicate of the issue mentioned there, but I'm not enough experienced yet to confirm that .

I use docker-compose up

version: "2"
services:
selenium-hub:
image: selenium/hub
container_name: selenium-hub
environment:
- GRID_MAX_SESSION=100
ports:
- "4444:4444"
volumes: ["/dev/shm:/dev/shm"]
privileged: true
chrome:
image: selenium/node-chrome-debug
privileged: true
depends_on:
- selenium-hub
environment:
- HUB_PORT_4444_TCP_ADDR=selenium-hub
- HUB_PORT_4444_TCP_PORT=4444
- SCREEN_WIDTH=1920
- SCREEN_HEIGHT=1080
- VNC_ENABLED=true
ports:
- "5900"
volumes: ["/dev/shm:/dev/shm"]
firefox:
image: selenium/node-firefox-debug
privileged: true
depends_on:
- selenium-hub
environment:
- HUB_PORT_4444_TCP_ADDR=selenium-hub
- HUB_PORT_4444_TCP_PORT=4444
- SCREEN_WIDTH=1920
- SCREEN_HEIGHT=1080
- VNC_ENABLED=true
volumes: ["/dev/shm:/dev/shm"]
ports:
- "5900"

@diemol
Copy link
Member

diemol commented Jan 10, 2018

Hi @ViljarVoidula,

I used your project and I bumped into the same error. So I tried to figure out if there was some option making that error happen and in short, I was not able to figure it out.

So I decided to create my own small Nightwatch project, with the smallest config, to see if it still happens, and yes, the error also shows up:

Error retrieving a new session from the selenium server

Connection refused! Is selenium server started?
{ value:
   { sessionId: '4f0b9151-0cef-4077-abc4-23c37e6a157b',
     capabilities:
      { 'moz:profile': '/tmp/rust_mozprofile.747gDtpG7DQP',
        rotatable: false,
        timeouts: [Object],
        pageLoadStrategy: 'normal',
        'moz:headless': false,
        'moz:accessibilityChecks': false,
        acceptInsecureCerts: false,
        browserVersion: '57.0.4',
        platformVersion: '4.9.60-linuxkit-aufs',
        'moz:processID': 100,
        browserName: 'firefox',
        platformName: 'linux',
        'moz:webdriverClick': false } } }

After that, I tried with a small setup for WebDriverIO, and no error happened.

These are the couple of projects https://github.com/diemol/docker-selenium-issues/tree/master/issue-646

I also tried to start a local grid without docker, by doing:

java -jar selenium-server-standalone-3.8.1.jar -role hub
java -jar selenium-server-standalone-3.8.1.jar -role node

(I have FF 57.0.4 and GeckoDriver 0.19.1 locally installed).

and the same error happened when running the Nightwatch test.

So I suspect that the problem is actually related to Nightwatch, and I'd recommend that you create an issue in their repo because it looks like those bindings are having some issue with the latest Selenium version.

Since this is not a docker-selenium issue, I'll go ahead and close this issue.

@diemol diemol closed this as completed Jan 10, 2018
@ViljarVoidula
Copy link
Author

@diemol Thank you very much for confirmation. Atleast now I have somekind of direction to go on with that's confirmed by expert .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants