Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

[🐛 Bug]: Session unable to start for Selenium 4.11.0 due to permission error #46

Closed
jamesmortensen opened this issue Aug 28, 2023 · 8 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@jamesmortensen
Copy link

What happened?

In the logs, we can see tests failing when attempting to test Seleniarm images using Selenium 4.11.0. The full logs can be found here:

https://app.circleci.com/pipelines/github/seleniumhq-community/docker-seleniarm/368/workflows/bcace299-db41-4695-8f7c-cfc374605b2a/jobs/1398

The part that sticks out to me is the complaints about permission issues and unexpected word:

selenium.common.exceptions.SessionNotCreatedException: Message: Could not start a new session. Could not start a new session. Unable to obtain: Capabilities {browserName: chrome, browserVersion: 116.0, goog:chromeOptions: {args: [], extensions: []}, pageLoadStrategy: normal, se:noVncPort: 7900, se:vncEnabled: true}, error Command failed with code: 2, executed: [/tmp/selenium-manager67305284127211587224812580076201/selenium-manager, --browser, chrome, --output, json, --browser-version, 116.0]
/tmp/selenium-manager67305284127211587224812580076201/selenium-manager: 1: cannot create ����@8jL@8: Permission denied
/tmp/selenium-manager67305284127211587224812580076201/selenium-manager: 2: Syntax error: word unexpected (expecting ")")

Command used to start Selenium Grid with Docker

# This is taken from the circleci workflow config file:
USE_RANDOM_USER_ID=false NAMESPACE=seleniarm VERSION=4.11.0 BUILD_DATE=now SKIP_BUILD=true make test_multi_arch

Relevant log output

======================================================================
ERROR: test_title (SeleniumTests.ChromeTests.test_title)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/circleci/project/tests/SeleniumTests/__init__.py", line 71, in setUp
    self.driver = webdriver.Remote(
                  ^^^^^^^^^^^^^^^^^
  File "/opt/circleci/.pyenv/versions/3.11.4/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 286, in __init__
    self.start_session(capabilities, browser_profile)
  File "/opt/circleci/.pyenv/versions/3.11.4/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 378, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/circleci/.pyenv/versions/3.11.4/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute
    self.error_handler.check_response(response)
  File "/opt/circleci/.pyenv/versions/3.11.4/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Could not start a new session. Could not start a new session. Unable to obtain: Capabilities {browserName: chrome, browserVersion: 116.0, goog:chromeOptions: {args: [], extensions: []}, pageLoadStrategy: normal, se:noVncPort: 7900, se:vncEnabled: true}, error Command failed with code: 2, executed: [/tmp/selenium-manager67305284127211587224812580076201/selenium-manager, --browser, chrome, --output, json, --browser-version, 116.0]
/tmp/selenium-manager67305284127211587224812580076201/selenium-manager: 1: cannot create ����@8jL@8: Permission denied
/tmp/selenium-manager67305284127211587224812580076201/selenium-manager: 2: Syntax error: word unexpected (expecting ")")
 
Host info: host: '93c3760a8c5e', ip: '172.18.0.3'
Build info: version: '4.11.0', revision: '040bc5406b'
System info: os.name: 'Linux', os.arch: 'aarch64', os.version: '5.15.0-1039-aws', java.version: '11.0.20'
Driver info: driver.version: unknown
Build info: version: '4.11.0', revision: '040bc5406b'
System info: os.name: 'Linux', os.arch: 'aarch64', os.version: '5.15.0-1039-aws', java.version: '11.0.20'
Driver info: driver.version: unknown
Stacktrace:
    at org.openqa.selenium.grid.node.remote.RemoteNode.newSession (RemoteNode.java:151)
    at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession (LocalDistributor.java:648)
    at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession (LocalDistributor.java:565)
    at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest (LocalDistributor.java:829)
    at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1 (LocalDistributor.java:785)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:829)

Operating System

Ubuntu 20.04

Docker Selenium version (tag)

unreleased in CI only

@jamesmortensen jamesmortensen added the bug Something isn't working label Aug 28, 2023
@jamesmortensen
Copy link
Author

jamesmortensen commented Aug 28, 2023

I took a moment to document the issue preventing moving forward to Selenium 4.11.0. I am in the process of moving back to the USA, so if there's anyone who would like to help with this issue, that would be awesome!

@jamesmortensen jamesmortensen added the help wanted Extra attention is needed label Aug 28, 2023
@github-actions
Copy link

This issue is looking for contributors.

Please comment below or reach out to us through our IRC/Slack/Matrix channels if you are interested.

@diemol
Copy link
Member

diemol commented Aug 28, 2023

There is a permissions issue in 4.11.0 when using Selenium Manager in Linux. This is solved for 4.12.0.

However, I disabled Selenium Manager for Docker Selenium: SeleniumHQ@b5cec1c. Maybe you can do the same?

@mgm248
Copy link

mgm248 commented Aug 29, 2023

I'm not sure if this is related, but wanted to let you know I had problems using the latest seleniarm-chromium image since the update a couple days ago. Specifically, when I ran a driver.get('https://google.com'), I would get the error message:
selenium.common.exceptions.NoSuchWindowException: Message: no such window: target window already closed from unknown error: web view not found
Once I reverted to a previous version (standalone-chromium:4.10.0-20230615), things worked again.
Running on Linux too.

@jamesmortensen
Copy link
Author

Hi @diemol I brought in your commit that puts SM into offline mode b5cec1c and I've updated to Selenium 4.12.1. The tests are still failing https://app.circleci.com/pipelines/github/seleniumhq-community/docker-seleniarm/373/workflows/4b1a759e-7831-4858-9d3c-765a5e8dc723/jobs/1438

Did the names of the browsers change from chrome to google-chrome? I also still see this in the stack trace:

/tmp/selenium-manager1020021369244423436900371086586/selenium-manager: 1: Syntax error: "(" unexpected

Please let me know if you might know what this is about. Thank you!

@jamesmortensen
Copy link
Author

Just made an attempt to run a quick test using Selenium 4.12.1 and Chromium. Here's what I get:

SessionNotCreatedError: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally.
  (session not created: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /home/seluser/.cache/selenium/chrome/linux64/117.0.5938.92/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) 
Host info: host: '25701f0ba98d', ip: '172.17.0.2'
Build info: version: '4.12.1', revision: '8e34639b11'
System info: os.name: 'Linux', os.arch: 'aarch64', os.version: '5.10.0-9-arm64', java.version: '11.0.20'
Driver info: driver.version: unknown
Build info: version: '4.12.1', revision: '8e34639b11'
System info: os.name: 'Linux', os.arch: 'aarch64', os.version: '5.10.0-9-arm64', java.version: '11.0.20'
Driver info: driver.version: unknown
    at Object.throwDecodedError (/Users/james/Dev/debug-tools-for-docker-selenium/selenium-webdriver-demo-javascript/node_modules/selenium-webdriver/lib/error.js:524:15)
    at parseHttpResponse (/Users/james/Dev/debug-tools-for-docker-selenium/selenium-webdriver-demo-javascript/node_modules/selenium-webdriver/lib/http.js:587:13)
    at Executor.execute (/Users/james/Dev/debug-tools-for-docker-selenium/selenium-webdriver-demo-javascript/node_modules/selenium-webdriver/lib/http.js:515:28)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  remoteStacktrace: ''
}

It looks like the system is trying to use Chrome for Testing, as it's looking for the Chrome binary inside the /home/seluser folder. Instead, it should be looking for Chromium at /usr/bin/chromium. If I can fix this, or if someone knows what might be happening here, we can perhaps get docker-seleniarm up and running fully again on the latest Selenium version.

I'm in the middle of a major life change and am the only maintainer, so I appreciate everyone's patience and appreciate any help others can bring to the table.

@jamesmortensen
Copy link
Author

jamesmortensen commented Dec 30, 2023

Fixed by #55 Thanks for the assist @fhoeben and @diemol

Copy link

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

@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants