selenium: [πŸ› Bug]: Python 4.11.x `selenium.common.exceptions.NoSuchDriverException` Docker arm64

What happened?

I’m running a small data scraper inside a Docker container. Recently I updated from chrome 112 and selenium 4.7.2 to chrome 115 and selenium 4.11.2.

After the upgrade I get this error (full output see below):

selenium.common.exceptions.NoSuchDriverException: Message: Unable to obtain driver for chrome using Selenium Manager.; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location

I tested:

chrome 112 chrome 115
selenium 4.7.2 βœ… βœ…
selenium 4.10.0 βœ… βœ…
selenium 4.11.0 ❌ ❌
selenium 4.11.2 ❌ ❌

How can we reproduce the issue?

All run on a RPI 4 8GB - Debian GNU/Linux 11 (bullseye) arm64

Dockerfile WORKING Chrome 112, Selenium 4.7.2

FROM python:3.11-bullseye

RUN apt-get update && apt-get install -y \
    chromium=112.0.5615.138-1~deb11u1 \
    chromium-common=112.0.5615.138-1~deb11u1 \
    chromium-driver=112.0.5615.138-1~deb11u1

RUN pip3 install selenium==4.7.2

COPY entrypoint.py /entrypoint.py

ENTRYPOINT [ "python3", "/entrypoint.py"]

Dockerfile NOT WORKING Chrome 115, Selenium 4.11.2

FROM python:3.11-bullseye

RUN apt-get update && apt-get install -y \
    chromium=115.0.5790.170-1~deb11u1 \
    chromium-common=115.0.5790.170-1~deb11u1 \
    chromium-driver=115.0.5790.170-1~deb11u1

RUN pip3 install selenium==4.11.2

COPY entrypoint.py /entrypoint.py

ENTRYPOINT [ "python3", "/entrypoint.py"]

Entrypoint:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

selenium_options = Options()
selenium_options.add_argument('--headless')
selenium_options.add_argument('--no-sandbox')
selenium_options.add_argument('--disable-gpu')
selenium_options.add_argument('--disable-dev-shm-usage')
selenium_options.add_argument("--window-size=1920,1200")

driver = webdriver.Chrome(options=selenium_options)
driver.get('https://google.com')

Docker compose:

version: '3'
services:
  selenium-test:
    build: '.'
    restart: unless-stopped

Relevant log output

$ docker-compose up
Creating chromium-115_selenium-4112_selenium-test_1 ... done
Attaching to chromium-115_selenium-4112_selenium-test_1
selenium-test_1  | Traceback (most recent call last):
selenium-test_1  |   File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/common/selenium_manager.py", line 123, in run
selenium-test_1  |     completed_proc = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
selenium-test_1  |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
selenium-test_1  |   File "/usr/local/lib/python3.11/subprocess.py", line 548, in run
selenium-test_1  |     with Popen(*popenargs, **kwargs) as process:
selenium-test_1  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
selenium-test_1  |   File "/usr/local/lib/python3.11/subprocess.py", line 1026, in __init__
selenium-test_1  |     self._execute_child(args, executable, preexec_fn, close_fds,
selenium-test_1  |   File "/usr/local/lib/python3.11/subprocess.py", line 1950, in _execute_child
selenium-test_1  |     raise child_exception_type(errno_num, err_msg, err_filename)
selenium-test_1  | OSError: [Errno 8] Exec format error: '/usr/local/lib/python3.11/site-packages/selenium/webdriver/common/linux/selenium-manager'
selenium-test_1  |
selenium-test_1  | The above exception was the direct cause of the following exception:
selenium-test_1  |
selenium-test_1  | Traceback (most recent call last):
selenium-test_1  |   File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/common/driver_finder.py", line 38, in get_path
selenium-test_1  |     path = SeleniumManager().driver_location(options) if path is None else path
selenium-test_1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
selenium-test_1  |   File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/common/selenium_manager.py", line 90, in driver_location
selenium-test_1  |     output = self.run(args)
selenium-test_1  |              ^^^^^^^^^^^^^^
selenium-test_1  |   File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/common/selenium_manager.py", line 129, in run
selenium-test_1  |     raise WebDriverException(f"Unsuccessful command executed: {command}") from err
selenium-test_1  | selenium.common.exceptions.WebDriverException: Message: Unsuccessful command executed: /usr/local/lib/python3.11/site-packages/selenium/webdriver/common/linux/selenium-manager --browser chrome --output json
selenium-test_1  |
selenium-test_1  |
selenium-test_1  | The above exception was the direct cause of the following exception:
selenium-test_1  |
selenium-test_1  | Traceback (most recent call last):
selenium-test_1  |   File "/entrypoint.py", line 11, in <module>
selenium-test_1  |     driver = webdriver.Chrome(options=selenium_options)
selenium-test_1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
selenium-test_1  |   File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
selenium-test_1  |     super().__init__(
selenium-test_1  |   File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/chromium/webdriver.py", line 51, in __init__
selenium-test_1  |     self.service.path = DriverFinder.get_path(self.service, options)
selenium-test_1  |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
selenium-test_1  |   File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/common/driver_finder.py", line 41, in get_path
selenium-test_1  |     raise NoSuchDriverException(msg) from err
selenium-test_1  | selenium.common.exceptions.NoSuchDriverException: Message: Unable to obtain driver for chrome using Selenium Manager.; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location
selenium-test_1  |

Operating System

Debian GNU/Linux 11 (bullseye) arm64

Selenium version

Python 4.11.2

What are the browser(s) and version(s) where you see this issue?

chromium=115.0.5790.170-1~deb11u1

What are the browser driver(s) and version(s) where you see this issue?

chromium-driver=115.0.5790.170-1~deb11u1

Are you using Selenium Grid?

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 23 (13 by maintainers)

Most upvoted comments

@bhawna0612 what is the code you are executing to get that result?

@ilyadesyatov there is a bug preventing Ruby from logging the output of Selenium Manager. I can’t tell right now why it isn’t working, we need to wait for the next release to investigate. It’s also possible that one of the many bug fixes to Selenium Manager has fixed it. Hoping to have a release β€œsoon”