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]: Can't start new session #1914

Closed
mharmuth opened this issue Aug 11, 2023 · 6 comments
Closed

[🐛 Bug]: Can't start new session #1914

mharmuth opened this issue Aug 11, 2023 · 6 comments

Comments

@mharmuth
Copy link

mharmuth commented Aug 11, 2023

What happened?

I am using the docker-compose yaml files linked in the README for for starting a simple grid (without edge). Everything starts fine and I can see/use the selenium grid and Jaeger UI.
I can even use Postman to make a GET request to http://0.0.0.0:4444/status where I get the following response:

{
    "value": {
        "ready": true,
        "message": "Selenium Grid ready.",
        "nodes": [
            {
                "id": "5ff2dadd-23d9-49a0-a26a-09a16893f4c9",
                "uri": "http://192.168.247.11:5555",
                "maxSessions": 1,
                "osInfo": {
                    "arch": "amd64",
                    "name": "Linux",
                    "version": "6.4.8-orbstack-00059-g106c60a3471f"
                },
                "heartbeatPeriod": 60000,
                "availability": "UP",
                "version": "4.11.0 (revision 040bc5406b)",
                "slots": [
                    {
                        "id": {
                            "hostId": "5ff2dadd-23d9-49a0-a26a-09a16893f4c9",
                            "id": "e5e4964e-8dba-485e-a0a2-a126241bf65d"
                        },
                        "lastStarted": "1970-01-01T00:00:00Z",
                        "session": null,
                        "stereotype": {
                            "browserName": "firefox",
                            "browserVersion": "116.0",
                            "platformName": "linux",
                            "se:noVncPort": 7900,
                            "se:vncEnabled": true
                        }
                    }
                ]
            },
            {
                "id": "dc476fa8-e8b9-4187-940c-ee1d0450b040",
                "uri": "http://192.168.247.12:5555",
                "maxSessions": 1,
                "osInfo": {
                    "arch": "amd64",
                    "name": "Linux",
                    "version": "6.4.8-orbstack-00059-g106c60a3471f"
                },
                "heartbeatPeriod": 60000,
                "availability": "UP",
                "version": "4.11.0 (revision 040bc5406b)",
                "slots": [
                    {
                        "id": {
                            "hostId": "dc476fa8-e8b9-4187-940c-ee1d0450b040",
                            "id": "3855295d-0220-4d5b-8aa8-b09401724ee8"
                        },
                        "lastStarted": "1970-01-01T00:00:00Z",
                        "session": null,
                        "stereotype": {
                            "browserName": "chrome",
                            "browserVersion": "115.0",
                            "platformName": "linux",
                            "se:noVncPort": 7900,
                            "se:vncEnabled": true
                        }
                    }
                ]
            }
        ]
    }
}

But when I try to start a new session using the following request, I always ran into a timeout:

curl --location '0.0.0.0:4444/session' \
--header 'Content-Type: application/json' \
--data '{
    "capabilities": {
        "browserName": "firefox",
        "name": "Behat feature suite",
        "browser": "firefox"
    }
}'

I tried with both browsers, and even with Behat directly. But always the same outcome. At the beginning, I had not set the SE_SESSION_REQUEST_TIMEOUT and the request was just running and did nothing. So I set it to 10 seconds and the after this 10 seconds I got the following response:

{
    "value": {
        "error": "session not created",
        "message": "Could not start a new session. New session request timed out \nHost info: host: '8d0ce8a9eb3e', ip: '192.168.247.5'\nBuild info: version: '4.11.0', revision: '040bc5406b'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.8-orbstack-00059-g106c60a3471f', java.version: '11.0.20'\nDriver info: driver.version: unknown",
        "stacktrace": [
            {
                "fileName": "LocalNewSessionQueue.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "addToQueue",
                "className": "org.openqa.selenium.grid.sessionqueue.local.LocalNewSessionQueue",
                "lineNumber": 224,
                "classLoaderName": null
            },
            {
                "fileName": "NewSessionQueue.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "lambda$new$0",
                "className": "org.openqa.selenium.grid.sessionqueue.NewSessionQueue",
                "lineNumber": 68,
                "classLoaderName": null
            },
            {
                "fileName": "Route.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "handle",
                "className": "org.openqa.selenium.remote.http.Route$TemplatizedRoute",
                "lineNumber": 193,
                "classLoaderName": null
            },
            {
                "fileName": "Route.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "execute",
                "className": "org.openqa.selenium.remote.http.Route",
                "lineNumber": 69,
                "classLoaderName": null
            },
            {
                "fileName": "Route.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "handle",
                "className": "org.openqa.selenium.remote.http.Route$CombinedRoute",
                "lineNumber": 347,
                "classLoaderName": null
            },
            {
                "fileName": "Route.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "execute",
                "className": "org.openqa.selenium.remote.http.Route",
                "lineNumber": 69,
                "classLoaderName": null
            },
            {
                "fileName": "NewSessionQueue.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "execute",
                "className": "org.openqa.selenium.grid.sessionqueue.NewSessionQueue",
                "lineNumber": 128,
                "classLoaderName": null
            },
            {
                "fileName": "SpanWrappedHttpHandler.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "execute",
                "className": "org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler",
                "lineNumber": 91,
                "classLoaderName": null
            },
            {
                "fileName": "Filter.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "execute",
                "className": "org.openqa.selenium.remote.http.Filter$1",
                "lineNumber": 63,
                "classLoaderName": null
            },
            {
                "fileName": "Route.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "handle",
                "className": "org.openqa.selenium.remote.http.Route$CombinedRoute",
                "lineNumber": 347,
                "classLoaderName": null
            },
            {
                "fileName": "Route.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "execute",
                "className": "org.openqa.selenium.remote.http.Route",
                "lineNumber": 69,
                "classLoaderName": null
            },
            {
                "fileName": "Router.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "execute",
                "className": "org.openqa.selenium.grid.router.Router",
                "lineNumber": 87,
                "classLoaderName": null
            },
            {
                "fileName": "EnsureSpecCompliantResponseHeaders.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "lambda$apply$0",
                "className": "org.openqa.selenium.grid.web.EnsureSpecCompliantResponseHeaders",
                "lineNumber": 34,
                "classLoaderName": null
            },
            {
                "fileName": "Filter.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "execute",
                "className": "org.openqa.selenium.remote.http.Filter$1",
                "lineNumber": 63,
                "classLoaderName": null
            },
            {
                "fileName": "Route.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "handle",
                "className": "org.openqa.selenium.remote.http.Route$CombinedRoute",
                "lineNumber": 347,
                "classLoaderName": null
            },
            {
                "fileName": "Route.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "execute",
                "className": "org.openqa.selenium.remote.http.Route",
                "lineNumber": 69,
                "classLoaderName": null
            },
            {
                "fileName": "Route.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "handle",
                "className": "org.openqa.selenium.remote.http.Route$CombinedRoute",
                "lineNumber": 347,
                "classLoaderName": null
            },
            {
                "fileName": "Route.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "execute",
                "className": "org.openqa.selenium.remote.http.Route",
                "lineNumber": 69,
                "classLoaderName": null
            },
            {
                "fileName": "Route.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "handle",
                "className": "org.openqa.selenium.remote.http.Route$CombinedRoute",
                "lineNumber": 347,
                "classLoaderName": null
            },
            {
                "fileName": "Route.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "execute",
                "className": "org.openqa.selenium.remote.http.Route",
                "lineNumber": 69,
                "classLoaderName": null
            },
            {
                "fileName": "Route.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "handle",
                "className": "org.openqa.selenium.remote.http.Route$CombinedRoute",
                "lineNumber": 347,
                "classLoaderName": null
            },
            {
                "fileName": "Route.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "execute",
                "className": "org.openqa.selenium.remote.http.Route",
                "lineNumber": 69,
                "classLoaderName": null
            },
            {
                "fileName": "AddWebDriverSpecHeaders.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "lambda$apply$0",
                "className": "org.openqa.selenium.remote.AddWebDriverSpecHeaders",
                "lineNumber": 35,
                "classLoaderName": null
            },
            {
                "fileName": "ErrorFilter.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "lambda$apply$0",
                "className": "org.openqa.selenium.remote.ErrorFilter",
                "lineNumber": 44,
                "classLoaderName": null
            },
            {
                "fileName": "Filter.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "execute",
                "className": "org.openqa.selenium.remote.http.Filter$1",
                "lineNumber": 63,
                "classLoaderName": null
            },
            {
                "fileName": "ErrorFilter.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "lambda$apply$0",
                "className": "org.openqa.selenium.remote.ErrorFilter",
                "lineNumber": 44,
                "classLoaderName": null
            },
            {
                "fileName": "Filter.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "execute",
                "className": "org.openqa.selenium.remote.http.Filter$1",
                "lineNumber": 63,
                "classLoaderName": null
            },
            {
                "fileName": "SeleniumHandler.java",
                "moduleVersion": null,
                "moduleName": null,
                "nativeMethod": false,
                "methodName": "lambda$channelRead0$0",
                "className": "org.openqa.selenium.netty.server.SeleniumHandler",
                "lineNumber": 44,
                "classLoaderName": null
            },
            {
                "fileName": "Executors.java",
                "moduleVersion": "11.0.20",
                "moduleName": "java.base",
                "nativeMethod": false,
                "methodName": "call",
                "className": "java.util.concurrent.Executors$RunnableAdapter",
                "lineNumber": 515,
                "classLoaderName": null
            },
            {
                "fileName": "FutureTask.java",
                "moduleVersion": "11.0.20",
                "moduleName": "java.base",
                "nativeMethod": false,
                "methodName": "run",
                "className": "java.util.concurrent.FutureTask",
                "lineNumber": 264,
                "classLoaderName": null
            },
            {
                "fileName": "ThreadPoolExecutor.java",
                "moduleVersion": "11.0.20",
                "moduleName": "java.base",
                "nativeMethod": false,
                "methodName": "runWorker",
                "className": "java.util.concurrent.ThreadPoolExecutor",
                "lineNumber": 1128,
                "classLoaderName": null
            },
            {
                "fileName": "ThreadPoolExecutor.java",
                "moduleVersion": "11.0.20",
                "moduleName": "java.base",
                "nativeMethod": false,
                "methodName": "run",
                "className": "java.util.concurrent.ThreadPoolExecutor$Worker",
                "lineNumber": 628,
                "classLoaderName": null
            },
            {
                "fileName": "Thread.java",
                "moduleVersion": "11.0.20",
                "moduleName": "java.base",
                "nativeMethod": false,
                "methodName": "run",
                "className": "java.lang.Thread",
                "lineNumber": 829,
                "classLoaderName": null
            }
        ]
    }
}

I'm using an M1 MacBook Pro and it doesn't work with either OrbStack or DockerDesktop.
In addition I want to say, that I can't see the trace for the POST request in Jaeger UI

Command used to start Selenium Grid with Docker

services:
  chrome:
    image: selenium/node-chrome:4.11.0-20230801
    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
      - SE_ENABLE_TRACING=true
      - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-chrome

    firefox:
      image: selenium/node-firefox:4.11.0-20230801
      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
        - SE_ENABLE_TRACING=true
        - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-firefox

    selenium-hub:
      image: selenium/hub:4.11.0-20230801
      container_name: selenium-hub
      depends_on:
        - jaegar
      ports:
        - "4442:4442"
        - "4443:4443"
        - "4444:4444"
      environment:
        - SE_SESSION_REQUEST_TIMEOUT=10
        - SE_ENABLE_TRACING=true
        - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-hub

    jaegar:
      image: jaegertracing/all-in-one:1.17
      ports:
        - "16686:16686"
        - "14250:14250"

Relevant log output

see above

Operating System

macOS Ventura 13.5

Docker Selenium version (tag)

4.11.0-20230801

@github-actions
Copy link

@mharmuth, 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!

@diemol
Copy link
Member

diemol commented Aug 11, 2023

Please use the https://github.com/seleniumhq-community/docker-seleniarm images for ARM architecture.

@mharmuth
Copy link
Author

Did that. But does not help. Same error appears. To verify that I am using the arm build:

{
    "value": {
        "ready": true,
        "message": "Selenium Grid ready.",
        "nodes": [
            {
                "id": "e483bb94-d9cd-412b-9ae7-85a1cee12003",
                "uri": "http://192.168.207.10:5555",
                "maxSessions": 1,
                "osInfo": {
                    "arch": "aarch64",
                    "name": "Linux",
                    "version": "6.4.8-orbstack-00059-g106c60a3471f"
                },
                "heartbeatPeriod": 60000,
                "availability": "UP",
                "version": "4.10.0 (revision c14d967899)",
                "slots": [
                    {
                        "id": {
                            "hostId": "e483bb94-d9cd-412b-9ae7-85a1cee12003",
                            "id": "5ac7dfce-ece9-489d-9d95-a99ad0ecc39a"
                        },
                        "lastStarted": "1970-01-01T00:00:00Z",
                        "session": null,
                        "stereotype": {
                            "browserName": "firefox",
                            "browserVersion": "114.0",
                            "platformName": "linux",
                            "se:noVncPort": 7900,
                            "se:vncEnabled": true
                        }
                    }
                ]
            }
        ]
    }
}

@diemol
Copy link
Member

diemol commented Aug 11, 2023

I missed seeing that the capabilities payload is wrong. Here is an example of a well-formed one:

{
  "capabilities": {
		"alwaysMatch": {
			"browserName": "firefox"
		},
    "firstMatch": [{}]
  }
}

@diemol diemol closed this as not planned Won't fix, can't repro, duplicate, stale Aug 11, 2023
@mharmuth
Copy link
Author

Ah, thanks a lot. Sorry for the ticket!

Copy link

github-actions bot commented Dec 9, 2023

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 Dec 9, 2023
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

2 participants