seleniumhq-community / docker-seleniarm

Multi-Arch (arm64/armhf/amd64) Docker images for the Selenium Grid Server
https://hub.docker.com/u/seleniarm
Other
248 stars 24 forks source link

[🐛 Bug]: Issue creating webdriver instance inside docker container from Macbook with m1 chip #12

Closed nikolapopovic closed 2 years ago

nikolapopovic commented 2 years ago

What happened?

My host machine is Macbook Pro with Apple M1 Pro chip (macOS Monterey). I am trying to run selenium using seleniarm/standalone-chromium docker image. But I'm experiencing bellow issue when running docker image

====== WebDriver manager ======
Current chromium version is 102.0.5005
Get LATEST chromedriver version for 102.0.5005 chromium
There is no [linux64] chromedriver for browser 102.0.5005 in cache
Trying to download new driver from https://chromedriver.storage.googleapis.com/102.0.5005.61/chromedriver_linux64.zip
Driver has been saved in cache [/home/seluser/.wdm/drivers/chromedriver/linux64/102.0.5005.61]
Traceback (most recent call last):
  File "/standalone-chromium/main.py", line 12, in <module>
    driver = webdriver.Chrome(options=options, service=Service(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install()))
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chromium/webdriver.py", line 89, in __init__
    self.service.start()
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/common/service.py", line 98, in start
    self.assert_process_still_running()
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/common/service.py", line 110, in assert_process_still_running
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: Service /home/seluser/.wdm/drivers/chromedriver/linux64/102.0.5005.61/chromedriver unexpectedly exited. Status code was: 255

Wondering if this is an issue or I am doing something wrong?

Steps to reproduce

Here is project repository so it is easier to reproduce: https://github.com/nikolapopovic/standalone-chromium Clone the repository and run docker commands from README.

Additional notes

Same steps to reproduce were executed on Macbook machine that has Intel Core i7 processor as well as on Windows 10 machine, and no issues were presented.

Command used to start Selenium Grid with Docker

docker build -t standalone-chromium .
docker run -ti standalone-chromium

Relevant log output

====== WebDriver manager ======
Current chromium version is 102.0.5005
Get LATEST chromedriver version for 102.0.5005 chromium
There is no [linux64] chromedriver for browser 102.0.5005 in cache
Trying to download new driver from https://chromedriver.storage.googleapis.com/102.0.5005.61/chromedriver_linux64.zip
Driver has been saved in cache [/home/seluser/.wdm/drivers/chromedriver/linux64/102.0.5005.61]
Traceback (most recent call last):
  File "/standalone-chromium/main.py", line 12, in <module>
    driver = webdriver.Chrome(options=options, service=Service(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install()))
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chromium/webdriver.py", line 89, in __init__
    self.service.start()
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/common/service.py", line 98, in start
    self.assert_process_still_running()
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/common/service.py", line 110, in assert_process_still_running
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: Service /home/seluser/.wdm/drivers/chromedriver/linux64/102.0.5005.61/chromedriver unexpectedly exited. Status code was: 255

Operating System

macOS Monterey

Docker Selenium version (tag)

seleniarm-v4.2.2-20220620

diemol commented 2 years ago

Why are you using ====== WebDriver manager ====== if the docker image already has the configuration ready for Chromium/ChromeDriver?

nikolapopovic commented 2 years ago

Ok, so creating instance of webdriver without using webdriver-manager worked. The reason why I was confused is because it worked on other host machines and it didn't work on my machine which has m1 chip. We can close this one. Thanks for the assistance @diemol !

diemol commented 2 years ago

👍