WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally with ChromeDriver Chrome and Selenium through Python on VPS

前端 未结 2 1376
悲&欢浪女
悲&欢浪女 2020-12-11 23:09

So I have the exact same error as these posts

Selenium 'Chrome failed to start: exited abnormally' error

Unknown error: Chrome failed to start: exit

相关标签:
2条回答
  • 2020-12-11 23:37

    You haven't provided your browser's version, but chromedriver 2.30 is pretty old - circa June 2017; Chrome was version 59 then, and at 72 now. (yes, I checked, it's not like I know their release history by heart

    0 讨论(0)
  • 2020-12-11 23:47

    This error message...

    selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
      (Driver info: chromedriver=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57),platform=Linux 4.15.0-42-generic x86_64)
    

    ...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.

    There are exactly two incompatibility issues as discussed below.


    disable-gpu

    When Headless Chrome was first released as GA (General Availability) by Google Team the article Getting Started with Headless Chrome mentioned that :

    --disable-gpu \                # Temporarily needed if running on Windows.
    

    A note was added as :

    Right now, you'll also want to include the --disable-gpu flag if you're running on Windows.

    As per the discussion Headless: make --disable-gpu flag unnecessary it was clear that :

    The --disable-gpu flag is no longer necessary on Linux or Mac OSX. It will also become unnecessary on Windows as soon as the bug SwiftShader fails an assert on Windows in headless mode is fixed. Now as this issue is marked fixed the argument --disable-gpu should be redundant now.

    Note: You can find a detailed discussion in ERROR:gpu_process_transport_factory.cc(1007)-Lost UI shared context : while initializing Chrome browser through ChromeDriver in Headless mode


    However, your main issue is the incompatibility between the version of the binaries you are using as follows:

    • You are using chromedriver=2.30
    • Release Notes of chromedriver=2.30 clearly mentions the following :

    Supports Chrome v58-60

    • Your chrome version is unknown to us. Assuming you are using on of the latest Chrome releases either among:
      • Chrome version 71
      • Chrome version 72
      • Chrome version 73

    So there is a clear mismatch between ChromeDriver v2.30 and the Chrome Browser v71-73

    Solution

    • Depending on your Chrome Browser version upgrade ChromeDriver accordingly following the guidelines below:
      • If you are using Chrome version 73, you need to download ChromeDriver 73.0.3683.20
      • If you are using Chrome version 72, you need to download ChromeDriver 2.46 or ChromeDriver 72.0.3626.69
      • If you are using Chrome version 71, you need to download ChromeDriver 2.46 or ChromeDriver 71.0.3578.137
      • For older version of Chrome, see this discussion for the version of ChromeDriver that supports it.

    References

    You can find a couple of relevant discussions in:

    • OpenQA.Selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally while executing tests through Selenium start on linux
    • WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally with ChromeDriver Chrome and Selenium on debian server
    • Message: unknown error: Chrome failed to start: exited abnormally on AWS Cloud9 with Linux 4.9.85-38.58.amzn1.x86_64 x86_64
    0 讨论(0)
提交回复
热议问题