Selenium 4: Chrome Node does not register correctly to the hub

I have an Openshift 3 Cluster containing the two following containers: selenium-hub and selenium-node-chrome. Please see below the attached deployment and service yaml files.

Hub Deployment:

apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  labels:
    app: selenium-hub
    selenium-hub: master
  name: selenium-hub
spec:
  replicas: 1
  selector:
    type: selenium-hub
  template:
    metadata:
      labels:
        type: selenium-hub
      name: selenium-hub
    spec:
      containers:
        - image: 'selenium/hub:latest'
          imagePullPolicy: IfNotPresent
          name: master
          ports:
            - containerPort: 4444
              protocol: TCP
            - containerPort: 4442
              protocol: TCP
            - containerPort: 4443
              protocol: TCP
  triggers:
    - type: ConfigChange

Hub Service:

apiVersion: v1
kind: Service
metadata:
  labels:
    app: selenium-hub
    selenium-hub: master
  name: selenium-hub
spec:
  ports:
    - name: selenium-hub
      port: 4444
      protocol: TCP
      targetPort: 4444
    - name: publish
      port: 4442
      protocol: TCP
      targetPort: 4442
    - name: subscribe
      port: 4443
      protocol: TCP
      targetPort: 4443
  selector:
    type: selenium-hub
  type: ClusterIP

Node Deployment:

apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  labels:
    app: selenium-node-chrome
  name: selenium-node-chrome
spec:
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    browser: chrome
  template:
    metadata:
      labels:
        app: node-chrome
        browser: chrome
      name: selenium-node-chrome-master
    spec:
      containers:
        - env:
            - name: SE_EVENT_BUS_HOST
              value: selenium-hub
            - name: SE_EVENT_BUS_PUBLISH_PORT
              value: '4442'
            - name: SE_EVENT_BUS_SUBSCRIBE_PORT
              value: '4443'
            - name: SE_NODE_HOST
              value: node-chrome
            - name: SE_NODE_PORT
              value: '5555'
          image: 'selenium/node-chrome:4.0.0-20211102'
          imagePullPolicy: IfNotPresent
          name: master
          ports:
            - containerPort: 5555
              protocol: TCP
  triggers:
    - type: ConfigChange

Service:

apiVersion: v1
kind: Service
metadata:
  labels:
    app: selenium-node-chrome
  name: selenium-node-chrome
spec:
  ports:
    - name: node-port
      port: 5555
      protocol: TCP
      targetPort: 5555
    - name: node-port-grid
      port: 4444
      protocol: TCP
      targetPort: 4444
  selector:
    browser: chrome
  type: ClusterIP

My issue:
The hub and the node are starting, but the node just keeps sending the registration event and the hub is logging some infos, which i dont really understand. Please see the logs attached below.

Log:

Setting up SE_NODE_GRID_URL...
Selenium Grid Node configuration: 
[events]
publish = "tcp://selenium-hub:4442"
subscribe = "tcp://selenium-hub:4443"

[server]
host = "node-chrome"
port = "5555"
[node]
session-timeout = "300"
override-max-sessions = false
detect-drivers = false
max-sessions = 1

[[node.driver-configuration]]
display-name = "chrome"
stereotype="{"browserName": "chrome", "browserVersion": "95.0", "platformName": "Linux"}"
max-sessions = 1

Starting Selenium Grid Node...
11:34:31.635 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
11:34:31.643 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
11:34:31.774 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://selenium-hub:4442 and tcp://selenium-hub:4443
11:34:31.843 INFO [UnboundZmqEventBus.<init>] - Sockets created
11:34:32.854 INFO [UnboundZmqEventBus.<init>] - Event bus ready
11:34:33.018 INFO [NodeServer.createHandlers] - Reporting self as: http://node-chrome:5555 
11:34:33.044 INFO [NodeOptions.getSessionFactories] - Detected 1 available processors
11:34:33.115 INFO [NodeOptions.report] - Adding chrome for {"browserVersion": "95.0","browserName": "chrome","platformName": "Linux","se:vncEnabled": true} 1 times
11:34:33.130 INFO [Node.<init>] - Binding additional locator mechanisms: name, relative, id
11:34:33.471 INFO [NodeServer$1.start] - Starting registration process for node id 2832e819-cf31-4bd9-afcc-cd2b27578d58
11:34:33.473 INFO [NodeServer.execute] - Started Selenium node 4.0.0 (revision 3a21814679): http://node-chrome:5555 
11:34:33.476 INFO [NodeServer$1.lambda$start$1] - Sending registration event...
11:34:43.479 INFO [NodeServer$1.lambda$start$1] - Sending registration event...
11:34:53.481 INFO [NodeServer$1.lambda$start$1] - Sending registration event...

Hub Log:

2021-12-07 11:14:22,663 INFO spawned: 'selenium-grid-hub' with pid 11
2021-12-07 11:14:23,664 INFO success: selenium-grid-hub entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
11:14:23.953 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
11:14:23.961 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
11:14:24.136 INFO [BoundZmqEventBus.<init>] - XPUB binding to [binding to tcp://*:4442, advertising as tcp://XXXXXXX:4442], XSUB binding to [binding to tcp://*:4443, advertising as tcp://XXXXXX:4443]
11:14:24.246 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://XXXXXX:4442 and tcp://XXXXXXX:4443
11:14:24.275 INFO [UnboundZmqEventBus.<init>] - Sockets created
11:14:25.278 INFO [UnboundZmqEventBus.<init>] - Event bus ready
11:14:26.232 INFO [Hub.execute] - Started Selenium Hub 4.1.0 (revision 87802e897b): http://XXXXXXX:4444 
11:14:46.965 INFO [Node.<init>] - Binding additional locator mechanisms: name, relative, id
11:15:46.916 INFO [Node.<init>] - Binding additional locator mechanisms: relative, name, id
11:17:52.377 INFO [Node.<init>] - Binding additional locator mechanisms: relative, id, name

Can anyone tell me why the hub wont register the node? If you need any further information, let me know. Thanks alot

Leave a Comment