SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.77k stars 8.2k forks source link

[🐛 Bug]: Chrome-Linux64 driver cannot start: chromedriver unexpectedly exited. Status code was: 127 #14310

Closed arabellastrange closed 3 months ago

arabellastrange commented 3 months ago

What happened?

I have been using the chrome-linux driver in python + selenium==4.22.0 with this call:

            options = Options()
            options.page_load_strategy = "eager"
            options.add_argument("--headless")
            with webdriver.Chrome(options=options) as dr:
                dr.set_page_load_timeout(timeout)
                .......

and this call:

            options = Options()
            options.page_load_strategy = "eager"
            options.add_argument("--headless")
            options.add_argument("--no-sandbox")
            options.add_argument("--disable-dev-shm-usage")

            options.add_argument("start-maximized")
            options.add_argument("disable-infobars")
            options.add_argument("--disable-extensions")
            options.add_argument("--disable-gpu")
            options.add_argument("--disable-dev-shm-usage")
            result = ""
            try:
                driver = webdriver.Chrome(options=options)
                driver.set_page_load_timeout(timeout)
                ......
            except selenium.common.exceptions.WebDriverException:
                traceback.print_exc()
                return .....

Which until, to the best of my knowledge, 23.07.2024 was working well. As of 25.07.2024 however, I am now seeing this error when I try to initialise the driver:

selenium.common.exceptions.WebDriverException: Message: Service /home/user/.cache/selenium/chromedriver/linux64/127.0.6533.72/chromedriver unexpectedly exited. Status code was: 127

The error appears when I try to deploy my app on a server (I've tried a local reverse Nginx proxy (Linux) and HuggingFace spaces (Linux)) but not when I run the code locally on my (Windows) machine.

I've tried to solve this issue by:

So far, I've had no luck. Any ideas what the problem might be?

How can we reproduce the issue?

The huggingface version of this code is available on this repo: https://huggingface.co/spaces/arabellastrange/search-assistant/tree/main. 

Specifically in the file, line 81: https://huggingface.co/spaces/arabellastrange/search-assistant/blob/main/web_search.py

Relevant log output

Traceback (most recent call last):
  File "/home/user/app/web_search.py", line 81, in process_url
    driver = webdriver.Chrome(options=options)
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
    super().__init__(
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 55, in __init__
    self.service.start()
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/common/service.py", line 102, in start
    self.assert_process_still_running()
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/common/service.py", line 115, in assert_process_still_running
    raise WebDriverException(f"Service {self._path} unexpectedly exited. Status code was: {return_code}")
selenium.common.exceptions.WebDriverException: Message: Service /home/user/.cache/selenium/chromedriver/linux64/127.0.6533.72/chromedriver unexpectedly exited. Status code was: 127

Operating System

Debian

Selenium version

4.22.0

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

Chrome (latest)

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

ChromeDriver-Linux64 (latest)

Are you using Selenium Grid?

No

github-actions[bot] commented 3 months ago

@arabellastrange, 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!

arabellastrange commented 3 months ago

Update on running the code with a manually installed local chromedriver, back to the same error:

Traceback (most recent call last):
  File "/home/user/app/web_search.py", line 86, in process_url
    driver = webdriver.Chrome(service=ChromeService(executable_path='chromedriver-linux64/chromedriver'), options=options)
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
    super().__init__(
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 55, in __init__
    self.service.start()
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/common/service.py", line 102, in start
    self.assert_process_still_running()
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/common/service.py", line 115, in assert_process_still_running
    raise WebDriverException(f"Service {self._path} unexpectedly exited. Status code was: {return_code}")
selenium.common.exceptions.WebDriverException: Message: Service chromedriver-linux64/chromedriver unexpectedly exited. Status code was: 127
samaritan1998 commented 3 months ago

same question

diemol commented 3 months ago

Chrome 127 was released in that timeframe, please report the issue to the Chrome folks.

github-actions[bot] commented 3 months ago

Hi, @arabellastrange. This issue has been determined to require fixes in ChromeDriver.

You can see if the feature is passing in the Web Platform Tests.

If it is something new, please create an issue with the ChromeDriver team. Feel free to comment the issues that you raise back in this issue. Thank you.

github-actions[bot] commented 2 months ago

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.