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

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

Open
GlennBags opened this issue Apr 11, 2022 · 13 comments

Comments

@GlennBags
Copy link

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
  • Codeception version: Codeception PHP Testing Framework v4.1.28

  • PHP Version: 7.4

  • Operating System: Mac Monterey v12.2.1

  • Installation type: Composer

  • List of installed packages (composer show)

  • auth0/auth0-php 8.0.6 Auth0 PHP SDK. Straight-forward and tested methods for accessing Auth0 Authentication and Management API endpoints.
    aws/aws-crt-php v1.0.2 AWS Common Runtime for PHP
    aws/aws-sdk-php 3.209.10 AWS SDK for PHP - Use Amazon Web Services in your PHP project
    behat/gherkin v4.9.0 Gherkin DSL parser for PHP
    codeception/codeception 4.1.28 BDD-style testing framework
    codeception/lib-asserts 2.0.0 Assertion methods used by Codeception core and Asserts module
    codeception/lib-innerbrowser 2.0.2 Parent library for all Codeception framework modules and PhpBrowser
    codeception/module-asserts 2.0.1 Codeception module containing various assertions
    codeception/module-phpbrowser 2.0.2 Codeception module for testing web application over HTTP
    codeception/module-rest 2.0.1 REST module for Codeception
    codeception/module-webdriver 2.0.2 WebDriver module for Codeception
    codeception/phpunit-wrapper 9.0.6 PHPUnit classes used by Codeception
    codeception/stub 4.0.1 Flexible Stub wrapper for PHPUnit's Mock Builder
    composer/pcre 1.0.1 PCRE wrapping library that offers type-safe preg_* replacements.
    composer/semver 3.2.7 Semver library that offers utilities, version constraint parsing and validation.
    composer/xdebug-handler 3.0.1 Restarts a process without Xdebug.
    doctrine/annotations 1.13.2 Docblock Annotations Parser
    doctrine/inflector 2.0.4 PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.
    doctrine/instantiator 1.4.0 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
    doctrine/lexer 1.2.2 PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
    drewm/mailchimp-api v2.5.4 Super-simple, minimum abstraction MailChimp API v3 wrapper
    eftec/bladeone 4.2 The standalone version Blade Template Engine from Laravel in a single php file
    elasticsearch/elasticsearch v5.5.0 PHP Client for Elasticsearch
    friendsofphp/php-cs-fixer v3.5.0 A tool to automatically fix PHP code style
    fzaninotto/faker v1.9.2 Faker is a PHP library that generates fake data for you.
    graham-campbell/result-type v1.0.4 An Implementation Of The Result Type
    guzzlehttp/guzzle 7.4.1 Guzzle is a PHP HTTP client library
    guzzlehttp/promises 1.5.1 Guzzle promises library
    guzzlehttp/psr7 2.1.0 PSR-7 message implementation that also provides common utility methods
    guzzlehttp/ringphp 1.1.1 Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.
    guzzlehttp/streams 3.0.0 Provides a simple abstraction over streams of data
    hashids/hashids 2.0.4 Generate short, unique, non-sequential ids (like YouTube and Bitly) from numbers
    hubspot/hubspot-php 4.0.1 HubSpot PHP API client
    illuminate/bus v8.80.0 The Illuminate Bus package.
    illuminate/collections v8.80.0 The Illuminate Collections package.
    illuminate/container v8.80.0 The Illuminate Container package.
    illuminate/contracts v8.80.0 The Illuminate Contracts package.
    illuminate/database v8.80.0 The Illuminate Database package.
    illuminate/events v8.80.0 The Illuminate Events package.
    illuminate/macroable v8.80.0 The Illuminate Macroable package.
    illuminate/pipeline v8.80.0 The Illuminate Pipeline package.
    illuminate/support v8.80.0 The Illuminate Support package.
    intervention/image 2.7.1 Image handling and manipulation library with support for Laravel integration
    justinrainbow/json-schema 5.2.11 A library to validate a json schema.
    kigkonsult/icalcreator v2.24.2 iCalcreator is the PHP implementation of rfc2445/rfc5545, management of iCal formatted files
    kriswallsmith/buzz 1.2.0 Lightweight HTTP client
    laravel/envoy v2.8.1 Elegant SSH tasks for PHP.
    league/csv 8.2.3 Csv data manipulation made easy in PHP
    monolog/monolog 1.26.1 Sends your logs to files, sockets, inboxes, databases and various web services
    mtdowling/jmespath.php 2.6.1 Declaratively specify how to extract elements from a JSON document
    myclabs/deep-copy 1.10.2 Create deep copies (clones) of your objects
    nesbot/carbon 2.55.2 An API extension for DateTime that supports 281 different languages.
    nikic/php-parser v4.13.2 A PHP parser written in PHP
    nyholm/psr7 1.5.0 A fast PHP7 implementation of PSR-7
    parsecsv/php-parsecsv 1.0.0 CSV data parser for PHP
    phar-io/manifest 2.0.3 Component for reading phar.io manifest information from a PHP Archive (PHAR)
    phar-io/version 3.1.0 Library for handling version information and constraints
    php-cs-fixer/diff v2.0.2 sebastian/diff v3 backport support for PHP 5.6+
    php-http/discovery 1.14.1 Finds installed HTTPlug implementations and PSR-7 message factories
    php-http/httplug 2.2.0 HTTPlug, the HTTP client abstraction for PHP
    php-http/message-factory v1.0.2 Factory interfaces for PSR-7 HTTP Message
    php-http/multipart-stream-builder 1.2.0 A builder class that help you create a multipart stream
    php-http/promise 1.1.0 Promise used for asynchronous HTTP requests
    php-webdriver/webdriver 1.12.0 A PHP client for Selenium WebDriver. Previously facebook/webdriver.
    phpdocumentor/reflection-common 2.2.0 Common reflection classes used by phpdocumentor to reflect the code structure
    phpdocumentor/reflection-docblock 5.3.0 With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
    phpdocumentor/type-resolver 1.6.0 A PSR-5 based resolver of Class names, Types and Structural Element Names
    phpfastcache/phpfastcache 6.1.5 PHP Cache Class - Reduce your database call using cache system. PhpFastCache handles a lot of drivers such as Apc(u), Cassandra, CouchBase, Couchdb, Mongodb, Files, (P)redis, Leveldb, Memcache(d), Ss...
    phpoption/phpoption 1.8.1 Option Type for PHP
    phpspec/prophecy v1.15.0 Highly opinionated mocking framework for PHP 5.3+
    phpunit/php-code-coverage 9.2.10 Library that provides collection, processing, and rendering functionality for PHP code coverage information.
    phpunit/php-file-iterator 3.0.6 FilterIterator implementation that filters files based on a list of suffixes.
    phpunit/php-invoker 3.1.1 Invoke callables with a timeout
    phpunit/php-text-template 2.0.4 Simple template engine.
    phpunit/php-timer 5.0.3 Utility class for timing
    phpunit/phpunit 9.5.12 The PHP Unit Testing framework.
    psr/cache 1.0.1 Common interface for caching libraries
    psr/container 1.1.2 Common Container Interface (PHP FIG PSR-11)
    psr/event-dispatcher 1.0.0 Standard interfaces for event handling.
    psr/http-client 1.0.1 Common interface for HTTP clients
    psr/http-factory 1.0.1 Common interfaces for PSR-7 HTTP message factories
    psr/http-message 1.0.1 Common interface for HTTP messages
    psr/log 1.1.4 Common interface for logging libraries
    psr/simple-cache 1.0.1 Common interfaces for simple caching
    ralouphie/getallheaders 3.0.3 A polyfill for getallheaders.
    react/promise v2.8.0 A lightweight implementation of CommonJS Promises/A for PHP
    sebastian/cli-parser 1.0.1 Library for parsing CLI options
    sebastian/code-unit 1.0.8 Collection of value objects that represent the PHP code units
    sebastian/code-unit-reverse-lookup 2.0.3 Looks up which function or method a line of code belongs to
    sebastian/comparator 4.0.6 Provides the functionality to compare PHP values for equality
    sebastian/complexity 2.0.2 Library for calculating the complexity of PHP code units
    sebastian/diff 4.0.4 Diff implementation
    sebastian/environment 5.1.3 Provides functionality to handle HHVM/PHP environments
    sebastian/exporter 4.0.4 Provides the functionality to export PHP variables for visualization
    sebastian/global-state 5.0.3 Snapshotting of global state
    sebastian/lines-of-code 1.0.3 Library for counting the lines of code in PHP source code
    sebastian/object-enumerator 4.0.4 Traverses array structures and object graphs to enumerate all referenced objects
    sebastian/object-reflector 2.0.4 Allows reflection of object attributes, including inherited and non-public ones
    sebastian/recursion-context 4.0.4 Provides functionality to recursively process PHP variables
    sebastian/resource-operations 3.0.3 Provides a list of PHP built-in functions that operate on resources
    sebastian/type 2.3.4 Collection of value objects that represent the types of the PHP type system
    sebastian/version 3.0.2 Library that helps with managing the version number of Git-hosted PHP projects
    sendgrid/php-http-client 3.14.1 HTTP REST client, simplified for PHP
    sendgrid/sendgrid 7.4.2 This library allows you to quickly and easily send emails through Twilio SendGrid using PHP.
    setasign/fpdf 1.8.1 FPDF is a PHP class which allows to generate PDF files with pure PHP. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.
    softcreatr/jsonpath 0.7.5 JSONPath implementation for parsing, searching and flattening arrays
    squizlabs/php_codesniffer 3.6.2 PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.
    symfony/browser-kit v5.4.3 Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically
    symfony/console v5.4.2 Eases the creation of beautiful and testable command line interfaces
    symfony/css-selector v5.4.2 Converts CSS selectors to XPath expressions
    symfony/deprecation-contracts v2.5.0 A generic function and convention to trigger deprecation notices
    symfony/dom-crawler v5.4.6 Eases DOM navigation for HTML and XML documents
    symfony/event-dispatcher v5.4.0 Provides tools that allow your application components to communicate with each other by dispatching events and listening to them
    symfony/event-dispatcher-contracts v2.5.0 Generic abstractions related to dispatching event
    symfony/filesystem v5.4.0 Provides basic utilities for the filesystem
    symfony/finder v5.4.2 Finds files and directories via an intuitive fluent interface
    symfony/options-resolver v5.4.0 Provides an improved replacement for the array_replace PHP function
    symfony/polyfill-ctype v1.24.0 Symfony polyfill for ctype functions
    symfony/polyfill-intl-grapheme v1.24.0 Symfony polyfill for intl's grapheme_* functions
    symfony/polyfill-intl-normalizer v1.24.0 Symfony polyfill for intl's Normalizer class and related functions
    symfony/polyfill-mbstring v1.24.0 Symfony polyfill for the Mbstring extension
    symfony/polyfill-php73 v1.24.0 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
    symfony/polyfill-php80 v1.24.0 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
    symfony/polyfill-php81 v1.24.0 Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions
    symfony/process v5.4.2 Executes commands in sub-processes
    symfony/service-contracts v2.5.0 Generic abstractions related to writing services
    symfony/stopwatch v5.4.0 Provides a way to profile code
    symfony/string v5.4.2 Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way
    symfony/translation v4.4.34 Provides tools to internationalize your application
    symfony/translation-contracts v2.5.0 Generic abstractions related to translation
    symfony/yaml v3.4.31 Symfony Yaml Component
    theseer/tokenizer 1.2.1 A small library for converting tokenized PHP source code into XML and potentially other formats
    twilio/sdk 5.42.2 A PHP wrapper for Twilio's API
    vlucas/phpdotenv v5.4.1 Loads environment variables from .env to getenv(), $_ENV and $_SERVER automagically.
    voku/portable-ascii 1.5.6 Portable ASCII library - performance optimized (ascii) string functions for php.
    webmozart/assert 1.10.0 Assertions to validate method input/output with nice error messages.
    wimg/php-compatibility 9.3.5 A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.

  • Suite configuration:

modules:
  enabled:
    - WebDriver:
        url: http://127.0.0.1
        browser: chrome
        capabilities:
          chromeOptions:
            args: [ "--headless", "--disable-gpu" ]
@Naktibalda
Copy link
Member

Check the logs of Selenium

@GlennBags
Copy link
Author


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
Copy link
Member

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

@GlennBags
Copy link
Author

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

@reinholdfuereder
Copy link

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

  • I think @GlennBags is using Selenium v4 (instead of 3.141.59 or so)
  • @Naktibalda Is that version already supported and/or compatible? (Sorry if this question is naive/dumb -- it is however very interesting for me)

@Naktibalda
Copy link
Member

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
Copy link
Member

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
Copy link
Member

I will make it throw better exception.

@kalabro
Copy link

kalabro commented Apr 20, 2022

@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
Copy link
Member

@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
Copy link

kalabro commented Apr 20, 2022

@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
Copy link

@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
Copy link

kalabro commented Apr 21, 2022

@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.

@Naktibalda Naktibalda transferred this issue from Codeception/Codeception Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants