Description
I'm currently using a swarm cluster with docker overlay network and had the same issue as below. I could not access Selenium Grid.
Problem Reference: SeleniumHQ/docker-selenium#51
http://automatictester.co.ukk/2012/10/27/selenium-grid-2-0-and-remotehost-parameter/
Logs from selenium hub container:
selenium-hub | 16:59:45.925 INFO - Registered a node http://172.20.0.4:5555
selenium-hub | 16:59:50.253 INFO - Registered a node http://172.20.0.2:5555
The above is fine when running the selenium stack on a docker bridge type network but will not work against a docker overlay type network.
To recreate the issue:
use a CUSTOM_NETWORK_NAME that is a docker overlay network type instead of the default bridge.
To fix the issue I have to add a new environment variable entry.
For chrome:
REMOTE_HOST: "http://selenium-node-chrome:5555"
For firefox:
REMOTE_HOST: "http://selenium-node-firefox:5555"
As said in the topic link above and as I've observed, selenium by default uses the bridge network container ip instead of their overlay network ip.
Logs from selenium-hub after applying the fix:
selenium-hub | 17:02:47.526 INFO - Registered a node http://selenium-node-chrome:5555
selenium-hub | 17:02:51.736 INFO - Registered a node http://selenium-node-firefox:5555