tristanpenman / docker-php-webdriver

Docker image for php-webdriver
MIT License
13 stars 1 forks source link

Connection Refused #1

Closed kaimantsch closed 7 years ago

kaimantsch commented 7 years ago

First: thanks so much for building this! I've been trying to get a docker php test solution working for days.

Issue

With your solution I'm getting:

chrome_1         | 22:10:07.001 INFO - Couldn't register this node: The hub is down or not responding: Connect to hub:80 [hub/172.20.0.2] failed: Connection refused (Connection refused)

Problem may be here:

php-webdriver_1  | Fatal error: Call to a member function close() on null in /wd/src/test/GoogleTest.php on line 26
hub_1            | 22:09:54.939 INFO - Will listen on 4444
hub_1            | 2017-03-04 22:09:55.228:INFO:osjs.Server:main: jetty-9.2.15.v20160210
hub_1            | 2017-03-04 22:09:55.408:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@77be656f{/,null,AVAILABLE}
hub_1            | 2017-03-04 22:09:55.466:INFO:osjs.ServerConnector:main: Started ServerConnector@65dbd7e7{HTTP/1.1}{0.0.0.0:4444}
hub_1            | 2017-03-04 22:09:55.467:INFO:osjs.Server:main: Started @2892ms
hub_1            | 22:09:55.468 INFO - Nodes should register to http://172.20.0.2:4444/grid/register/
hub_1            | 22:09:55.470 INFO - Selenium Grid hub is up and running
chrome_1         | 22:09:55.469 INFO - Selenium build info: version: '3.1.0', revision: '86a5d70'
chrome_1         | 22:09:55.484 INFO - Launching a Selenium Grid node
dockerphpwebdriver_php-webdriver_1 exited with code 255

Full dump:

docker-php-webdriver (master) $ docker-compose up
Starting dockerphpwebdriver_hub_1
Starting dockerphpwebdriver_firefox_1
Starting dockerphpwebdriver_chrome_1
Starting dockerphpwebdriver_php-webdriver_1
Attaching to dockerphpwebdriver_hub_1, dockerphpwebdriver_chrome_1, dockerphpwebdriver_firefox_1, dockerphpwebdriver_php-webdriver_1
hub_1            | starting selenium hub with configuration:
hub_1            |
hub_1            | {
hub_1            |   "host": null,
hub_1            |   "port": 4444,
hub_1            |   "prioritizer": null,
hub_1            |   "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
hub_1            |   "throwOnCapabilityNotPresent": true,
hub_1            |   "newSessionWaitTimeout": -1,
hub_1            |   "jettyMaxThreads": -1,
hub_1            |   "nodePolling": 5000,
hub_1            |   "cleanUpCycle": 5000,
hub_1            |   "timeout": 30,
hub_1            |   "browserTimeout": 0,
hub_1            |   "maxSession": 5,
php-webdriver_1  | Checking for entrypoint scripts directory (/scripts/entrypoint.d)...
php-webdriver_1  | Running entrypoint scripts...
hub_1            |   "unregisterIfStillDownAfter": 30000
hub_1            | }
hub_1            | 22:09:53.256 INFO - Selenium build info: version: '3.1.0', revision: '86a5d70'
hub_1            | 22:09:53.262 INFO - Launching Selenium Grid hub
hub_1            | 2017-03-04 22:09:54.812:INFO::main: Logging initialized @2236ms
php-webdriver_1  | PHPUnit 5.2.12 by Sebastian Bergmann and contributors.
php-webdriver_1  |
php-webdriver_1  |
php-webdriver_1  | Fatal error: Call to a member function close() on null in /wd/src/test/GoogleTest.php on line 26
hub_1            | 22:09:54.939 INFO - Will listen on 4444
hub_1            | 2017-03-04 22:09:55.228:INFO:osjs.Server:main: jetty-9.2.15.v20160210
hub_1            | 2017-03-04 22:09:55.408:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@77be656f{/,null,AVAILABLE}
hub_1            | 2017-03-04 22:09:55.466:INFO:osjs.ServerConnector:main: Started ServerConnector@65dbd7e7{HTTP/1.1}{0.0.0.0:4444}
hub_1            | 2017-03-04 22:09:55.467:INFO:osjs.Server:main: Started @2892ms
hub_1            | 22:09:55.468 INFO - Nodes should register to http://172.20.0.2:4444/grid/register/
hub_1            | 22:09:55.470 INFO - Selenium Grid hub is up and running
chrome_1         | 22:09:55.469 INFO - Selenium build info: version: '3.1.0', revision: '86a5d70'
chrome_1         | 22:09:55.484 INFO - Launching a Selenium Grid node
dockerphpwebdriver_php-webdriver_1 exited with code 255
firefox_1        | 22:09:55.594 INFO - Selenium build info: version: '3.1.0', revision: '86a5d70'
firefox_1        | 22:09:55.596 INFO - Launching a Selenium Grid node
chrome_1         | 22:09:56.400 WARN - error getting the parameters from the hub. The node may end up with wrong timeouts.Connect to hub:80 [hub/172.20.0.2] failed: Connection refused (Connection refused)
firefox_1        | 22:09:56.476 WARN - error getting the parameters from the hub. The node may end up with wrong timeouts.Connect to hub:80 [hub/172.20.0.2] failed: Connection refused (Connection refused)
chrome_1         | 2017-03-04 22:09:56.458:INFO::main: Logging initialized @2920ms
firefox_1        | 2017-03-04 22:09:56.550:INFO::main: Logging initialized @2659ms
chrome_1         | 22:09:56.603 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
chrome_1         |  registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform LINUX
chrome_1         | 22:09:56.605 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
chrome_1         |  registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform LINUX
chrome_1         | 22:09:56.606 INFO - Driver class not found: com.opera.core.systems.OperaDriver
chrome_1         | 22:09:56.607 INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped:
chrome_1         | Unable to create new instances on this machine.
chrome_1         | 22:09:56.609 INFO - Driver class not found: com.opera.core.systems.OperaDriver
chrome_1         | 22:09:56.610 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
chrome_1         | 22:09:56.620 INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
chrome_1         |  registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform LINUX
firefox_1        | 22:09:56.671 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
firefox_1        |  registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform LINUX
firefox_1        | 22:09:56.672 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
firefox_1        |  registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform LINUX
firefox_1        | 22:09:56.673 INFO - Driver class not found: com.opera.core.systems.OperaDriver
firefox_1        | 22:09:56.674 INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped:
firefox_1        | Unable to create new instances on this machine.
firefox_1        | 22:09:56.675 INFO - Driver class not found: com.opera.core.systems.OperaDriver
firefox_1        | 22:09:56.677 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
firefox_1        | 22:09:56.683 INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
firefox_1        |  registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform LINUX
firefox_1        | 2017-03-04 22:09:56.743:INFO:osjs.Server:main: jetty-9.2.15.v20160210
chrome_1         | 2017-03-04 22:09:56.752:INFO:osjs.Server:main: jetty-9.2.15.v20160210
firefox_1        | 2017-03-04 22:09:56.821:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@10e92f8f{/,null,AVAILABLE}
chrome_1         | 2017-03-04 22:09:56.822:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@10e92f8f{/,null,AVAILABLE}
chrome_1         | 2017-03-04 22:09:56.884:INFO:osjs.ServerConnector:main: Started ServerConnector@399bbe4d{HTTP/1.1}{0.0.0.0:5555}
chrome_1         | 2017-03-04 22:09:56.885:INFO:osjs.Server:main: Started @3348ms
chrome_1         | 22:09:56.885 INFO - Selenium Grid node is up and ready to register to the hub
firefox_1        | 2017-03-04 22:09:56.908:INFO:osjs.ServerConnector:main: Started ServerConnector@23dbf7cb{HTTP/1.1}{0.0.0.0:5555}
firefox_1        | 2017-03-04 22:09:56.908:INFO:osjs.Server:main: Started @3017ms
firefox_1        | 22:09:56.909 INFO - Selenium Grid node is up and ready to register to the hub
chrome_1         | 22:09:56.941 INFO - Starting auto registration thread. Will try to register every 5000 ms.
chrome_1         | 22:09:56.942 INFO - Registering the node to the hub: http://hub:-1/grid/register
firefox_1        | 22:09:56.944 INFO - Starting auto registration thread. Will try to register every 5000 ms.
firefox_1        | 22:09:56.946 INFO - Registering the node to the hub: http://hub:-1/grid/register
chrome_1         | 22:09:56.981 INFO - Couldn't register this node: Error sending the registration request: Connect to hub:80 [hub/172.20.0.2] failed: Connection refused (Connection refused)
firefox_1        | 22:09:56.988 INFO - Couldn't register this node: Error sending the registration request: Connect to hub:80 [hub/172.20.0.2] failed: Connection refused (Connection refused)
chrome_1         | 22:10:01.992 INFO - Couldn't register this node: The hub is down or not responding: Connect to hub:80 [hub/172.20.0.2] failed: Connection refused (Connection refused)
firefox_1        | 22:10:02.000 INFO - Couldn't register this node: The hub is down or not responding: Connect to hub:80 [hub/172.20.0.2] failed: Connection refused (Connection refused)
chrome_1         | 22:10:07.001 INFO - Couldn't register this node: The hub is down or not responding: Connect to hub:80 [hub/172.20.0.2] failed: Connection refused (Connection refused)
firefox_1        | 22:10:07.003 INFO - Couldn't register this node: The hub is down or not responding: Connect to hub:80 [hub/172.20.0.2] failed: Connection refused (Connection refused)
chrome_1         | 22:10:12.002 INFO - Couldn't register this node: The hub is down or not responding: Connect to hub:80 [hub/172.20.0.2] failed: Connection refused (Connection refused)
firefox_1        | 22:10:12.004 INFO - Couldn't register this node: The hub is down or not responding: Connect to hub:80 [hub/172.20.0.2] failed: Connection refused (Connection refused)
chrome_1         | 22:10:17.005 INFO - Couldn't register this node: The hub is down or not responding: Connect to hub:80 [hub/172.20.0.2] failed: Connection refused (Connection refused)
firefox_1        | 22:10:17.012 INFO - Couldn't register this node: The hub is down or not responding: Connect to hub:80 [hub/172.20.0.2] failed: Connection refused (Connection refused)
chrome_1         | 22:10:22.008 INFO - Couldn't register this node: The hub is down or not responding: Connect to hub:80 [hub/172.20.0.2] failed: Connection refused (Connection refused)
firefox_1        | 22:10:22.019 INFO - Couldn't register this node: The hub is down or not responding: Connect to hub:80 [hub/172.20.0.2] failed: Connection refused (Connection refused)
tristanpenman commented 7 years ago

@kaimantsch, did you have any success in resolving this issue?

tristanpenman commented 7 years ago

It turns that when using a version 2 Compose file with docker-compose, the link environment environment variables will not be set automatically. This meant that the HUB_PORT_4444_TCP_PORT environment variable was not being set.

I seem to remember this working previously, so this problem might have started after changes to the defaults used by the node-chrome or node-firefox images. I'm preparing a quick fix now, which will set the necessary environment variables.

tristanpenman commented 7 years ago

This should be fixed in commit 5979bde.

kaimantsch commented 7 years ago

Yes (reply to above) your fix worked. I haven't tried the latest version but I'll be writing and running some new tests next week.