0

I have a python 3.11 program which is using selenium and works fine on my PC. However, I just decided to move the program on my new Synology NAS 1812+. I've known that I need to be careful since Synology is not support Google Chrome and I need to do additional handles to make my docker container includes Google Chrome and chrome drive by myself. Therefore, my Dockerfile shows as below:

# install unzip
RUN apt update && apt-get install -yqq unzip build-essential
# install Google Chrome
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN dpkg -i --force-depends google-chrome-stable_current_amd64.deb; apt-get -fy install
# install Chrome drive
RUN wget https://chromedriver.storage.googleapis.com/113.0.5672.63/chromedriver_linux64.zip
RUN unzip chromedriver_linux64.zip chromedriver -d /app/

I also double confirmed the version of the google chrome that I installed in the container/

Package: google-chrome-stable
Status: install ok installed
Priority: optional
Section: web
Installed-Size: 307137
Maintainer: Chrome Linux Team <chromium-dev@chromium.org>
Architecture: amd64
Version: 113.0.5672.92-1
Provides: www-browser
Depends: ca-certificates, fonts-liberation, libasound2 (>= 1.0.17), libatk-bridge2.0-0 (>= 2.5.3), libatk1.0-0 (>= 2.2.0), libatspi2.0-0 (>= 2.9.90), libc6 (>= 2.17), libcairo2 (>= 1.6.0), libcups2 (>= 1.6.0), libcurl3-gnutls | libcurl3-nss | libcurl4 | libcurl3, libdbus-1-3 (>= 1.9.14), libdrm2 (>= 2.4.75), libgbm1 (>= 17.1.0~rc2), libglib2.0-0 (>= 2.39.4), libgtk-3-0 (>= 3.9.10) | libgtk-4-1, libnspr4 (>= 2:4.9-2~), libnss3 (>= 2:3.31), libpango-1.0-0 (>= 1.14.0), libu2f-udev, libvulkan1, libx11-6 (>= 2:1.4.99.1), libxcb1 (>= 1.9.2), libxcomposite1 (>= 1:0.4.4-1), libxdamage1 (>= 1:1.1), libxext6, libxfixes3, libxkbcommon0 (>= 0.5.0), libxrandr2, wget, xdg-utils (>= 1.0.2)
Pre-Depends: dpkg (>= 1.14.0)
Description: The web browser from Google

However, while my program run, the docker log shows errors as below:

self.driver = webdriver.Chrome('./chromedriver')
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 80, in __init__
    super().__init__(
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 104, in __init__
    super().__init__(
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 286, in __init__
    self.start_session(capabilities, browser_profile)
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 378, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

To run the docker and the program, it shows the above error. But it actually complete the task for the first time, but it seems stopped after the first run, cause there's no more further logs after the first run.

As above that I tried, I have no idea what's other possible issue to cause the exception. Some people said the reason of the error is caused by mis-match version of Google Chrome and chrome drive. However, according what I checked and prepared, I think my chrome drive is in correct version.

Is any one can give me some directions or ideas?

0 Answers0