selenium icon indicating copy to clipboard operation
selenium copied to clipboard

Selenium nodes constantly get Unregistered and Registered in 3.5.0 as WebDriverServlet Initialising fails

Open shankarkc opened this issue 9 years ago • 5 comments

Meta -

OS: Linux

Selenium Version: 3.5.0

Browser: Firefox and chrome

54.0.1

Expected Behavior -

Nodes should not get deregistered one they get registred

Actual Behavior -

Selenium nodes constantly get Unregistered and Registered

Steps to reproduce -

Launch hub as below : -

/usr/lib//jvm/java-8-openjdk-amd64/jre/bin/java -cp /opt/selenium_ex/SeleniumGridExtras-jaa
r-with-dependencies.jar:./extension-proxy-0.6.jar:./selenium-grid-extra-docker-ee
xtension.jar:/tmp/webdriver/3.5.0.jar org.openqa.grid.selenium.GridLauncherV3 -rr
ole hub -log log/hub_4444.log -hubConfig hub_4444.json 

Launch node as below : -

/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Xmx1g -XX:ParallelGCThreads=5 -Dwebdriver.chrome.driver=/tmp/webdriver/chromedriver/chromedriver_2.31_64bit -Dwebdriver.gecko.driver=/tmp/webdriver/geckodriver/geckodriver_0.17.0 -cp /opt/selenium_ex/SeleniumGridExtras-jar-with-dependencies.jar:./all-node-extensions-0.6.jar:./extension-proxy-0.6.jar:/tmp/webdriver/3.5.0.jar org.openqa.grid.selenium.GridLauncherV3 -role node -nodeConfig node_5555.json -log log/node_5555.log 

Hub log

03:58:27.394 INFO - Selenium build info: version: '3.4.0', revision: 'unknown'
03:58:27.395 INFO - Launching Selenium Grid hub
03:58:27.972 INFO - binding io.sterodium.extensions.hub.proxy.HubRequestsProxyinn
gServlet to /grid/admin/HubRequestsProxyingServlet/*
03:58:27.973 INFO - binding com.ariba.es.ai.hub.proxy.servlets.SeleniumApiProxySS
ervlet to /grid/admin/SeleniumApiProxyServlet/*
03:58:28.008 INFO - Will listen on 4444
03:58:28.117 INFO - Nodes should register to http://10.0.9.2:4444/grid/register/
03:58:28.117 INFO - Selenium Grid hub is up and running
04:00:30.783 INFO - Registered a node http://1991b1780d9e:5555
04:00:36.003 INFO - Marking the node http://1991b1780d9e:5555 as down: cannot ree
ach the node for 1 tries
04:00:46.023 INFO - Unregistering the node http://1991b1780d9e:5555 because it'ss
 been down for 10020 milliseconds
04:00:46.023 WARN - Cleaning up stale test sessions on the unregistered node httt
p://1991b1780d9e:5555
04:00:50.853 INFO - Registered a node http://1991b1780d9e:5555
04:00:55.876 INFO - Marking the node http://1991b1780d9e:5555 as down: cannot ree
ach the node for 1 tries

Node log : -

03:58:29.617 INFO - Selenium build info: version: '3.5.0', revision: '8def36e068'
03:58:29.618 INFO - Launching a Selenium Grid node
04:00:30.366 WARN - error getting the parameters from the hub. The node may end up with wrong timeouts.Connect to SeleniumHub:4444 [SeleniumHub/10.97.92.20] failed: connect timed out
04:00:30.476 INFO - binding io.sterodium.extensions.node.SikuliExtensionServlet to /extra/SikuliExtensionServlet/*
04:00:30.477 INFO - binding io.sterodium.extensions.node.upload.FileUploadServlet to /extra/FileUploadServlet/*
04:00:30.478 INFO - binding io.sterodium.extensions.node.download.FileDownloadServlet to /extra/FileDownloadServlet/*
04:00:30.549 INFO - Driver class not found: com.opera.core.systems.OperaDriver
04:00:30.568 INFO - Driver provider class 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 LINUX
04:00:30.569 INFO - Driver provider class org.openqa.selenium.edge.EdgeDriver registration is skipped:
 registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform LINUX
04:00:30.569 INFO - Driver provider class org.openqa.selenium.safari.SafariDriver registration is skipped:
 registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform LINUX
04:00:30.582 INFO - Using the passthrough mode handler
04:00:30.669 INFO - Selenium Grid node is up and ready to register to the hub
04:00:30.677 INFO - Starting auto registration thread. Will try to register every 5000 ms.
04:00:30.678 INFO - Registering the node to the hub: http://SeleniumHub:4444/grid/register
04:00:30.792 INFO - The node is registered to the hub and ready to use
04:00:50.845 INFO - Registering the node to the hub: http://SeleniumHub:4444/grid/register
04:00:50.854 INFO - The node is registered to the hub and ready to use
04:01:10.892 INFO - Registering the node to the hub: http://SeleniumHub:4444/grid/register

shankarkc avatar Aug 18 '17 04:08 shankarkc

I debugged this issue little more. I found that Hub makes a call to node to get the status and receives exception.

http://MyNodeIPHere:5555/wd/hub/status 
HTTP ERROR 500

Problem accessing /wd/hub/status. Reason:

    Server Error

Caused by:

java.lang.NullPointerException
	at org.openqa.selenium.remote.server.WebDriverServlet.handle(WebDriverServlet.java:192)
	at org.openqa.selenium.remote.server.WebDriverServlet.doGet(WebDriverServlet.java:141)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
	at org.openqa.selenium.remote.server.WebDriverServlet.service(WebDriverServlet.java:111)
	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.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.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)

Then i looked at the node log. I see below call stack

[qtp489349054-13] INFO org.seleniumhq.jetty9.server.handler.ContextHandler.ROOT - org.openqa.selenium.remote.server.WebDriverServlet-291caca8: Initialising WebDriverServlet
[qtp489349054-13] WARN org.seleniumhq.jetty9.server.HttpChannel - /wd/hub/status
java.lang.NoSuchMethodError: com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder;
        at org.openqa.selenium.remote.server.AllHandlers.<clinit>(AllHandlers.java:52)
        at org.openqa.selenium.remote.server.WebDriverServlet.init(WebDriverServlet.java:83)
        at javax.servlet.GenericServlet.init(GenericServlet.java:244)
        at org.seleniumhq.jetty9.servlet.ServletHolder.initServlet(ServletHolder.java:637)
        at org.seleniumhq.jetty9.servlet.ServletHolder.getServlet(ServletHolder.java:498)
        at org.seleniumhq.jetty9.servlet.ServletHolder.ensureInstance(ServletHolder.java:785)
        at org.seleniumhq.jetty9.servlet.ServletHolder.prepare(ServletHolder.java:770)
        at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:530)
        at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:143)

It looks like this checkin is causing it https://github.com/SeleniumHQ/selenium/commit/f2d8d33c9c853fc1e087616ff7d7d6a9eb76be75 @shs96c Can you please take a look? I opened 3.5.0 standalone jar in JavaDecompiler. There I see this method for which its throwing call stack. So i couldnt identify the rootcause. But I hope the details I have attached provides some information to identify the root-cause. seleniumnodeissue

Thanks Shankar KC

shankarkc avatar Aug 21 '17 04:08 shankarkc

Please retest with selenium server 3.5.3, the issue with /status endpoint should be fixed there.

barancev avatar Sep 23 '17 18:09 barancev

Let's think this issue has been fixed, feel free to reopen it if it's not true.

barancev avatar Oct 06 '17 14:10 barancev

Can you share me the node_5555.json/ selenum_grid_extras_config.json files please, i'm not able to get the latest version of extras and server 3.6.0 working, as i'm getting the class not found error for GridLauncher. (though the latest class is GridLauncherV3) not sure why it is not getting reflected while running the grid extras.

node_5555.bat file:

java -Dselenium.LOGGER.level=WARNING -Dwebdriver.serv
er.session.timeout=900 -Dwebdriver.ie.driver=.\iedriver_2.53.1_64bit.exe -Dwebdr
iver.edge.driver="C:\Program Files (x86)\Microsoft Web Driver\MicrosoftWebDriver
.exe" -Dwebdriver.chrome.driver=.\chromedriver_2.33_32bit.exe -Dwebdriver.gecko.
driver=\tmp\webdriver\geckodriver\geckodriver_0.10.0.exe -cp C:\GridNode\testsen
ode5555\SeleniumGridExtras-1.12.17-SNAPSHOT-jar-with-dependencies.jar;.\selenium
-server-standalone-3.6.0.jar org.openqa.grid.selenium.GridLauncher -role node -f
riendlyHostName MACHINE001 -nodeConfig node_5555.json -log log\node_5555.log

vignesh-paramasivam avatar Nov 02 '17 13:11 vignesh-paramasivam

Similar issue

UPDATE: Never Mind... Apparently the MacBook Air Running High Sierra was on both Wi-Fi and Ethernet. This wasn't a problem before, but some random security update wouldn't let the Win 10 Hub talk to the Mac HS Safari Node. I shut off the Wi-Fi and the node then connected without error.

TLDR: Check possible network issues first, the error may just be a symptom of a failure to connect.

_Circumstances: Used to work without error until...

Major Changes: 1. Upgraded to HighSierra OS 2. Upgraded to Selenium 3.7.1 from 3.6.0

To Reproduce:

  1. Start Grid Hub on Win 10, Selenium 3.7.1
  2. Start Node on MacOS High Sierra, Selenium 3.7.1
  3. Fails on register of node_

Peace, RoakyWood

ghost avatar Nov 22 '17 17:11 ghost