Codeception / module-webdriver

WebDriver module for Codeception
MIT License
36 stars 25 forks source link

Could not start a new session. Error while creating session with the driver service #112

Open GlennBags opened 2 years ago

GlennBags commented 2 years ago

What are you trying to achieve?

Run codeception in Docker using standalone selenium server

What do you get instead?

[Error] Class name must be a valid object or a string

NOTE: Since the above seems to be an issue external to the tests (as I removed all the actuals tests--see PHP section below) I debugged through and found that the issue was happening within the foreach loop in \PhpUnit\TextUi\DefaultResultPrinter::printDefects() when it calls $this->printDefect(). In a dump of $defect, I found the following:

[message] => Could not start a new session. Could not start a new session. Error while creating session with the driver service. Stopping driver service: Driver server process died prematurely.

Provide console output if related. Use -vvv mode for more details.

Codeception PHP Testing Framework v4.1.28
Powered by PHPUnit 9.5.12 by Sebastian Bergmann and contributors.

Acceptance Tests (1) -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
E LoginCest: Login page has form test (0.00s)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 00:04.366, Memory: 10.00 MB

There was 1 error:

---------
1) LoginCest: Login page has form test
 Test  tests/acceptance/LoginCest.php:loginPageHasFormTest

  [Error] Class name must be a valid object or a string

Artifacts:

Png: /var/www/app/tests/_output/acceptance.LoginCest.loginPageHasFormTest.fail.png
Html: /var/www/app/tests/_output/acceptance.LoginCest.loginPageHasFormTest.fail.html

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.```
> Provide test source code if related

```php
<?php

namespace acceptance;

use AcceptanceTester;
use Codeception\Util\Locator;

class LoginCest
{
    // removed the contents of the test to check that current issues have nothing to do with the test itself
    public function loginPageHasFormTest(AcceptanceTester $I)
    {
    }
}

Details

Contents of the output .html

/session//source
modules:
  enabled:
    - WebDriver:
        url: http://127.0.0.1
        browser: chrome
        capabilities:
          chromeOptions:
            args: [ "--headless", "--disable-gpu" ]
Naktibalda commented 2 years ago

Check the logs of Selenium

GlennBags commented 2 years ago

selenium-standalone installation starting



selenium install:

from: https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.0.0/selenium-server-4.0.0.jar

to: /var/www/app/node_modules/selenium-standalone/.selenium/selenium-server/4.0.0/selenium-server.jar


chrome install:

from: https://chromedriver.storage.googleapis.com/100.0.4896.60/chromedriver_linux64.zip

to: /var/www/app/node_modules/selenium-standalone/.selenium/chromedriver/latest-x64/chromedriver


firefox install:

from: https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz

to: /var/www/app/node_modules/selenium-standalone/.selenium/geckodriver/latest-x64/geckodriver


chromiumedge install:

from: https://msedgedriver.azureedge.net/100.0.1185.39/edgedriver_linux64.zip

to: /var/www/app/node_modules/selenium-standalone/.selenium/chromiumedgedriver/latest-x64/msedgedriver


File from https://msedgedriver.azureedge.net/100.0.1185.39/edgedriver_linux64.zip has already been downloaded


File from https://chromedriver.storage.googleapis.com/100.0.4896.60/chromedriver_linux64.zip has already been downloaded


selenium-standalone installation finished


09:01:30.680 INFO [LogManager$RootLogger.log] - Using the system default encoding

09:01:30.707 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing

Failed to connect to selenium. Attempts left: 25

connect ECONNREFUSED 127.0.0.1:4444

09:01:33.191 INFO [NodeOptions.getSessionFactories] - Detected 6 available processors

09:01:33.302 INFO [NodeOptions.discoverDrivers] - Discovered 3 driver(s)

09:01:33.398 INFO [NodeOptions.report] - Adding Edge for {"browserName": "MicrosoftEdge"} 6 times

09:01:33.400 INFO [NodeOptions.report] - Adding Chrome for {"browserName": "chrome"} 6 times

09:01:33.403 INFO [NodeOptions.report] - Adding Firefox for {"browserName": "firefox"} 6 times

09:01:33.486 INFO [Node.] - Binding additional locator mechanisms: name, id, relative

09:01:33.606 INFO [LocalDistributor.add] - Added node 81952b18-def0-4c2d-a65b-139bee9ba2a5 at http://172.25.0.2:4444. Health check every 120s

09:01:33.626 INFO [GridModel.setAvailability] - Switching node 81952b18-def0-4c2d-a65b-139bee9ba2a5 (uri: http://172.25.0.2:4444) from DOWN to UP

Failed to connect to selenium. Attempts left: 20

connect ECONNREFUSED 127.0.0.1:4444

09:01:34.328 INFO [Standalone.execute] - Started Selenium Standalone 4.0.0 (revision 3a21814679): http://172.25.0.2:4444

Selenium started

09:06:16.359 INFO [LocalDistributor.newSession] - Session request received by the distributor:

[Capabilities {browserName: chrome, chromeOptions: {args: [--headless, --disable-gpu]}}, Capabilities {browserName: chrome, goog:chromeOptions: {args: [--headless, --disable-gpu]}}]

09:06:16.465 WARN [SeleniumSpanExporter$1.lambda$export$0] - {"traceId": "5591beaea3d6efc5ca1e1becc508b65a","eventTime": 1649768776463177300,"eventName": "exception","attributes": {"exception.message": "Error while creating session with the driver service. Stopping driver service: Driver server process died prematurely.\nBuild info: version: '4.0.0', revision: '3a21814679'\nSystem info: host: 'cdc3f9f1751d', ip: '172.25.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.121-linuxkit', java.version: '1.8.0_312'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.WebDriverException: Driver server process died prematurely.\nBuild info: version: '4.0.0', revision: '3a21814679'\nSystem info: host: 'cdc3f9f1751d', ip: '172.25.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.121-linuxkit', java.version: '1.8.0_312'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.remote.service.DriverService.start(DriverService.java:223)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:122)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:65)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:143)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:315)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:513)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:440)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:648)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:612)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n","exception.type": "org.openqa.selenium.WebDriverException","logger": "org.openqa.selenium.grid.node.config.DriverServiceSessionFactory","session.capabilities": "{\"browserName\": \"chrome\",\"chromeOptions\": {\"args\": [ \"--headless\", \"--disable-gpu\" ] } }\n"}}

09:06:16.527 WARN [SeleniumSpanExporter$1.lambda$export$0] - {"traceId": "5591beaea3d6efc5ca1e1becc508b65a","eventTime": 1649768776524982700,"eventName": "exception","attributes": {"exception.message": "Error while creating session with the driver service. Stopping driver service: Driver server process died prematurely.\nBuild info: version: '4.0.0', revision: '3a21814679'\nSystem info: host: 'cdc3f9f1751d', ip: '172.25.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.121-linuxkit', java.version: '1.8.0_312'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.WebDriverException: Driver server process died prematurely.\nBuild info: version: '4.0.0', revision: '3a21814679'\nSystem info: host: 'cdc3f9f1751d', ip: '172.25.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.121-linuxkit', java.version: '1.8.0_312'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.remote.service.DriverService.start(DriverService.java:223)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:122)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:65)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:143)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:315)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:513)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:440)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:648)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:612)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n","exception.type": "org.openqa.selenium.WebDriverException","logger": "org.openqa.selenium.grid.node.config.DriverServiceSessionFactory","session.capabilities": "{\"browserName\": \"chrome\",\"goog:chromeOptions\": {\"args\": [ \"--headless\", \"--disable-gpu\" ] } }\n"}}

09:06:16.536 WARN [SeleniumSpanExporter$1.lambda$export$0] - {"traceId": "5591beaea3d6efc5ca1e1becc508b65a","eventTime": 1649768776535618500,"eventName": "HTTP request execution complete","attributes": {"http.flavor": 1,"http.handler_class": "org.openqa.selenium.grid.sessionqueue.local.LocalNewSessionQueue","http.host": "127.0.0.1:4444","http.method": "POST","http.request_content_length": "222","http.scheme": "HTTP","http.status_code": 500,"http.target": "\u002fsession"}}

09:06:16.571 WARN [SeleniumSpanExporter$1.lambda$export$0] - {"traceId": "ab2a4e0389c3103da8f3af4b0fbdb247","eventTime": 1649768776570626200,"eventName": "exception","attributes": {"exception.message": "Unable to execute request for an existing session: Unable to find session with ID: \nBuild info: version: '4.0.0', revision: '3a21814679'\nSystem info: host: 'cdc3f9f1751d', ip: '172.25.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.121-linuxkit', java.version: '1.8.0_312'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.NoSuchSessionException: Unable to find session with ID: \nBuild info: version: '4.0.0', revision: '3a21814679'\nSystem info: host: 'cdc3f9f1751d', ip: '172.25.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.121-linuxkit', java.version: '1.8.0_312'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.sessionmap.local.LocalSessionMap.get(LocalSessionMap.java:129)\n\tat org.openqa.selenium.grid.router.HandleSession.lambda$loadSessionId$3(HandleSession.java:147)\n\tat io.opentelemetry.context.Context.lambda$wrap$2(Context.java:219)\n\tat org.openqa.selenium.grid.router.HandleSession.execute(HandleSession.java:110)\n\tat org.openqa.selenium.remote.http.Route$PredicatedRoute.handle(Route.java:373)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.grid.router.Router.execute(Router.java:91)\n\tat org.openqa.selenium.grid.web.CheckOriginHeader.lambda$apply$0(CheckOriginHeader.java:66)\n\tat org.openqa.selenium.grid.web.CheckContentTypeHeader.lambda$apply$0(CheckContentTypeHeader.java:70)\n\tat org.openqa.selenium.grid.web.EnsureSpecCompliantResponseHeaders.lambda$apply$0(EnsureSpecCompliantResponseHeaders.java:34)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.http.Route$NestedRoute.handle(Route.java:270)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\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:64)\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:64)\n\tat org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:44)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n","exception.type": "org.openqa.selenium.NoSuchSessionException","http.flavor": 1,"http.handler_class": "org.openqa.selenium.grid.router.HandleSession","http.host": "127.0.0.1:4444","http.method": "GET","http.request_content_length": "0","http.scheme": "HTTP","http.target": "\u002fsession\u002f\u002fscreenshot","session.id": ""}}

09:06:16.585 WARN [SeleniumSpanExporter$1.lambda$export$0] - {"traceId": "fad714ffa9b5298cab49d1d97895fe4b","eventTime": 1649768776584715300,"eventName": "exception","attributes": {"exception.message": "Unable to execute request for an existing session: Unable to find session with ID: \nBuild info: version: '4.0.0', revision: '3a21814679'\nSystem info: host: 'cdc3f9f1751d', ip: '172.25.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.121-linuxkit', java.version: '1.8.0_312'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.NoSuchSessionException: Unable to find session with ID: \nBuild info: version: '4.0.0', revision: '3a21814679'\nSystem info: host: 'cdc3f9f1751d', ip: '172.25.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.121-linuxkit', java.version: '1.8.0_312'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.sessionmap.local.LocalSessionMap.get(LocalSessionMap.java:129)\n\tat org.openqa.selenium.grid.router.HandleSession.lambda$loadSessionId$3(HandleSession.java:147)\n\tat io.opentelemetry.context.Context.lambda$wrap$2(Context.java:219)\n\tat org.openqa.selenium.grid.router.HandleSession.execute(HandleSession.java:110)\n\tat org.openqa.selenium.remote.http.Route$PredicatedRoute.handle(Route.java:373)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.grid.router.Router.execute(Router.java:91)\n\tat org.openqa.selenium.grid.web.CheckOriginHeader.lambda$apply$0(CheckOriginHeader.java:66)\n\tat org.openqa.selenium.grid.web.CheckContentTypeHeader.lambda$apply$0(CheckContentTypeHeader.java:70)\n\tat org.openqa.selenium.grid.web.EnsureSpecCompliantResponseHeaders.lambda$apply$0(EnsureSpecCompliantResponseHeaders.java:34)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.http.Route$NestedRoute.handle(Route.java:270)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\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:64)\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:64)\n\tat org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:44)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n","exception.type": "org.openqa.selenium.NoSuchSessionException","http.flavor": 1,"http.handler_class": "org.openqa.selenium.grid.router.HandleSession","http.host": "127.0.0.1:4444","http.method": "GET","http.request_content_length": "0","http.scheme": "HTTP","http.target": "\u002fsession\u002f\u002fsource","session.id": ""}}

09:06:16.618 WARN [SeleniumSpanExporter$1.lambda$export$0] - {"traceId": "455de12af794284067d8e73f5e2e00ae","eventTime": 1649768776618002600,"eventName": "exception","attributes": {"exception.message": "Unable to execute request for an existing session: Unable to find session with ID: \nBuild info: version: '4.0.0', revision: '3a21814679'\nSystem info: host: 'cdc3f9f1751d', ip: '172.25.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.121-linuxkit', java.version: '1.8.0_312'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.NoSuchSessionException: Unable to find session with ID: \nBuild info: version: '4.0.0', revision: '3a21814679'\nSystem info: host: 'cdc3f9f1751d', ip: '172.25.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.121-linuxkit', java.version: '1.8.0_312'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.sessionmap.local.LocalSessionMap.get(LocalSessionMap.java:129)\n\tat org.openqa.selenium.grid.router.HandleSession.lambda$loadSessionId$3(HandleSession.java:147)\n\tat io.opentelemetry.context.Context.lambda$wrap$2(Context.java:219)\n\tat org.openqa.selenium.grid.router.HandleSession.execute(HandleSession.java:110)\n\tat org.openqa.selenium.remote.http.Route$PredicatedRoute.handle(Route.java:373)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.grid.router.Router.execute(Router.java:91)\n\tat org.openqa.selenium.grid.web.CheckOriginHeader.lambda$apply$0(CheckOriginHeader.java:66)\n\tat org.openqa.selenium.grid.web.CheckContentTypeHeader.lambda$apply$0(CheckContentTypeHeader.java:70)\n\tat org.openqa.selenium.grid.web.EnsureSpecCompliantResponseHeaders.lambda$apply$0(EnsureSpecCompliantResponseHeaders.java:34)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.http.Route$NestedRoute.handle(Route.java:270)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\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:64)\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:64)\n\tat org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:44)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n","exception.type": "org.openqa.selenium.NoSuchSessionException","http.flavor": 1,"http.handler_class": "org.openqa.selenium.grid.router.HandleSession","http.host": "127.0.0.1:4444","http.method": "DELETE","http.request_content_length": "0","http.scheme": "HTTP","http.target": "\u002fsession\u002f\u002fcookie","session.id": ""}}

09:06:16.634 WARN [SeleniumSpanExporter$1.lambda$export$0] - {"traceId": "ec70e95538d8cc79e4944c188f037fdf","eventTime": 1649768776633074500,"eventName": "exception","attributes": {"exception.message": "Unable to execute request for an existing session: Unable to find session with ID: \nBuild info: version: '4.0.0', revision: '3a21814679'\nSystem info: host: 'cdc3f9f1751d', ip: '172.25.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.121-linuxkit', java.version: '1.8.0_312'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.NoSuchSessionException: Unable to find session with ID: \nBuild info: version: '4.0.0', revision: '3a21814679'\nSystem info: host: 'cdc3f9f1751d', ip: '172.25.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.121-linuxkit', java.version: '1.8.0_312'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.sessionmap.local.LocalSessionMap.get(LocalSessionMap.java:129)\n\tat org.openqa.selenium.grid.router.HandleSession.lambda$loadSessionId$3(HandleSession.java:147)\n\tat io.opentelemetry.context.Context.lambda$wrap$2(Context.java:219)\n\tat org.openqa.selenium.grid.router.HandleSession.execute(HandleSession.java:110)\n\tat org.openqa.selenium.remote.http.Route$PredicatedRoute.handle(Route.java:373)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.grid.router.Router.execute(Router.java:91)\n\tat org.openqa.selenium.grid.web.CheckOriginHeader.lambda$apply$0(CheckOriginHeader.java:66)\n\tat org.openqa.selenium.grid.web.CheckContentTypeHeader.lambda$apply$0(CheckContentTypeHeader.java:70)\n\tat org.openqa.selenium.grid.web.EnsureSpecCompliantResponseHeaders.lambda$apply$0(EnsureSpecCompliantResponseHeaders.java:34)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.http.Route$NestedRoute.handle(Route.java:270)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\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:64)\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:64)\n\tat org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:44)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n","exception.type": "org.openqa.selenium.NoSuchSessionException","http.flavor": 1,"http.handler_class": "org.openqa.selenium.grid.router.HandleSession","http.host": "127.0.0.1:4444","http.method": "DELETE","http.request_content_length": "0","http.scheme": "HTTP","http.target": "\u002fsession\u002f","session.id": ""}}

Naktibalda commented 2 years ago

Have you noticed a link to experimental seleniarm images? https://hub.docker.com/u/seleniarm

GlennBags commented 2 years ago

Yeah, but now that I looked it over again, I'm "amd".. is that unrelated? (I misread arm)

reinholdfuereder commented 2 years ago

Sorry for getting involved without any insider knowledge, I just stumbled over this ticket (not the described problem) and was wondering...

Naktibalda commented 2 years ago

It uses the same W3C WebDriver protocol. No related issues or pull requests were raised in https://github.com/php-webdriver/php-webdriver so I assume that it is working fine.

Naktibalda commented 2 years ago

By the way, to fix Class name must be a valid object or a string, you must change class_name: AcceptanceTester to actor: AcceptanceTester in acceptance.suite.yml

Naktibalda commented 2 years ago

I will make it throw better exception.

kalabro commented 2 years ago

@Naktibalda Is that version already supported and/or compatible? (Sorry if this question is naive/dumb -- it is however very interesting for me)

@reinholdfuereder we are having problems with Codeception's $I->haveFriend() on Selenium v4 ("Can't connect to WebDriver"). Reverting back to 3.141.59 helped but I'd love to update eventually. Everything else is working fine for us on Codeception 4 + Selenium 4.

Naktibalda commented 2 years ago

@kalabro Does it launch the first browser instance successfully, but fails to launch the second instance with Could not start a new session. Could not start a new session. Error while creating session with the driver service. Stopping driver service: Driver server process died prematurely.?

kalabro commented 2 years ago

@Naktibalda It indeed luanches the first browser instance successfully because I can see it's doing some steps when running codecept run -vvv. When it reaches a friend's closure code, it's getting stuck for some time and then finally prints:

[ConnectionException] Can't connect to WebDriver at http://chrome:4444/wd/hub. Make sure that ChromeDriver, GeckoDriver or Selenium Server is running. 

I think the browser crashes behind the scenes.

reinholdfuereder commented 2 years ago

@Naktibalda Is that version already supported and/or compatible? (Sorry if this question is naive/dumb -- it is however very interesting for me)

@reinholdfuereder we are having problems with Codeception's $I->haveFriend() on Selenium v4 ("Can't connect to WebDriver"). Reverting back to 3.141.59 helped but I'd love to update eventually. Everything else is working fine for us on Codeception 4 + Selenium 4.

Sorry for "stealing" this thread once again:

@kalabro Are you using W3C protocol (or the legacy JsonWire protocol via "capabilities > goog:chromeOptions > w3c: false" WebDriver configuration)?

kalabro commented 2 years ago

@reinholdfuereder we indeed hijacked this issue but you helped me to figure out my problem. It was SE_NODE_MAX_SESSIONS setting: https://github.com/SeleniumHQ/docker-selenium#increasing-session-concurrency-per-container It was set to 1 in our case and haveFriend (and some other things that probably were creating a new session) were just "stuck".

  chrome:
    image: selenium/standalone-chrome:4.1.3
    ports:
      - 4444:4444
    environment:
      START_XVFB: "false"
      # Enables concurrent sessions (aka "friends") in Codeception.
      SE_NODE_MAX_SESSIONS: 4
      SE_NODE_OVERRIDE_MAX_SESSIONS: "true"

Same config works with seleniarm/standalone-chromium:latest in both w3c and legacy modes.