Skip to content

[🐛 Bug]: Port ____ already In use with selenium/node-chrome:4.1.0-20211123 #1453

@therealdjryan

Description

@therealdjryan

What happened?

I was getting an error message Unable to execute request for an existing session: Unable to find session with ID: and saw a possible solution described in SeleniumHQ/selenium#9988 and followed a hint in the ticket to try running the 4.1 prerelease.

when staring the hub and nodes I get errors similar to this for each chrome node:

java.io.IOException: Port 5502 already in use

I am running selenium grid under podman 3.3.1, which I know is not supported. The startup command podman-compose is the podman equivalent to docker-compose

Is there a difference in how ports are defined or specified with the prerelease, either in docker-selenium or in selenium proper?

Command used to start Selenium Grid with Docker

podman-compose --project-name grid -f container-compose.yml up --build --remove-orphans -d

file container-compose.yml: (updated 11/23 with simplified version)

services:
    chrome1:
        image: selenium/node-chrome:4.1.0-20211123
        privileged: true
        hostname: chrome1
        shm_size: 2G
        environment:
            - VNC_NO_PASSWORD=1
            - VNC_PORT=5901
            - NO_VNC_PORT=7901
            - VNC_VIEW_ONLY=1
            - SE_NODE_GRID_URL=http://selgrid:4444
            - SCREEN_WIDTH=1550
            - SCREEN_HEIGHT=880
            - SCREEN_DPI=72
            - SCREEN_DEPTH=16
            - START_NO_VNC=true
            - DISPLAY=:91
            - DISPLAY_NUM=91
            - SE_OPTS=--log-level FINE --registration-secret xt3jrtsQW3KFK9em4bCy --host selgrid -p 5501
            - SE_EVENT_BUS_HOST=selenium-hub
            - SE_EVENT_BUS_PUBLISH_PORT=4442
            - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
            - SE_SESSION_REQUEST_TIMEOUT=500
            - SE_SESSION_RETRY_INTERVAL=2
            - CONTAINER_HOST=tcp://selgrid:23750
            - TZ=US/Eastern
            - DOCKER_HOST=tcp://selgrid:23750
            - JAVA_OPTS=-Dio.netty.tryReflectionSetAccessible=true --add-opens java.base/jdk.internal.misc=ALL-UNNAMED
        ports:
            - "5901:5901"
            - "7901:7901"
            - "5501:5501"

    selenium-hub:
        image: selenium/hub:4.1.0-20211123
        privileged: true
        hostname: selenium-hub
        labels:
            - org.broadinstitute.grid.service=hub
        environment:
            - SE_SESSION_REQUEST_TIMEOUT=500
            - SE_SESSION_RETRY_INTERVAL=2
            - SE_OPTS=--log-level WARNING --registration-secret xt3jrtsQW3KFK9em4bCy
            - VNC_VIEW_ONLY=1
            - CONTAINER_HOST=tcp://selgrid:23750
            - DOCKER_HOST=tcp://selgrid:23750
            - JAVA_OPTS=-Dio.netty.tryReflectionSetAccessible=true --add-opens java.base/jdk.internal.misc=ALL-UNNAMED
            - TZ=US/Eastern
        ports:
            - 4444:4444

Relevant log output

Starting Selenium Grid Node...
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/opt/selenium/selenium-server.jar) to constructor java.nio.DirectByteBuffer(long,int)
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.openqa.selenium.grid.Bootstrap.runMain(Bootstrap.java:77)
	at org.openqa.selenium.grid.Bootstrap.main(Bootstrap.java:70)
Caused by: java.io.UncheckedIOException: java.io.IOException: Port 5502 already in use
	at org.openqa.selenium.netty.server.NettyServer.start(NettyServer.java:159)
	at org.openqa.selenium.grid.node.httpd.NodeServer$1.start(NodeServer.java:192)
	at org.openqa.selenium.grid.node.httpd.NodeServer$1.start(NodeServer.java:189)
	at org.openqa.selenium.grid.node.httpd.NodeServer.execute(NodeServer.java:231)
	at org.openqa.selenium.grid.TemplateGridCommand.lambda$configure$4(TemplateGridCommand.java:129)
	at org.openqa.selenium.grid.Main.launch(Main.java:83)
	at org.openqa.selenium.grid.Main.go(Main.java:57)
	at org.openqa.selenium.grid.Main.main(Main.java:42)
	... 6 more
Caused by: java.io.IOException: Port 5502 already in use
	... 14 more
Caused by: java.net.BindException: Cannot assign requested address
	at java.base/sun.nio.ch.Net.bind0(Native Method)
	at java.base/sun.nio.ch.Net.bind(Net.java:455)
	at java.base/sun.nio.ch.Net.bind(Net.java:447)
	at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
	at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:134)
	at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:562)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334)
	at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506)
	at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491)
	at io.netty.handler.logging.LoggingHandler.bind(LoggingHandler.java:230)
	at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506)
	at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491)
	at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973)
	at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:260)
	at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:829)
2021-11-17 13:08:58,219 INFO exited: selenium-node (exit status 1; not expected)

Operating System

RHEL8

Docker Selenium version (tag)

4.1.0-20211123

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions