Hi,
I've been trying to run Chrome in the selenium docker image (--platform=linux/amd64 selenium/standalone-chrome), and no matter what I try it keeps crashing inside the container.
I'm using python to start the chrome,
options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argument('--disable-dev-shm-usage')
options.add_argument("--no-sandbox")
driver = webdriver.Chrome(options=options)
I've tried many options, and these 3 options are the ones that suggested the most, and Chrome still crashes.
However, for the final container that I'm going to run - chrome needs to run without the headless mode. The whole idea is to run chrome inside the container and run an application in the browser window to collect some data.
I get the following error,
Traceback (most recent call last):
File "asset-audit-chrome.py", line 23, in <module>
driver = webdriver.Chrome(options=options)
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/chrome/webdriver.py", line 81, in __init__
super().__init__(
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/chromium/webdriver.py", line 106, in __init__
super().__init__(
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/webdriver.py", line 288, in __init__
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/webdriver.py", line 381, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/webdriver.py", line 444, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/errorhandler.py", line 249, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed.
(chrome not reachable)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Any help would be appreciated, I've spent countless hours in order to try to get any form of chrome running in the docker selenium container.. to no avail.
Thanks!
Manu