Image(s): node-chrome, node-chrome-debug, node-firefox, node-firefox-debug, hub
Docker-Selenium Image Version(s): 3.12.0 (I rolled back to 3.11.0 and the issue does not occur)
Docker Version: Version: 1.13.1-cs4 - API version: 1.27 (minimum version 1.12)
OS: Linux - CentOS 7.3.1611
When Running Dockerized selenium/hub and remote nodes using selenium/node-firefox with the latest docker version (latest/3.12.0) i expect the nodes to connect to the hub on port 5555 as usual. My docker command is below and the $serverip variable is defined prior to running:
docker run -d -p 5555:5555 -p 5900:5900 -e SE_OPTS="-host $serverip -port 5555" -e HUB_PORT_4444_TCP_ADDR=10.171.3.184 -e HUB_PORT_4444_TCP_PORT=4444 -v /dev/shm:/dev/shm selenium/node-firefox-debug
I have selenium/hub running on one host and on seperate dedicated hosts, I have chrome, firefox, ie, opera and safari nodes. Chrome and Firefox are using Docker selenium/node-chrome-debug or selenium/node-firefox-debug docker images. The Hosts running without docker are working correctly with the latest version of selenium and respective drivers/browsers. When I attempt to run the docker nodes they immediately exit after creating the containers and the logs show that the port 5555 is busy:
{"line":"17:11:37.771 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.12.0', revision: '7c6e0b3'","source":"stdout","tag":"selenium/node-chrome-debug/sad_snyder/7b64e7cff86a","attrs":{"location":"grid","type":"chlogs"}}
{"line":"17:11:37.788 INFO [GridLauncherV3$3.launch] - Launching a Selenium Grid node on port 5555","source":"stdout","tag":"selenium/node-chrome-debug/sad_snyder/7b64e7cff86a","attrs":{"location":"grid","type":"chlogs"}}
{"line":"2018-05-16 17:11:38.055:INFO::main: Logging initialized @1485ms to org.seleniumhq.jetty9.util.log.StdErrLog","source":"stdout","tag":"selenium/node-chrome-debug/sad_snyder/7b64e7cff86a","attrs":{"location":"grid","type":"chlogs"}}
{"line":"17:11:38.442 ERROR [SeleniumServer.boot] - Port 5555 is busy, please choose a free port and specify it using -port option","source":"stdout","tag":"selenium/node-chrome-debug/sad_snyder/7b64e7cff86a","attrs":{"location":"grid","type":"chlogs"}}
I had the same problem, I fixed it by using REMOTE_HOST instead of SE_OPTS to starts on the host/port.
I used to run EXPORT SE_OPTS="-host $HOST -port $PORT", now instead I only specify
EXPORT REMOTE_HOST=http://$HOST:$PORT and I run selenium in the container on the default port (5555). My wild random guess would be that it can't bind on the network interface I was passing for some reason.
In the end all I care about is passing the hub the proper info to reach the node, and you can do this with REMOTE_HOST.
thanks @rcarton, that worked.
I've just ran into exactly the same issue.
Fix suggested by @rcarton works, but it's said that option REMOTE_HOST is deprecated, and might be removed in future. Perhaps there's a "proper" way to get nodes to report their proper address?
Most helpful comment
I had the same problem, I fixed it by using REMOTE_HOST instead of SE_OPTS to starts on the host/port.
I used to run
EXPORT SE_OPTS="-host $HOST -port $PORT", now instead I only specifyEXPORT REMOTE_HOST=http://$HOST:$PORTand I run selenium in the container on the default port (5555). My wild random guess would be that it can't bind on the network interface I was passing for some reason.In the end all I care about is passing the hub the proper info to reach the node, and you can do this with
REMOTE_HOST.