Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome failed to start: crashed. (chrome not reachable) #31

Open
jhnyc opened this issue Apr 2, 2022 · 7 comments
Open

Chrome failed to start: crashed. (chrome not reachable) #31

jhnyc opened this issue Apr 2, 2022 · 7 comments

Comments

@jhnyc
Copy link

jhnyc commented Apr 2, 2022

I've tested both images 3.8-selenium and 3.9-selenium using the configurations in the test_script.py:

from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')
chrome_options.add_argument('--disable-dev-shm-usage')
chrome_options.add_argument("--window-size=1920,1080")
driver = webdriver.Chrome(options=chrome_options)

Both throw this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 76, in __init__
    RemoteWebDriver.__init__(
  File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, 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.)
@AsheKR
Copy link

AsheKR commented Oct 6, 2022

+1

@AsheKR
Copy link

AsheKR commented Oct 7, 2022

In my case, I was using an M1 Mac.
I used the arm-only docker and it worked fine. selenium/standalone-chrome

@hassanshaikley
Copy link

hassanshaikley commented Oct 14, 2022

Running into this issue as well with an M1 Mac.

When I try to use selenium/standalone-chrome I get Message: 'chromedriver' executable needs to be in PATH.

@AndriiOmelianenko
Copy link

@jhnyc @AsheKR have you able to solve it?
I'm trying to run chromium-browser inside linux/amd64 built docker container on my m1 mac, having this:

/ # chromium-browser --no-sandbox --headless --disable-dev-shm-usage --disable-gpu --window-size=1920,1080 "https://example.com/"
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
[1123/102811.182268:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[1123/102811.186957:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[1123/102811.217043:WARNING:dns_config_service_linux.cc(428)] Failed to read DnsConfig.
qemu: unknown option 'type=utility'
[1123/102811.399626:WARNING:bluez_dbus_manager.cc(248)] Floss manager not present, cannot set Floss enable/disable.
[1123/102811.402807:ERROR:gpu_process_host.cc(967)] GPU process launch failed: error_code=1002
[1123/102811.403232:WARNING:gpu_process_host.cc(1273)] The GPU process has crashed 1 time(s)
[1123/102811.474123:ERROR:network_service_instance_impl.cc(470)] Network service crashed, restarting service.
qemu: unknown option 'type=utility'
[1123/102811.700157:ERROR:gpu_process_host.cc(967)] GPU process launch failed: error_code=1002
[1123/102811.700235:WARNING:gpu_process_host.cc(1273)] The GPU process has crashed 2 time(s)
[1123/102811.720520:ERROR:network_service_instance_impl.cc(470)] Network service crashed, restarting service.
qemu: unknown option 'type=utility'
[1123/102811.985840:ERROR:gpu_process_host.cc(967)] GPU process launch failed: error_code=1002
[1123/102811.985931:WARNING:gpu_process_host.cc(1273)] The GPU process has crashed 3 time(s)
[1123/102812.016132:ERROR:network_service_instance_impl.cc(470)] Network service crashed, restarting service.
[1123/102812.024892:ERROR:gpu_process_host.cc(967)] GPU process launch failed: error_code=1002
[1123/102812.024971:WARNING:gpu_process_host.cc(1273)] The GPU process has crashed 4 time(s)
qemu: unknown option 'type=utility'
[1123/102812.054398:ERROR:gpu_process_host.cc(967)] GPU process launch failed: error_code=1002
[1123/102812.054503:WARNING:gpu_process_host.cc(1273)] The GPU process has crashed 5 time(s)
[1123/102812.055918:ERROR:network_service_instance_impl.cc(470)] Network service crashed, restarting service.
qemu: unknown option 'type=utility'
[1123/102812.084531:ERROR:gpu_process_host.cc(967)] GPU process launch failed: error_code=1002
[1123/102812.084893:WARNING:gpu_process_host.cc(1273)] The GPU process has crashed 6 time(s)
[1123/102812.084977:FATAL:gpu_data_manager_impl_private.cc(450)] GPU process isn't usable. Goodbye.
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
Trace/breakpoint trap

@LW-Ho
Copy link

LW-Ho commented Dec 19, 2022

I found another function, this same as selenium.
and can running on Apple Silicon and Docker.
https://github.com/microsoft/playwright-python

@yamaszone
Copy link

Has anyone figured out the fix yet? I can reproduce this on Apple Silicon M1 based Docker. Works fine on Intel based macOS.

@cofecofe3
Copy link

cofecofe3 commented Apr 23, 2024

No answer fit in WHOLE internet for me. My case - tasting with pytset silenium, chrome browser shows error in topic and nothing helps. Solution is funny af... Open DEFAULT STANDARTY Chrome Browser window and now start your .py file and all works correctly :)
I hate this shish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants