0
docker pull elgalu/selenium
docker pull dosel/zalenium
docker run --rm --name zalenium -p 4444:4444 
-v /var/run/docker.sock:/var/run/docker.sock 
-e "zalenium_http_proxy=http://example.com:80" 
-e "zalenium_https_proxy=http://example.com:80" 
-e zalenium_no_proxy="localhost,127.0.0.1,http://example.com" 
--privileged dosel/zalenium start --desiredContainers 2 --maxDockerSeleniumContainers 2 --maxTestSessions 5

On using proxy while running zalenium container ,the node container closes abruptly and new one created after every 2 minutes.So if test take more than 2 minutes then getting failed with below error

WebDriverError: cannot forward the request Failed to connect to /192.168.64.4:40000

After every 2 minutes seeing node get restarted

zalenium    | 20:16:50.110 [Thread-10] INFO  d.z.e.z.registry.ZaleniumRegistry - Registered a node http://172.18.0.5:40000
zalenium    | 20:16:50.899 [Thread-11] INFO  d.z.e.z.registry.ZaleniumRegistry - Registered a node http://172.18.0.6:40001
zalenium    | 20:18:52.592 [http://172.18.0.5:40000] INFO  d.z.e.z.p.DockerSeleniumRemoteProxy - Marking node down.
zalenium    | 20:18:52.637 [http://172.18.0.6:40001] INFO  d.z.e.z.p.DockerSeleniumRemoteProxy - Marking node down.
zalenium    | 20:19:08.529 [Thread-12] INFO  d.z.e.z.registry.ZaleniumRegistry - Registered a node http://172.18.0.5:40002
zalenium    | 20:19:09.735 [Thread-13] INFO  d.z.e.z.registry.ZaleniumRegistry - Registered a node http://172.18.0.6:40003

Please let me know the solution for this issue.

Kingsley
  • 14,398
  • 5
  • 31
  • 53
  • Why would _...the node container closes abruptly and new one created after every 2 minutes..._? What does the _error stack trace_ says about it? – undetected Selenium Jan 31 '19 at 20:08
  • 2
    Your questions seemes rather unclear tbh. You might have better chances on serverfault.com while also considering [ask]. – Selaron Jan 31 '19 at 20:12
  • @DebanjanB: Am seeing the message in zalemium logs as d.z.e.z.p.DockerSeleniumRemoteProxy - Marking node down. zalenium | 20:18:52.637 and this happen only on using proxy zalenium_https_proxy,zalenium_http_proxy while spinning up the selenium grid ,without proxy am not facing this issue. – Balaji G Jan 31 '19 at 20:47
  • @Balaji G I have faceed the similar kind of issue in past for zalenium.This troubleshooting might help.1)For frequent restarting suggest you to use the recent image of elgalu/selenium. In my case I have tried the couple of images present on docker-hub and most recently worked for me. 3)for a quick response on issue join [Zalenium Slack](https://seleniumhq.slack.com/messages/C99KY79EK/whats_new/) 4) This [issue](https://github.com/zalando/zalenium/issues/679)explains few troubleshooting for proxy – Akshay barahate Feb 01 '19 at 07:06
  • are you able to solve this issue ? – Akshay barahate Apr 23 '19 at 12:49

1 Answers1

0

Try the below command with the latest docker and images

docker run --rm --name zalenium -p 4444:4444 -v /var/run/docker.sock:/var/run/docker.sock -e "zalenium_http_proxy=http://example.com:80" -e "zalenium_https_proxy=http://example.com:80" -e zalenium_no_proxy="localhost,127.0.0.1,http://example.com,172.*" --privileged dosel/zalenium start --desiredContainers 2 --maxDockerSeleniumContainers 2 --maxTestSessions 5