images icon indicating copy to clipboard operation
images copied to clipboard

Unable to connect to selenoid hub in Jenkins pipeline

Open ratankumarangadi opened this issue 4 years ago • 4 comments

Hi,

We are trying to setup selenoid in Jenkins AWS machine,

We pull firefox image as below , docker pull selenoid/firefox:74.0

And then start the selenoid docker as below,

docker run -d --name selenoid -p 4444:4444 -v /var/run/docker.sock:/var/run/docker.sock -v <PathToBrowser.josn>:/etc/selenoid/:ro aerokube/selenoid:latest-release -container-network bridge

And logs looks fine so far as below ,

02:43:36 + docker logs selenoid 02:43:36 2020/04/16 21:13:31 [-] [INIT] [Loading configuration files...] 02:43:36 2020/04/16 21:13:31 [-] [INIT] [Loaded configuration from /etc/selenoid/browsers.json] 02:43:36 2020/04/16 21:13:31 [-] [INIT] [Video Dir: /opt/selenoid/video] 02:43:36 2020/04/16 21:13:31 [-] [INIT] [Your Docker API version is 1.19] 02:43:36 2020/04/16 21:13:31 [-] [INIT] [Timezone: UTC] 02:43:36 2020/04/16 21:13:31 [-] [INIT] [Listening on :4444]

curl -s http://localhost:4444/status 02:43:36 {"total":5,"used":0,"queued":0,"pending":0,"browsers":{"firefox":{"74.0":{}}}} 02:43:36 + curl -s http://localhost:4444/wd/hub/status 02:43:36 {"value":{"message":"Selenoid 1.10.0 built at 2020-01-16_11:29:22AM","ready":true}}

When connecting to selenoid from selenium, it throws exception as below, Caused by: org.openqa.selenium.WebDriverException: wait: http://172.17.0.59:4444/wd/hub does not respond in 30s (WARNING: The server did not provide any stacktrace information)

I've seen similar posts to this but I'm unable to understand how to make it work, would be grateful if you could provide input on how to work on this problem

Thanks.

ratankumarangadi avatar Apr 17 '20 08:04 ratankumarangadi

@ratankumarangadi you are probably using Selenoid in custom Docker network. In that case you need to specify -container-network flag to make Selenoid start everything in the same network where it is actually running.

vania-pooh avatar Apr 17 '20 08:04 vania-pooh

Sorry i'm quiet new to Docker, I've mentioned network in run docker command as below,

docker run -d --name selenoid -p 4444:4444 -v /var/run/docker.sock:/var/run/docker.sock -v <PathToBrowser.josn>:/etc/selenoid/:ro aerokube/selenoid:latest-release -container-network bridge

is there any way to find the network that has to be mentioned ?

Thanks.

ratankumarangadi avatar Apr 17 '20 08:04 ratankumarangadi

@ratankumarangadi Something like this: docker run --network somenet .... aerokube/selenoid:latest-release -container-network somenet. Probably if you don't have Docker experience - I would recommend using our command line tool CM - which installs everything automatically: https://aerokube.com/selenoid/latest/#_quick_start_guide

vania-pooh avatar Apr 17 '20 09:04 vania-pooh

Ok thanks, I'll try to install ConfigurationManager, we wanted to keep light and avoid installing CM, I'll try it now but it would be helpful if you help me find out the network name, any command that will list it in aws?

ratankumarangadi avatar Apr 17 '20 09:04 ratankumarangadi