Dynamic Grid configuration in Grid-4

835 views
Skip to first unread message

rmz

unread,
Feb 11, 2021, 9:23:11 AM2/11/21
to Selenium Users
Hello All,
I am trying to configure a Dynamic Grid as documented here https://github.com/SeleniumHQ/docker-selenium 

I need to configure 5 hosts 1Hub and 4 Nodes.
Can someone please clarify where this "config.toml" be placed ? is it in node or in hub?

I placed it in Node and tried to run following command on Node. It throw exception and container exited.

docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v /path/on/your/host/machine:/opt/selenium/assets \ selenium/node-docker:4.0.0-beta-1-prerelease-20210210

Regards,
Remya

Diego Molina

unread,
Feb 11, 2021, 12:11:55 PM2/11/21
to Selenium Users
Hello,

If you use a Hub/Node config, it should be placed on the Nodes.

Regards,

Diego

rmz

unread,
Feb 12, 2021, 1:13:34 AM2/12/21
to Selenium Users
Thank you Diego, I have a hub-node config. I get following error when i ran following command. Could you please tell me what is the issue here?
I did add a new line after line #20, that didnt help.

Log from container:

021-02-12 05:51:54,866 INFO Included extra file "/etc/supervisor/conf.d/selenium-grid-node-docker.conf" during parsing
2021-02-12 05:51:54,868 INFO supervisord started with pid 7
2021-02-12 05:51:55,871 INFO spawned: 'selenium-grid-node-docker' with pid 9
Starting Selenium Grid Node Docker...
2021-02-12 05:51:55,879 INFO success: selenium-grid-node-docker entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
Exception in thread "main" io.ous.jtoml.ParseException: Newline expected after assignment at 20:15
        at io.ous.jtoml.impl.Parser.error(Parser.java:250)
        at io.ous.jtoml.impl.Parser.parse(Parser.java:51)
        at io.ous.jtoml.JToml.parse(JToml.java:35)
        at org.openqa.selenium.grid.config.TomlConfig.<init>(TomlConfig.java:45)
        at org.openqa.selenium.grid.config.TomlConfig.from(TomlConfig.java:55)
        at org.openqa.selenium.grid.config.Configs.from(Configs.java:40)
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:546)
        at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
        at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:505)
        at org.openqa.selenium.grid.config.ConfigFlags.readConfigFiles(ConfigFlags.java:62)
        at org.openqa.selenium.grid.TemplateGridCommand.lambda$configure$2(TemplateGridCommand.java:85)
        at org.openqa.selenium.grid.Main.launch(Main.java:154)
        at org.openqa.selenium.grid.Main.go(Main.java:88)
        at org.openqa.selenium.grid.Main.main(Main.java:54)
2021-02-12 05:51:56,189 INFO exited: selenium-grid-node-docker (exit status 1; not expected)


Command ran on node: 
<node_Host>:/opt/grid4# docker run -d --net grid4-overlay -e SE_OPTS="--log-level FINE" -e SE_EVENT_BUS_HOST=selenium-hub -e SE_EVENT_BUS_PUBLISH_PORT=4442 -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -v ${PWD}/config.toml:/opt/bin/config.toml -v /opt/grid4/asset:/opt/selenium/assets selenium/node-docker:4.0.0-beta-1-prerelease-20210210

I copied config.toml in /opt/grid4 folder with following contents:

[docker]
# Configs have a mapping between the Docker image to use and the capabilities that need to be matched to
# start a container with the given image.
configs = [
    "selenium/standalone-chrome:4.0.0-beta-1-prerelease-20210210", "{\"browserName\": \"chrome\"}"
    ]

# URL for connecting to the docker daemon
# host.docker.internal works for macOS and Windows.
# Linux could use --net=host in the `docker run` instruction or 172.17.0.1 in the URI below.
# To have Docker listening through tcp on macOS, install socat and run the following command
# socat -4 TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock
host = "tcp://<node_hostname>:2375"
# Docker imagee used for video recording
#video-image = "selenium/video:ffmpeg-4.3.1-20210209"

# Uncomment the following section if you are running the node on a separate VM
# Fill out the placeholders with appropriate values
[server]
hostname=<NODE_IP>
port=5555


Regards,
Remya



rmz

unread,
Feb 15, 2021, 4:48:24 AM2/15/21
to Selenium Users
Hi All,
I have updated hostname to my node's hostname with our FQDN, that error was resolved, but i am getting following error in container logs. 
Can someone please help?

09:18:45.397 DEBUG [LoggingOptions$1.lambda$export$1] - SpanWrapper{delegate=RecordEventsReadableSpan{traceId=cb2e09787dd371dadd643b95e82dc42d, spanId=4f68d20b1b819cb3, parentSpanContext=ImmutableSpanContext{traceIdAsHexString=00000000000000000000000000000000, spanIdAsHexString=0000000000000000, traceFlags=0, traceState=ArrayBasedTraceState{entries=[]}, remote=false}, name=httpclient.execute, kind=INTERNAL, attributes=AttributesMap{data={span.kind=client, http.method=GET, http.target=/version}, capacity=1000, totalAddedValues=3}, status=ImmutableStatusData{statusCode=UNSET, description=null}, totalRecordedEvents=0, totalRecordedLinks=0, startEpochNanos=1613380725266528328, endEpochNanos=1613380725393511805}, resolvedLinks=[], resolvedEvents=[], attributes=AttributesMap{data={span.kind=client, http.method=GET, http.target=/version}, capacity=1000, totalAddedValues=3}, totalAttributeCount=3, totalRecordedEvents=0, status=ImmutableStatusData{statusCode=UNSET, description=null}, name=httpclient.execute, endEpochNanos=1613380725393511805, internalHasEnded=true}
Exception in thread "main" org.openqa.selenium.grid.config.ConfigException: java.lang.reflect.InvocationTargetException
        at org.openqa.selenium.grid.config.MemoizedConfig.getClass(MemoizedConfig.java:115)
        at org.openqa.selenium.grid.node.config.NodeOptions.getNode(NodeOptions.java:80)
        at org.openqa.selenium.grid.node.httpd.NodeServer.createHandlers(NodeServer.java:122)
        at org.openqa.selenium.grid.node.httpd.NodeServer.asServer(NodeServer.java:178)
        at org.openqa.selenium.grid.node.httpd.NodeServer.execute(NodeServer.java:224)
        at org.openqa.selenium.grid.TemplateGridCommand.lambda$configure$2(TemplateGridCommand.java:101)
        at org.openqa.selenium.grid.Main.launch(Main.java:154)
        at org.openqa.selenium.grid.Main.go(Main.java:88)
        at org.openqa.selenium.grid.Main.main(Main.java:54)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.openqa.selenium.grid.config.ClassCreation.callCreateMethod(ClassCreation.java:47)
        at org.openqa.selenium.grid.config.MemoizedConfig.lambda$getClass$4(MemoizedConfig.java:100)
        at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1688)
        at org.openqa.selenium.grid.config.MemoizedConfig.getClass(MemoizedConfig.java:95)
        ... 8 more
Caused by: java.io.FileNotFoundException
        at io.netty.channel.unix.Errors.throwConnectException(Errors.java:122)
        at io.netty.channel.unix.Socket.connect(Socket.java:239)
        at io.netty.channel.epoll.AbstractEpollChannel.doConnect0(AbstractEpollChannel.java:736)
        at io.netty.channel.epoll.AbstractEpollChannel.doConnect(AbstractEpollChannel.java:721)
        at io.netty.channel.epoll.EpollDomainSocketChannel.doConnect(EpollDomainSocketChannel.java:87)
        at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.connect(AbstractEpollChannel.java:563)
        at io.netty.channel.DefaultChannelPipeline$HeadContext.connect(DefaultChannelPipeline.java:1342)
        at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:548)
        at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:533)
        at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.connect(CombinedChannelDuplexHandler.java:495)
        at io.netty.channel.ChannelOutboundHandlerAdapter.connect(ChannelOutboundHandlerAdapter.java:51)
        at io.netty.channel.CombinedChannelDuplexHandler.connect(CombinedChannelDuplexHandler.java:296)
        at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:548)
        at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:533)
        at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:517)
        at io.netty.channel.DefaultChannelPipeline.connect(DefaultChannelPipeline.java:978)
        at io.netty.channel.AbstractChannel.connect(AbstractChannel.java:253)
        at io.netty.bootstrap.Bootstrap$3.run(Bootstrap.java:250)
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:387)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.lang.Thread.run(Thread.java:748)

Diego Molina

unread,
Mar 10, 2021, 8:39:29 AM3/10/21
to Selenium Users
It looks like the config.toml file is not found.

Are you still having this issue in the most recent release?
Reply all
Reply to author
Forward
0 new messages