添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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 [🐛 Bug]: selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed. #10673 [🐛 Bug]: selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed. #10673 fireattack opened this issue May 20, 2022 · 5 comments

What happened?

webdriver doesn't seem be able to start chrome properly. Visually I can't see any window popping up.

It was working at around Chrome v99.

This bug does NOT happen if I add options.add_argument('--headless') . Anything else like

options.add_argument('--disable-gpu')
options.add_argument('--single-process')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')

does NOT help.

How can we reproduce the issue?

from selenium import webdriver
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(options=options)
driver.get('https://example.com')
print(driver.title)
driver.close()

Relevant log output

F:\sync\code\python\_gists>_test5.py
Traceback (most recent call last):
  File "F:\sync\code\python\_gists\_test5.py", line 14, in <module>
    driver = webdriver.Chrome(options=options)
  File "C:\Program Files\Python3\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "C:\Program Files\Python3\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 92, in __init__
    RemoteWebDriver.__init__(
  File "C:\Program Files\Python3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 275, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Program Files\Python3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 365, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Program Files\Python3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 430, in execute
    self.error_handler.check_response(response)
  File "C:\Program Files\Python3\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed.
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Stacktrace:
Backtrace:
        Ordinal0 [0x0126B8F3+2406643]
        Ordinal0 [0x011FAF31+1945393]
        Ordinal0 [0x010EC748+837448]
        Ordinal0 [0x01109994+956820]
        Ordinal0 [0x01105D71+941425]
        Ordinal0 [0x01138EE0+1150688]
        Ordinal0 [0x01138B3A+1149754]
        Ordinal0 [0x01134096+1130646]
        Ordinal0 [0x0110E636+976438]
        Ordinal0 [0x0110F546+980294]
        GetHandleVerifier [0x014D9612+2498066]
        GetHandleVerifier [0x014CC920+2445600]
        GetHandleVerifier [0x01304F2A+579370]
        GetHandleVerifier [0x01303D36+574774]
        Ordinal0 [0x01201C0B+1973259]
        Ordinal0 [0x01206688+1992328]
        Ordinal0 [0x01206775+1992565]
        Ordinal0 [0x0120F8D1+2029777]
        BaseThreadInitThunk [0x752D343D+18]
        RtlInitializeExceptionChain [0x772A9812+99]
        RtlInitializeExceptionChain [0x772A97E5+54]

Operating System

Windows 7

Selenium version

Python 3.8.7 + selenium 4.1.5

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

Chrome 101.0.4951.67

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

ChromeDriver 101.0.4951.41 (93c720db8323b3ec10d056025ab95c23a31997c9-refs/branch-heads/4951@{#904})

Are you using Selenium Grid?

@fireattack, thank you for creating this issue. We will troubleshoot it as soon as we can.

Info for maintainers Triage this issue by using labels. If information is missing, add a helpful comment and then I-issue-template label. If the issue is a question, add the I-question label. If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label. If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue. After troubleshooting the issue, please add the R-awaiting answer label. Thank you!

There are several potential reasons for getting this error, please investigate these sources to determine which applies to your issue:

https://stackoverflow.com/questions/50642308/webdriverexception-unknown-error-devtoolsactiveport-file-doesnt-exist-while-t

https://github.com/SeleniumHQ/selenium/issues?q=is%3Aissue+DevToolsActivePort+

Yeah, I've read all of them; and as mentioned above, --headless can make it work as a workaround.

The issue is I didn't need to do so just two Chrome versions ago with no significant system change.

Problem solved after I manually assigned options.binary_location. This seems like a proper solution than just work-around.

Thanks for your reply.