Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: DevToolsActivePort file doesn't exist #2164

Closed
elnath78 opened this issue Mar 10, 2024 · 25 comments
Closed

[🐛 Bug]: DevToolsActivePort file doesn't exist #2164

elnath78 opened this issue Mar 10, 2024 · 25 comments

Comments

@elnath78
Copy link

What happened?

Connecting to a selenium+docker version 4.18.1-20240224 I updated my sample code to reflect capabilities, but I still get the above error when trying to connect to a website.

//Set Up Chrome Options
$chromeOptions = new ChromeOptions();
$chromeOptions->setExperimentalOption('w3c', false);
$chromeOptions->addArguments($args);
//Set Capabilities
$seleniumCapabilities = DesiredCapabilities::chrome();
$seleniumCapabilities->setCapability('acceptSslCerts', false);
//Create Selenium Connection
$driver = RemoteWebDriver::create($seleniumHost, $seleniumCapabilities);
//Go To URL
$url="https://en.wikipedia.org/wiki/Selenium_(software)";
$driver->navigate()->to($url);
//Exit, do nothing just pray connection works
$driver->quit();

### Command used to start Selenium Grid with Docker (or Kubernetes)

```shell
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3.yml down`
version: "3"
services:
  chrome:
    image: selenium/node-chrome:4.18.1-20240224
    shm_size: 2gb
    depends_on:
      - selenium-hub
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443

  edge:
    image: selenium/node-edge:4.18.1-20240224
    shm_size: 2gb
    depends_on:
      - selenium-hub
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443

  firefox:
    image: selenium/node-firefox:4.18.1-20240224
    shm_size: 2gb
    depends_on:
      - selenium-hub
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443

  selenium-hub:
    image: selenium/hub:4.18.1-20240224
    container_name: selenium-hub
    ports:
      - "4442:4442"
      - "4443:4443"
      - "4444:4444"

Relevant log output

Fatal error: Uncaught Facebook\WebDriver\Exception\SessionNotCreatedException: Could not start a new session. Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: DevToolsActivePort file doesn't exist Host info: host: 'd1a93cda54a8', ip: '172.18.0.5' Build info: version: '4.18.1', revision: 'b1d3319b48' System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21' Driver info: driver.version: unknown Build info: version: '4.18.1', revision: 'b1d3319b48' System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21' Driver info: driver.version: unknown Build info: version: '4.18.1', revision: 'b1d3319b48' System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21' Driver info: driver.version: unknown in C:\xampp\htdocs\redacted\vendor\php-webdriver\webdriver\lib\Exception\WebDriverException.php on line 130

Operating System

Ubuntu

Docker Selenium version (image tag)

4.18.1-20240224

Selenium Grid chart version (chart version)

unknow?

Copy link

@elnath78, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@VietND96
Copy link
Member

Following SeleniumHQ/selenium#10448. It looks like due to ('w3c', false) is set

@elnath78
Copy link
Author

elnath78 commented Mar 10, 2024

Following SeleniumHQ/selenium#10448. It looks like due to ('w3c', false) is set

This was a leftover from 4.2.2-20220609 the guide I was following said: We’re going to want to disable w3c mode. This can cause some errors in my experience, so I recommend disabling it. I commented this line out and got Fatal error: Maximum execution time of 120 seconds exceeded in C:\xampp\htdocs\redacted\vendor\php-webdriver\webdriver\lib\Remote\HttpCommandExecutor.php on line 325 with callstack leading to Facebook\WebDriver\Remote\HttpCommandExecutor->execute( $command = class Facebook\WebDriver\Remote\WebDriverCommand { protected $sessionID = NULL; protected $name = 'newSession'; protected $parameters = ['capabilities' => [...], 'desiredCapabilities' => class stdClass { ... }] } ) | ...\RemoteWebDriver.php:129

edit: I noticed that $chromeOptions is not actually being used, so the new error is not caused by commenting this line.

@VietND96
Copy link
Member

So how about the version of binding? is it still 4.2.x or upgraded 4.18.x same as server side?

@elnath78
Copy link
Author

So how about the version of binding? is it still 4.2.x or upgraded 4.18.x same as server side?

All updated, I also tried running this https://github.com/php-webdriver/php-webdriver/blob/main/example.php but again same problems.

@VietND96
Copy link
Member

@diemol, do you know about this?

@diemol
Copy link
Member

diemol commented Mar 11, 2024

Most of the time, when this happens, it is something related to the host. It is not clear if you are using Ubuntu or Windows.

Can you share the Grid logs so we can see the capabilities being sent?

@elnath78
Copy link
Author

@diemol this is the grid starting, I added the user: directive because I read this bug was caused by launching the grid as root

Starting selenium-hub ... done
Starting selenium_edge_1    ... done
Starting selenium_firefox_1 ... done
Starting selenium_chrome_1  ... done
Attaching to selenium-hub, selenium_firefox_1, selenium_chrome_1, selenium_edge_1
selenium-hub    | 2024-03-11 12:08:40,164 INFO Included extra file "/etc/supervisor/conf.d/selenium-grid-hub.conf" during parsing
selenium-hub    | 2024-03-11 12:08:40,185 INFO RPC interface 'supervisor' initialized
selenium-hub    | 2024-03-11 12:08:40,185 CRIT Server 'unix_http_server' running without any HTTP authentication checking
selenium-hub    | 2024-03-11 12:08:40,188 INFO supervisord started with pid 7
selenium-hub    | 2024-03-11 12:08:41,192 INFO spawned: 'selenium-grid-hub' with pid 8
selenium-hub    | Appending Selenium options: --reject-unsupported-caps false
selenium-hub    | 2024-03-11 12:08:41,238 INFO success: selenium-grid-hub entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
selenium-hub    | Tracing is disabled
firefox_1       | 2024-03-11 12:08:41,868 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing
firefox_1       | 2024-03-11 12:08:41,886 INFO RPC interface 'supervisor' initialized
firefox_1       | 2024-03-11 12:08:41,899 CRIT Server 'unix_http_server' running without any HTTP authentication checking
firefox_1       | 2024-03-11 12:08:41,902 INFO supervisord started with pid 8
chrome_1        | 2024-03-11 12:08:42,306 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing
edge_1          | 2024-03-11 12:08:42,326 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing
chrome_1        | 2024-03-11 12:08:42,328 INFO RPC interface 'supervisor' initialized
chrome_1        | 2024-03-11 12:08:42,330 CRIT Server 'unix_http_server' running without any HTTP authentication checking
chrome_1        | 2024-03-11 12:08:42,332 INFO supervisord started with pid 8
edge_1          | 2024-03-11 12:08:42,342 INFO RPC interface 'supervisor' initialized
edge_1          | 2024-03-11 12:08:42,346 CRIT Server 'unix_http_server' running without any HTTP authentication checking
edge_1          | 2024-03-11 12:08:42,348 INFO supervisord started with pid 8
firefox_1       | 2024-03-11 12:08:42,909 INFO spawned: 'xvfb' with pid 9
firefox_1       | 2024-03-11 12:08:42,936 INFO spawned: 'vnc' with pid 10
firefox_1       | 2024-03-11 12:08:42,971 INFO spawned: 'novnc' with pid 11
firefox_1       | 2024-03-11 12:08:43,019 INFO spawned: 'selenium-node' with pid 13
firefox_1       | 2024-03-11 12:08:43,070 INFO success: selenium-node entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
chrome_1        | 2024-03-11 12:08:43,336 INFO spawned: 'xvfb' with pid 9
edge_1          | 2024-03-11 12:08:43,352 INFO spawned: 'xvfb' with pid 9
chrome_1        | 2024-03-11 12:08:43,361 INFO spawned: 'vnc' with pid 10
chrome_1        | 2024-03-11 12:08:43,385 INFO spawned: 'novnc' with pid 11
edge_1          | 2024-03-11 12:08:43,406 INFO spawned: 'vnc' with pid 10
edge_1          | 2024-03-11 12:08:43,413 INFO spawned: 'novnc' with pid 11
chrome_1        | 2024-03-11 12:08:43,438 INFO spawned: 'selenium-node' with pid 12
firefox_1       | E: [pulseaudio] main.c: Daemon startup failed.
edge_1          | 2024-03-11 12:08:43,516 INFO spawned: 'selenium-node' with pid 12
chrome_1        | 2024-03-11 12:08:43,594 INFO success: selenium-node entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
edge_1          | 2024-03-11 12:08:43,599 INFO success: selenium-node entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
firefox_1       | No PulseAudio daemon running, or not running as session daemon.
firefox_1       | No PulseAudio daemon running, or not running as session daemon.
firefox_1       | No PulseAudio daemon running, or not running as session daemon.
firefox_1       | Appending Selenium options: --session-timeout 300
firefox_1       | Appending Selenium options: --heartbeat-period 30
firefox_1       | Generating Selenium Config
firefox_1       | 2024-03-11 12:08:43,938 INFO success: xvfb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
firefox_1       | 2024-03-11 12:08:43,940 INFO success: vnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
chrome_1        | E: [pulseaudio] main.c: Daemon startup failed.
firefox_1       | Configuring server...
firefox_1       | 2024-03-11 12:08:44,022 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
firefox_1       | Setting up SE_NODE_HOST...
firefox_1       | Setting up SE_NODE_PORT...
firefox_1       | Setting up SE_NODE_GRID_URL...
edge_1          | E: [pulseaudio] main.c: Daemon startup failed.
chrome_1        | No PulseAudio daemon running, or not running as session daemon.
edge_1          | No PulseAudio daemon running, or not running as session daemon.
firefox_1       | Tracing is disabled
firefox_1       | Selenium Grid Node configuration:
firefox_1       | [events]
firefox_1       | publish = "tcp://selenium-hub:4442"
firefox_1       | subscribe = "tcp://selenium-hub:4443"
firefox_1       |
firefox_1       | [node]
firefox_1       | session-timeout = "300"
firefox_1       | override-max-sessions = false
firefox_1       | detect-drivers = false
firefox_1       | drain-after-session-count = 0
firefox_1       | max-sessions = 1
firefox_1       |
firefox_1       | [[node.driver-configuration]]
firefox_1       | display-name = "firefox"
firefox_1       | stereotype = '{"browserName": "firefox", "browserVersion": "123.0", "platformName": "Linux", "moz:firefoxOptions": {"binary": "/usr/bin/firefox"}}'
firefox_1       | max-sessions = 1
firefox_1       |
firefox_1       | Starting Selenium Grid Node...
chrome_1        | No PulseAudio daemon running, or not running as session daemon.
edge_1          | No PulseAudio daemon running, or not running as session daemon.
chrome_1        | No PulseAudio daemon running, or not running as session daemon.
chrome_1        | 2024-03-11 12:08:44,398 INFO success: xvfb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
chrome_1        | 2024-03-11 12:08:44,399 INFO success: vnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
chrome_1        | 2024-03-11 12:08:44,400 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
edge_1          | No PulseAudio daemon running, or not running as session daemon.
chrome_1        | Appending Selenium options: --session-timeout 300
chrome_1        | Appending Selenium options: --heartbeat-period 30
chrome_1        | Generating Selenium Config
edge_1          | 2024-03-11 12:08:44,437 INFO success: xvfb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
edge_1          | 2024-03-11 12:08:44,437 INFO success: vnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
edge_1          | 2024-03-11 12:08:44,439 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
edge_1          | Appending Selenium options: --session-timeout 300
edge_1          | Appending Selenium options: --heartbeat-period 30
edge_1          | Generating Selenium Config
chrome_1        | Configuring server...
chrome_1        | Setting up SE_NODE_HOST...
chrome_1        | Setting up SE_NODE_PORT...
chrome_1        | Setting up SE_NODE_GRID_URL...
chrome_1        | Tracing is disabled
chrome_1        | Selenium Grid Node configuration:
chrome_1        | [events]
chrome_1        | publish = "tcp://selenium-hub:4442"
chrome_1        | subscribe = "tcp://selenium-hub:4443"
chrome_1        |
chrome_1        | [node]
chrome_1        | session-timeout = "300"
chrome_1        | override-max-sessions = false
chrome_1        | detect-drivers = false
chrome_1        | drain-after-session-count = 0
chrome_1        | max-sessions = 1
chrome_1        |
chrome_1        | [[node.driver-configuration]]
chrome_1        | display-name = "chrome"
chrome_1        | stereotype = '{"browserName": "chrome", "browserVersion": "122.0", "platformName": "Linux", "goog:chromeOptions": {"binary": "/usr/bin/google-chrome"}}'
chrome_1        | max-sessions = 1
chrome_1        |
edge_1          | Configuring server...
edge_1          | Setting up SE_NODE_HOST...
edge_1          | Setting up SE_NODE_PORT...
edge_1          | Setting up SE_NODE_GRID_URL...
chrome_1        | Starting Selenium Grid Node...
edge_1          | Tracing is disabled
edge_1          | Selenium Grid Node configuration:
edge_1          | [events]
edge_1          | publish = "tcp://selenium-hub:4442"
edge_1          | subscribe = "tcp://selenium-hub:4443"
edge_1          |
edge_1          | [node]
edge_1          | session-timeout = "300"
edge_1          | override-max-sessions = false
edge_1          | detect-drivers = false
edge_1          | drain-after-session-count = 0
edge_1          | max-sessions = 1
edge_1          |
edge_1          | [[node.driver-configuration]]
edge_1          | display-name = "MicrosoftEdge"
edge_1          | stereotype = '{"browserName": "MicrosoftEdge", "browserVersion": "122.0", "platformName": "Linux", "ms:edgeOptions": {"binary": "/usr/bin/microsoft-edge"}}'
edge_1          | max-sessions = 1
edge_1          |
edge_1          | Starting Selenium Grid Node...
selenium-hub    | 12:08:46.674 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
selenium-hub    | 12:08:46.784 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
selenium-hub    | 12:08:48.507 INFO [BoundZmqEventBus.<init>] - XPUB binding to [binding to tcp://*:4442, advertising as tcp://172.18.0.2:4442], XSUB binding to [binding to tcp://*:4443, advertising as tcp://172.18.0.2:4443]
selenium-hub    | 12:08:49.371 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://172.18.0.2:4442 and tcp://172.18.0.2:4443
selenium-hub    | 12:08:49.716 INFO [UnboundZmqEventBus.<init>] - Sockets created
selenium-hub    | 12:08:50.735 INFO [UnboundZmqEventBus.<init>] - Event bus ready
firefox_1       | 12:08:53.722 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
firefox_1       | 12:08:53.799 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
chrome_1        | 12:08:53.870 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
chrome_1        | 12:08:54.011 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
edge_1          | 12:08:54.162 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
edge_1          | 12:08:54.244 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
chrome_1        | 12:08:56.360 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://selenium-hub:4442 and tcp://selenium-hub:4443
firefox_1       | 12:08:56.395 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://selenium-hub:4442 and tcp://selenium-hub:4443
edge_1          | 12:08:56.503 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://selenium-hub:4442 and tcp://selenium-hub:4443
firefox_1       | 12:08:57.334 INFO [UnboundZmqEventBus.<init>] - Sockets created
chrome_1        | 12:08:57.362 INFO [UnboundZmqEventBus.<init>] - Sockets created
edge_1          | 12:08:57.443 INFO [UnboundZmqEventBus.<init>] - Sockets created
firefox_1       | 12:08:58.437 INFO [UnboundZmqEventBus.<init>] - Event bus ready
chrome_1        | 12:08:58.455 INFO [UnboundZmqEventBus.<init>] - Event bus ready
edge_1          | 12:08:58.565 INFO [UnboundZmqEventBus.<init>] - Event bus ready
selenium-hub    | 12:09:00.392 INFO [Hub.execute] - Started Selenium Hub 4.18.1 (revision b1d3319b48): http://172.18.0.2:4444
chrome_1        | 12:09:00.589 INFO [NodeServer.createHandlers] - Reporting self as: http://172.18.0.4:5555
firefox_1       | 12:09:00.595 INFO [NodeServer.createHandlers] - Reporting self as: http://172.18.0.3:5555
edge_1          | 12:09:00.628 INFO [NodeServer.createHandlers] - Reporting self as: http://172.18.0.5:5555
chrome_1        | 12:09:00.828 INFO [NodeOptions.getSessionFactories] - Detected 1 available processors
firefox_1       | 12:09:00.827 INFO [NodeOptions.getSessionFactories] - Detected 1 available processors
edge_1          | 12:09:00.942 INFO [NodeOptions.getSessionFactories] - Detected 1 available processors
firefox_1       | 12:09:01.654 INFO [NodeOptions.report] - Adding firefox for {"browserName": "firefox","browserVersion": "123.0","moz:firefoxOptions": {"binary": "\u002fusr\u002fbin\u002ffirefox"},"platformName": "linux","se:noVncPort": 7900,"se:vncEnabled": true} 1 times
chrome_1        | 12:09:01.698 INFO [NodeOptions.report] - Adding chrome for {"browserName": "chrome","browserVersion": "122.0","goog:chromeOptions": {"binary": "\u002fusr\u002fbin\u002fgoogle-chrome"},"platformName": "linux","se:noVncPort": 7900,"se:vncEnabled": true} 1 times
edge_1          | 12:09:01.879 INFO [NodeOptions.report] - Adding MicrosoftEdge for {"browserName": "MicrosoftEdge","browserVersion": "122.0","ms:edgeOptions": {"binary": "\u002fusr\u002fbin\u002fmicrosoft-edge"},"platformName": "linux","se:noVncPort": 7900,"se:vncEnabled": true} 1 times
firefox_1       | 12:09:02.125 INFO [Node.<init>] - Binding additional locator mechanisms: relative
chrome_1        | 12:09:02.191 INFO [Node.<init>] - Binding additional locator mechanisms: relative
edge_1          | 12:09:02.306 INFO [Node.<init>] - Binding additional locator mechanisms: relative
firefox_1       | 12:09:04.064 INFO [NodeServer$1.start] - Starting registration process for Node http://172.18.0.3:5555
firefox_1       | 12:09:04.079 INFO [NodeServer.execute] - Started Selenium node 4.18.1 (revision b1d3319b48): http://172.18.0.3:5555
chrome_1        | 12:09:04.081 INFO [NodeServer$1.start] - Starting registration process for Node http://172.18.0.4:5555
chrome_1        | 12:09:04.097 INFO [NodeServer.execute] - Started Selenium node 4.18.1 (revision b1d3319b48): http://172.18.0.4:5555
edge_1          | 12:09:04.154 INFO [NodeServer$1.start] - Starting registration process for Node http://172.18.0.5:5555
edge_1          | 12:09:04.180 INFO [NodeServer.execute] - Started Selenium node 4.18.1 (revision b1d3319b48): http://172.18.0.5:5555
firefox_1       | 12:09:04.227 INFO [NodeServer$1.lambda$start$1] - Sending registration event...
chrome_1        | 12:09:04.252 INFO [NodeServer$1.lambda$start$1] - Sending registration event...
edge_1          | 12:09:04.350 INFO [NodeServer$1.lambda$start$1] - Sending registration event...
selenium-hub    | 12:09:04.611 INFO [Node.<init>] - Binding additional locator mechanisms: relative
selenium-hub    | 12:09:06.709 INFO [GridModel.setAvailability] - Switching Node 7c982433-a33e-4497-bcbb-1a624b2b9b99 (uri: http://172.18.0.3:5555) from DOWN to UP
selenium-hub    | 12:09:06.715 INFO [LocalDistributor.add] - Added node 7c982433-a33e-4497-bcbb-1a624b2b9b99 at http://172.18.0.3:5555. Health check every 120s
firefox_1       | 12:09:06.819 INFO [NodeServer.lambda$createHandlers$2] - Node has been added
selenium-hub    | 12:09:06.874 INFO [Node.<init>] - Binding additional locator mechanisms: relative
selenium-hub    | 12:09:07.690 INFO [GridModel.setAvailability] - Switching Node 58ffc975-1a70-48b1-922f-5cdba6f2fc69 (uri: http://172.18.0.4:5555) from DOWN to UP
selenium-hub    | 12:09:07.702 INFO [LocalDistributor.add] - Added node 58ffc975-1a70-48b1-922f-5cdba6f2fc69 at http://172.18.0.4:5555. Health check every 120s
chrome_1        | 12:09:07.743 INFO [NodeServer.lambda$createHandlers$2] - Node has been added
selenium-hub    | 12:09:07.847 INFO [Node.<init>] - Binding additional locator mechanisms: relative
selenium-hub    | 12:09:08.563 INFO [GridModel.setAvailability] - Switching Node 5f4d35e0-a2f7-4dab-ba01-cf7955bd1a7f (uri: http://172.18.0.5:5555) from DOWN to UP
selenium-hub    | 12:09:08.567 INFO [LocalDistributor.add] - Added node 5f4d35e0-a2f7-4dab-ba01-cf7955bd1a7f at http://172.18.0.5:5555. Health check every 120s
edge_1          | 12:09:08.588 INFO [NodeServer.lambda$createHandlers$2] - Node has been added

This is the request, I used the example found here https://github.com/php-webdriver/php-webdriver/blob/main/example.php for this test I didn't use the -d so docker-compose up inside selenium folder with .yml file:

selenium-hub    | 12:09:40.632 INFO [LocalDistributor.newSession] - Session request received by the Distributor:
selenium-hub    |  [Capabilities {browserName: chrome}]
chrome_1        | 12:10:43.482 WARN [DriverServiceSessionFactory.apply] - Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: DevToolsActivePort file doesn't exist
chrome_1        | Host info: host: '0c14e9bed9e9', ip: '172.18.0.4'
chrome_1        | Build info: version: '4.18.1', revision: 'b1d3319b48'
chrome_1        | System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'
chrome_1        | Driver info: driver.version: unknown
chrome_1        | 12:10:43.617 WARN [SeleniumSpanExporter$1.lambda$export$1] - org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: DevToolsActivePort file doesn't exist
chrome_1        | Host info: host: '0c14e9bed9e9', ip: '172.18.0.4'
chrome_1        | Build info: version: '4.18.1', revision: 'b1d3319b48'
chrome_1        | System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'
chrome_1        | Driver info: driver.version: unknown
chrome_1        |       at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:139)
chrome_1        |       at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:95)
chrome_1        |       at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:67)
chrome_1        |       at org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:162)
chrome_1        |       at org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:72)
chrome_1        |       at org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)
chrome_1        |       at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:464)
chrome_1        |       at org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:50)
chrome_1        |       at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)
chrome_1        |       at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
chrome_1        |       at org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:62)
chrome_1        |       at org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:87)
chrome_1        |       at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
chrome_1        |       at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:346)
chrome_1        |       at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
chrome_1        |       at org.openqa.selenium.grid.node.Node.execute(Node.java:262)
chrome_1        |       at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:346)
chrome_1        |       at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
chrome_1        |       at org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:35)
chrome_1        |       at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)
chrome_1        |       at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
chrome_1        |       at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)
chrome_1        |       at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
chrome_1        |       at org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:44)
chrome_1        |       at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
chrome_1        |       at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
chrome_1        |       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
chrome_1        |       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
chrome_1        |       at java.base/java.lang.Thread.run(Thread.java:829)
chrome_1        |
chrome_1        | 12:10:43.621 WARN [SeleniumSpanExporter$1.lambda$export$1] - Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: DevToolsActivePort file doesn't exist
chrome_1        | Host info: host: '0c14e9bed9e9', ip: '172.18.0.4'
chrome_1        | Build info: version: '4.18.1', revision: 'b1d3319b48'
chrome_1        | System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'
chrome_1        | Driver info: driver.version: unknown
chrome_1        | 12:10:43.674 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "a967dd73c6eab175c6670ee64f410933","eventTime": 1710159043487746775,"eventName": "exception","attributes": {"driver.url": "http:\u002f\u002flocalhost:4592","exception.message": "Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: DevToolsActivePort file doesn't exist \nHost info: host: '0c14e9bed9e9', ip: '172.18.0.4'\nBuild info: version: '4.18.1', revision: 'b1d3319b48'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: DevToolsActivePort file doesn't exist \nHost info: host: '0c14e9bed9e9', ip: '172.18.0.4'\nBuild info: version: '4.18.1', revision: 'b1d3319b48'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:139)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:95)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:67)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:162)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:72)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:464)\n\tat org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:50)\n\tat org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:62)\n\tat org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:87)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:346)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.node.Node.execute(Node.java:262)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:346)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:35)\n\tat org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)\n\tat org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)\n\tat org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:44)\n\tat java.base\u002fjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)\n\tat java.base\u002fjava.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:829)\n","exception.type": "org.openqa.selenium.SessionNotCreatedException","logger": "org.openqa.selenium.grid.node.config.DriverServiceSessionFactory","session.capabilities": "{\"browserName\": \"chrome\",\"browserVersion\": \"122.0\",\"goog:chromeOptions\": {\"binary\": \"\\u002fusr\\u002fbin\\u002fgoogle-chrome\"},\"platformName\": \"linux\",\"se:noVncPort\": 7900,\"se:vncEnabled\": true}\n"}}
chrome_1        |
chrome_1        | 12:10:43.681 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "a967dd73c6eab175c6670ee64f410933","eventTime": 1710159043677554850,"eventName": "Unable to create session with the driver","attributes": {"current.session.count": 0,"logger": "org.openqa.selenium.grid.node.local.LocalNode","session.request.capabilities": "Capabilities {browserName: chrome}","session.request.downstreamdialect": "[W3C]"}}
chrome_1        |
selenium-hub    | 12:10:43.818 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "a967dd73c6eab175c6670ee64f410933","eventTime": 1710158980629763039,"eventName": "Session request received by the Distributor","attributes": {"logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {browserName: chrome}]"}}
selenium-hub    |
selenium-hub    | 12:10:43.830 WARN [SeleniumSpanExporter$1.lambda$export$1] - org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: DevToolsActivePort file doesn't exist
selenium-hub    | Host info: host: '0c14e9bed9e9', ip: '172.18.0.4'
selenium-hub    | Build info: version: '4.18.1', revision: 'b1d3319b48'
selenium-hub    | System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'
selenium-hub    | Driver info: driver.version: unknown
selenium-hub    | Build info: version: '4.18.1', revision: 'b1d3319b48'
selenium-hub    | System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'
selenium-hub    | Driver info: driver.version: unknown
selenium-hub    | Build info: version: '4.18.1', revision: 'b1d3319b48'
selenium-hub    | System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'
selenium-hub    | Driver info: driver.version: unknown
selenium-hub    |       at org.openqa.selenium.grid.node.remote.RemoteNode.newSession(RemoteNode.java:152)
selenium-hub    |       at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:651)
selenium-hub    |       at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:570)
selenium-hub    |       at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:830)
selenium-hub    |       at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:790)
selenium-hub    |       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
selenium-hub    |       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
selenium-hub    |       at java.base/java.lang.Thread.run(Thread.java:829)
selenium-hub    |
selenium-hub    | 12:10:43.835 WARN [SeleniumSpanExporter$1.lambda$export$1] - Unable to create session: Could not start a new session. Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: DevToolsActivePort file doesn't exist
selenium-hub    | Host info: host: '0c14e9bed9e9', ip: '172.18.0.4'
selenium-hub    | Build info: version: '4.18.1', revision: 'b1d3319b48'
selenium-hub    | System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'
selenium-hub    | Driver info: driver.version: unknown
selenium-hub    | Build info: version: '4.18.1', revision: 'b1d3319b48'
selenium-hub    | System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'
selenium-hub    | Driver info: driver.version: unknown
selenium-hub    | Build info: version: '4.18.1', revision: 'b1d3319b48'
selenium-hub    | System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'
selenium-hub    | Driver info: driver.version: unknown
selenium-hub    | 12:10:43.837 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "a967dd73c6eab175c6670ee64f410933","eventTime": 1710159043796840956,"eventName": "exception","attributes": {"exception.message": "Unable to create session: Could not start a new session. Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: DevToolsActivePort file doesn't exist \nHost info: host: '0c14e9bed9e9', ip: '172.18.0.4'\nBuild info: version: '4.18.1', revision: 'b1d3319b48'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'\nDriver info: driver.version: unknown\nBuild info: version: '4.18.1', revision: 'b1d3319b48'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'\nDriver info: driver.version: unknown\nBuild info: version: '4.18.1', revision: 'b1d3319b48'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: DevToolsActivePort file doesn't exist \nHost info: host: '0c14e9bed9e9', ip: '172.18.0.4'\nBuild info: version: '4.18.1', revision: 'b1d3319b48'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'\nDriver info: driver.version: unknown\nBuild info: version: '4.18.1', revision: 'b1d3319b48'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'\nDriver info: driver.version: unknown\nBuild info: version: '4.18.1', revision: 'b1d3319b48'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.node.remote.RemoteNode.newSession(RemoteNode.java:152)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:651)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:570)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:830)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:790)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:829)\n","exception.type": "org.openqa.selenium.SessionNotCreatedException","logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {browserName: chrome}]"}}
selenium-hub    |
selenium-hub    | 12:10:43.878 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "a967dd73c6eab175c6670ee64f410933","eventTime": 1710159043871607366,"eventName": "HTTP request execution complete","attributes": {"http.flavor": 1,"http.handler_class": "org.openqa.selenium.grid.sessionqueue.local.LocalNewSessionQueue","http.host": "*ip redacted*:4444","http.method": "POST","http.request_content_length": "122","http.scheme": "HTTP","http.status_code": 500,"http.target": "\u002fsession"}}

@diemol
Copy link
Member

diemol commented Mar 11, 2024

A few questions:

  • Does this only happen on your Windows host? Have you tried anywhere else?
  • Does this happen if you use one of the Selenium bindings? Not the PHP one.
  • What happens if you use the below command to create a session?
curl -XPOST --header "Content-Type: application/json; charset=utf-8" http://localhost:4444/session -d '{"capabilities": {"alwaysMatch": {"browserName": "chrome"}}}'

@elnath78
Copy link
Author

A few questions:

* Does this only happen on your Windows host? Have you tried anywhere else?

Testin on Windows with XAMPP

* Does this happen if you use one of the Selenium bindings? Not the PHP one.

Did not try, I'm using php option to simplify communication with other app parts that are also in php

* What happens if you use the below command to create a session?
curl -XPOST --header "Content-Type: application/json; charset=utf-8" http://localhost:4444/session -d '{"capabilities": {"alwaysMatch": {"browserName": "chrome"}}}'

curl: (56) Recv failure: Connection reset by peer

@diemol
Copy link
Member

diemol commented Mar 11, 2024

Can you try it on any other host and with one of the Selenium bindings?

Regarding the curl command, is the Grid running on localhost:4444?

@elnath78
Copy link
Author

Can you try it on any other host and with one of the Selenium bindings?

Not at this time.

Regarding the curl command, is the Grid running on localhost:4444?

# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3.yml down`
version: "3"
services:
  chrome:
    image: selenium/node-chrome:4.18.1-20240224
    shm_size: 2gb
    depends_on:
      - selenium-hub
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
    user: seluser

  edge:
    image: selenium/node-edge:4.18.1-20240224
    shm_size: 2gb
    depends_on:
      - selenium-hub
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
    user: seluser

  firefox:
    image: selenium/node-firefox:4.18.1-20240224
    shm_size: 2gb
    depends_on:
      - selenium-hub
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
    user: seluser

  selenium-hub:
    image: selenium/hub:4.18.1-20240224
    container_name: selenium-hub
    ports:
      - "4442:4442"
      - "4443:4443"
      - "4444:4444"

@diemol
Copy link
Member

diemol commented Mar 11, 2024

What does that docker-compose file mean? I failed to understand your answers.

I am not sure why the curl command is failing, but perhaps you can use an API client to send this payload:

curl --request POST \
  --url http://localhost:4444/session \
  --header 'Content-Type: application/json; charset=utf-8' \
  --data '{
  "capabilities": {
		"alwaysMatch": {
			"browserName": "chrome"
		},
    "firstMatch": [{}]
  }
}'

This is what I use: https://insomnia.rest/download

@elnath78
Copy link
Author

What does that docker-compose file mean? I failed to understand your answers.

Showing it was running on localhost:4444

I am not sure why the curl command is failing, but perhaps you can use an API client to send this payload:

This is the answer:

{
  "value": {
    "error": "session not created",
    "message": "Could not start a new session. Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: DevToolsActivePort file doesn't exist \nHost info: host: 'b64b9daf4b62', ip: '172.18.0.4'\nBuild info: version: '4.18.1', revision: 'b1d3319b48'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'\nDriver info: driver.version: unknown\nBuild info: version: '4.18.1', revision: 'b1d3319b48'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'\nDriver info: driver.version: unknown\nBuild info: version: '4.18.1', revision: 'b1d3319b48'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'\nDriver info: driver.version: unknown",
    "stacktrace": [
      {
        "fileName": "RemoteNode.java",
        "moduleVersion": null,
        "moduleName": null,
        "nativeMethod": false,
        "methodName": "newSession",
        "className": "org.openqa.selenium.grid.node.remote.RemoteNode",
        "lineNumber": 152,
        "classLoaderName": "app"
      },
      {
        "fileName": "LocalDistributor.java",
        "moduleVersion": null,
        "moduleName": null,
        "nativeMethod": false,
        "methodName": "startSession",
        "className": "org.openqa.selenium.grid.distributor.local.LocalDistributor",
        "lineNumber": 651,
        "classLoaderName": "app"
      },
      {
        "fileName": "LocalDistributor.java",
        "moduleVersion": null,
        "moduleName": null,
        "nativeMethod": false,
        "methodName": "newSession",
        "className": "org.openqa.selenium.grid.distributor.local.LocalDistributor",
        "lineNumber": 570,
        "classLoaderName": "app"
      },
      {
        "fileName": "LocalDistributor.java",
        "moduleVersion": null,
        "moduleName": null,
        "nativeMethod": false,
        "methodName": "handleNewSessionRequest",
        "className": "org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable",
        "lineNumber": 830,
        "classLoaderName": "app"
      },
      {
        "fileName": "LocalDistributor.java",
        "moduleVersion": null,
        "moduleName": null,
        "nativeMethod": false,
        "methodName": "lambda$run$1",
        "className": "org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable",
        "lineNumber": 790,
        "classLoaderName": "app"
      },
      {
        "fileName": "ThreadPoolExecutor.java",
        "moduleVersion": "11.0.21",
        "moduleName": "java.base",
        "nativeMethod": false,
        "methodName": "runWorker",
        "className": "java.util.concurrent.ThreadPoolExecutor",
        "lineNumber": 1128,
        "classLoaderName": null
      },
      {
        "fileName": "ThreadPoolExecutor.java",
        "moduleVersion": "11.0.21",
        "moduleName": "java.base",
        "nativeMethod": false,
        "methodName": "run",
        "className": "java.util.concurrent.ThreadPoolExecutor$Worker",
        "lineNumber": 628,
        "classLoaderName": null
      },
      {
        "fileName": "Thread.java",
        "moduleVersion": "11.0.21",
        "moduleName": "java.base",
        "nativeMethod": false,
        "methodName": "run",
        "className": "java.lang.Thread",
        "lineNumber": 829,
        "classLoaderName": null
      }
    ]
  }

@diemol
Copy link
Member

diemol commented Mar 11, 2024

That means the issue is not on the PHP code. I think now it has to be something related to your host. Whenever you can, please try in a different one and let us know.

@elnath78
Copy link
Author

elnath78 commented Mar 11, 2024

That means the issue is not on the PHP code. I think now it has to be something related to your host. Whenever you can, please try in a different one and let us know.

I can on another machine but still with php, this was the answer from Cloudflare, the VPS with selenium is not under cloudflare:

Error 524: A timeout occurred

This was the grid output:

selenium-hub    | 13:09:28.262 INFO [LocalDistributor.newSession] - Session request received by the Distributor:
selenium-hub    |  [Capabilities {browserName: chrome}]
selenium-hub    | 13:11:28.917 INFO [GridModel.purgeDeadNodes] - Switching Node http://172.19.0.4:5555 from UP to DOWN
selenium-hub    | 13:14:30.080 INFO [GridModel.purgeDeadNodes] - Switching Node http://172.19.0.5:5555 from UP to DOWN
selenium-hub    | 13:14:32.709 INFO [GridModel.purgeDeadNodes] - Switching Node http://172.19.0.3:5555 from UP to DOWN
chrome_1        | 13:15:55.205 WARN [DriverServiceSessionFactory.apply] - Error while creating session with the driver service. Stopping driver service: java.util.concurrent.TimeoutException
chrome_1        | Build info: version: '4.18.1', revision: 'b1d3319b48'
chrome_1        | System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'
chrome_1        | Driver info: driver.version: unknown
selenium-hub    | 13:15:56.160 INFO [LocalDistributor.newSession] - Session request received by the Distributor:
selenium-hub    |  [Capabilities {browserName: chrome}]
selenium-hub    | 13:16:06.080 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "233684826eb231b11899c13858fa631b","eventTime": 1710162568258889133,"eventName": "Session request received by the Distributor","attributes": {"logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {browserName: chrome}]"}}
selenium-hub    |
selenium-hub    | 13:16:07.419 WARN [SeleniumSpanExporter$1.lambda$export$1] - org.openqa.selenium.SessionNotCreatedException: Could not start a new session. java.util.concurrent.TimeoutException
selenium-hub    | Build info: version: '4.18.1', revision: 'b1d3319b48'
selenium-hub    | System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'
selenium-hub    | Driver info: driver.version: unknown
selenium-hub    | Host info: host: '8e7beada09f2', ip: '172.19.0.2'
selenium-hub    |       at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:655)
selenium-hub    |       at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:570)
selenium-hub    |       at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:830)
selenium-hub    |       at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:790)
selenium-hub    |       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
selenium-hub    |       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
selenium-hub    |       at java.base/java.lang.Thread.run(Thread.java:829)
selenium-hub    | Caused by: org.openqa.selenium.TimeoutException: java.util.concurrent.TimeoutException
selenium-hub    | Build info: version: '4.18.1', revision: 'b1d3319b48'
selenium-hub    | System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'
selenium-hub    | Driver info: driver.version: unknown
selenium-hub    |       at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:403)
selenium-hub    |       at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
selenium-hub    |       at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)
selenium-hub    |       at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:359)
selenium-hub    |       at org.openqa.selenium.remote.tracing.TracedHttpClient.execute(TracedHttpClient.java:54)
selenium-hub    |       at org.openqa.selenium.grid.security.AddSecretFilter.lambda$apply$0(AddSecretFilter.java:40)
selenium-hub    |       at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)
selenium-hub    |       at org.openqa.selenium.grid.node.remote.RemoteNode.newSession(RemoteNode.java:130)
selenium-hub    |       at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:651)
selenium-hub    |       ... 6 more
selenium-hub    | Caused by: java.util.concurrent.TimeoutException
selenium-hub    |       at java.base/java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1892)
selenium-hub    |       at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2027)
selenium-hub    |       at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:386)
selenium-hub    |       ... 14 more
selenium-hub    |
selenium-hub    | 13:16:08.565 WARN [SeleniumSpanExporter$1.lambda$export$1] - Unable to create session: Could not start a new session. java.util.concurrent.TimeoutException
selenium-hub    | Build info: version: '4.18.1', revision: 'b1d3319b48'
selenium-hub    | System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'
selenium-hub    | Driver info: driver.version: unknown
selenium-hub    | Host info: host: '8e7beada09f2', ip: '172.19.0.2'
selenium-hub    | 13:16:12.339 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "233684826eb231b11899c13858fa631b","eventTime": 1710162954856098966,"eventName": "exception","attributes": {"exception.message": "Unable to create session: Could not start a new session. java.util.concurrent.TimeoutException\nBuild info: version: '4.18.1', revision: 'b1d3319b48'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'\nDriver info: driver.version: unknown \nHost info: host: '8e7beada09f2', ip: '172.19.0.2'","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. java.util.concurrent.TimeoutException\nBuild info: version: '4.18.1', revision: 'b1d3319b48'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'\nDriver info: driver.version: unknown \nHost info: host: '8e7beada09f2', ip: '172.19.0.2'\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:655)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:570)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:830)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:790)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:829)\nCaused by: org.openqa.selenium.TimeoutException: java.util.concurrent.TimeoutException\nBuild info: version: '4.18.1', revision: 'b1d3319b48'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-25-generic', java.version: '11.0.21'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:403)\n\tat org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)\n\tat org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)\n\tat org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:359)\n\tat org.openqa.selenium.remote.tracing.TracedHttpClient.execute(TracedHttpClient.java:54)\n\tat org.openqa.selenium.grid.security.AddSecretFilter.lambda$apply$0(AddSecretFilter.java:40)\n\tat org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)\n\tat org.openqa.selenium.grid.node.remote.RemoteNode.newSession(RemoteNode.java:130)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:651)\n\t... 6 more\nCaused by: java.util.concurrent.TimeoutException\n\tat java.base\u002fjava.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1892)\n\tat java.base\u002fjava.util.concurrent.CompletableFuture.get(CompletableFuture.java:2027)\n\tat org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:386)\n\t... 14 more\n","exception.type": "org.openqa.selenium.SessionNotCreatedException","logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {browserName: chrome}]"}}

@diemol
Copy link
Member

diemol commented Mar 11, 2024

@elnath78
Copy link
Author

I run docker run -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:4.18.1-20240224 without option -d and for chrome instead, this was the reply:

13:42:21.613 INFO [LocalNode.newSession] - Session created by the Node. Id: 9c4650aede19f7875ccc55e9bf045a27, Caps: Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 122.0.6261.69, chrome: {chromedriverVersion: 122.0.6261.69 (81bc525b6a36..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:41717}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:bidiEnabled: false, se:cdp: ws://172.17.0.2:4444/sessio..., se:cdpVersion: 122.0.6261.69, se:vnc: ws://172.17.0.2:4444/sessio..., se:vncEnabled: true, se:vncLocalAddress: ws://172.17.0.2:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
13:42:21.671 INFO [LocalDistributor.newSession] - Session created by the Distributor. Id: 9c4650aede19f7875ccc55e9bf045a27
 Caps: Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 122.0.6261.69, chrome: {chromedriverVersion: 122.0.6261.69 (81bc525b6a36..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:41717}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:bidiEnabled: false, se:cdp: ws://172.17.0.2:4444/sessio..., se:cdpVersion: 122.0.6261.69, se:vnc: ws://172.17.0.2:4444/sessio..., se:vncEnabled: true, se:vncLocalAddress: ws://172.17.0.2:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
13:42:23.783 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "99998b42780691b2cc4c08343414b6f4","eventTime": 1710164543756553354,"eventName": "HTTP request execution complete","attributes": {"http.flavor": 1,"http.handler_class": "org.openqa.selenium.remote.http.Route$PredicatedRoute","http.host": "*ip redacted*:4444","http.method": "POST","http.request_content_length": "571","http.scheme": "HTTP","http.status_code": 404,"http.target": "\u002fsession\u002f9c4650aede19f7875ccc55e9bf045a27\u002fexecute\u002fsync"}}

@diemol
Copy link
Member

diemol commented Mar 11, 2024

It means it worked.

@elnath78
Copy link
Author

Did it? I still got an error Fatal error: Uncaught Facebook\WebDriver\Exception\StaleElementReferenceException: stale element reference: stale element not found What is the difference between running node-* respect running standalone-* ?

@diemol
Copy link
Member

diemol commented Mar 11, 2024

But that is a different error. I believe your issue was about starting the session, which you were able to do. Those errors are related to handling the state of the element you find through the code. You can read about Grid roles https://www.selenium.dev/documentation/grid/getting_started/

@elnath78
Copy link
Author

elnath78 commented Mar 11, 2024

Fixed that, what is the difference between running node-* respect running standalone-* ?

@diemol
Copy link
Member

diemol commented Mar 11, 2024

It is easier if you read that in our docs: https://www.selenium.dev/documentation/grid/getting_started/#grid-roles

@VietND96
Copy link
Member

I believe the issue is solved

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators May 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants