Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Gateway Timeout issue in selenium chrome docker image #392
Expected Behavior -
Chrome node should be working normal and no gateway timeout issues should be coming.
Actual Behavior -
We are getting gateway timeout issues very frequently. Here is the log
[chrome #1-3] [23:41:32] I/hosted - Using the selenium server at https://selenium.corp.xyz.com/wd/hub
504 Gateway Time-out
[chrome #1-3] The server didn't respond in time.
[chrome #1-3] at WebDriverError (/var/jenkins_home/workspace/FEproject/node_modules/selenium-webdriver/lib/error.js:27:5)
[chrome #1-3] at parseHttpResponse (/var/jenkins_home/workspace/FEproject/node_modules/selenium-webdriver/http/index.js:554:11)
[chrome #1-3] at client_.send.then.response (/var/jenkins_home/workspace/FEproject/node_modules/selenium-webdriver/http/index.js:472:11)
[chrome #1-3] at ManagedPromise.invokeCallback_ (/var/jenkins_home/workspace/FEproject/node_modules/selenium-webdriver/lib/promise.js:1379:14)
[chrome #1-3] at TaskQueue.execute_ (/var/jenkins_home/workspace/FEproject/node_modules/selenium-webdriver/lib/promise.js:2913:14)
[chrome #1-3] at TaskQueue.executeNext_ (/var/jenkins_home/workspace/FEproject/node_modules/selenium-webdriver/lib/promise.js:2896:21)
[chrome #1-3] at asyncRun (/var/jenkins_home/workspace/FEproject/node_modules/selenium-webdriver/lib/promise.js:2820:25)
[chrome #1-3] at /var/jenkins_home/workspace/FEproject/node_modules/selenium-webdriver/lib/promise.js:639:7
[chrome #1-3] at process._tickCallback (internal/process/next_tick.js:103:7)
[chrome #1-3] From: Task: WebDriver.createSession()
[chrome #1-3] at Function.createSession (/var/jenkins_home/workspace/FEproject/node_modules/selenium-webdriver/lib/webdriver.js:329:24)
[chrome #1-3] at Builder.build (/var/jenkins_home/workspace/FEproject/node_modules/selenium-webdriver/builder.js:458:24)
[chrome #1-3] at Hosted.DriverProvider.getNewDriver (/var/jenkins_home/workspace/FEproject/node_modules/protractor/built/driverProviders/driverProvider.js:37:33)
[chrome #1-3] at Runner.createBrowser (/var/jenkins_home/workspace/FEproject/node_modules/protractor/built/runner.js:190:43)
[chrome #1-3] at /var/jenkins_home/workspace/FEproject/node_modules/protractor/built/runner.js:264:30
[chrome #1-3] at _fulfilled (/var/jenkins_home/workspace/FEproject/node_modules/q/q.js:834:54)
[chrome #1-3] at self.promiseDispatch.done (/var/jenkins_home/workspace/FEproject/node_modules/q/q.js:863:30)
[chrome #1-3] at Promise.promise.promiseDispatch (/var/jenkins_home/workspace/FEproject/node_modules/q/q.js:796:13)
[chrome #1-3] at /var/jenkins_home/workspace/FEproject/node_modules/q/q.js:556:49
[chrome #1-3] at runSingle (/var/jenkins_home/workspace/FEproject/node_modules/q/q.js:137:13)
I have fixed the problem on my end thanks to this thread: #87
Even though they say it should have been fixed by 3.1 it does not appear to be even though we are now in 3.2
@tate-e I was encountering the same exact behavior. Docker Version 17.03.1-ce-win5 (10743), selenium/hub:3.2.0, selenium/node-chrome:3.2.0, Win10, C#/.NET bindings. Browser instances were hanging completely in my node containers and would NEVER release, eventually choking out my entire Selenium grid. I am using docker compose, so my equivalent yml looks like this now:
I've highlighted what seem in my experience to be the most important stabilizing factors. The environment value is the compose equivalent of what you listed in your straight docker run command, the shm_size is a recommendation I found mentioned at Chromium, and the volumes value comes from the SeleniumHQ docs.
@diemol We have our rancher setup with docker compose.Here is our docker compose
version: '2' services: chrome-dev: image: selenium/node-chrome:3.3.1-cesium environment: HUB_PORT_4444_TCP_ADDR: selenium-dev HUB_PORT_4444_TCP_PORT: '4444' JAVA_OPTS: -Xmx4G LOGSPOUT: ignore shm_size: 512MB DBUS_SESSION_BUS_ADDRESS: /dev/null volumes: - /dev/shm:/dev/shm labels: io.rancher.container.start_once: 'true' chrome-qa: privileged: true image: selenium/node-chrome-debug:3.3.1-cesium environment: HUB_PORT_4444_TCP_ADDR: selenium-qa HUB_PORT_4444_TCP_PORT: '4444' stdin_open: true volumes: - /dev/shm:/dev/shm tty: true links: - selenium-qa:selenium-qa - selenium-qa:selenium-qa ports: - XXXX:5900/tcp labels: io.rancher.container.pull_image: always io.rancher.container.start_once: 'true' selenium-qa: image: selenium/hub:3.3.1-cesium environment: GRID_BROWSER_TIMEOUT: '180000' GRID_MAX_SESSION: '6' GRID_TIMEOUT: '180000' volumes: - /dev/shm:/dev/shm labels: io.rancher.container.pull_image: always io.rancher.container.start_once: 'true' selenium-dev: image: selenium/hub:3.3.1-cesium environment: GRID_BROWSER_TIMEOUT: '180000' GRID_MAX_SESSION: '10' LOGSPOUT: ignore GRID_TIMEOUT: '180000' labels: io.rancher.container.pull_image: always io.rancher.container.start_once: 'true'
@thyagab I tried to indent your docker-compose file and this is what I got:
I commented those lines and then I could start it, but it is still confusing because you start two grids, but the none of the
Anyway, without checking further, I would increase
Version 3.4.0-chromium has the DBUS_SESSION issue fixed, but I had to mount /dev/shm volume to fix the page-crashes.
I'll close the issue since in several others it was reported that the issue was solved. Nevertheless, please re-open if it is still not working for you (with a way to reproduce the issue as well).