1
votes

I used Docker for Selenium Grid Hub and Nodes to collect data, including

  • selenium/hub: 3.141.59-iron
  • selenium/node-fire_fox 3.141.59-iron

but one day after running, selenium-hub hung the following exception:

INFO exited: selenium-hub (exit status 137; not expected)

selenium/node-fire_fox exception is:

INFO [SelfRegisteringRemote$1.run] - Couldn't register this node: The hub is down or not responding: Failed to connect to selenium-hub/172.24.0.2:4444

What should I do?

2
Lookout for the log messages why The hub is down or not respondingDebanjanB

2 Answers

0
votes

if you are using docker I dont understand why are you leaving you hub up and running .

checkout their hub page : https://github.com/SeleniumHQ/docker-selenium/tree/master/Hub

hub launch : docker run -d -p 4444:4444 --name selenium-hub selenium/hub

nodes launch :

$ docker run -d --link selenium-hub:hub -v /dev/shm:/dev/shm selenium/node-chrome
$ docker run -d --link selenium-hub:hub -v /dev/shm:/dev/shm selenium/node-firefox

I would write a pipeline and define my hubimage and node images which I bring up at the beginning of the test session and remove the images at the end of the session.

try{
  hubimage
  nodeimage
  runtests
} catch(anything){
    throw anything;
} finally {
    sh "docker rmi \$(docker inspect --format='{{range .RepoTags}} {{.}} {{end}}' ${hubimage});"
   sh "docker rmi \$(docker inspect --format='{{range .RepoTags}} {{.}} {{end}}' ${nodeimage});"
}

see more informations about pipelines : https://jenkins.io/doc/book/pipeline/

0
votes

This is not a problem related to Selenium, but an issue with Docker.

The following link has a summary of root causes for the error exit status 137; not expected:

In short, for some reason, Docker is killing the process, in your case, selenium-hub.

For Mac and Windows, you probably need to increase the memory dedicated to Docker in Docker preferences.

This answer here on SO has a screenshot showing how to do it.