Skip to content

[🐛 Bug]: unable to run selenium python in a docker container #13376

@alfonsocanor

Description

@alfonsocanor

What happened?

Python selenium running from a docker container results in timeout: Timed out receiving message from renderer: 60.000. Locally in MacOs (M2) works as expected.

How can we reproduce the issue?

- Create a python main.py
- configure this options chrome_options = Options()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-dev-shm-usage')
chrome_options.add_argument('--remote-debugging-pipe')
The last option suggested from https://github.com/SeleniumHQ/selenium/issues/13185
- Instantiate the driver using:     driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options)
- Exception: timeout: Timed out receiving message from renderer: 60.000

Relevant log output

File "/app/main.py", line 99, in <module>
    reschedule_appointments()
  File "/app/main.py", line 79, in reschedule_appointments
    driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
    super().__init__(
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/chromium/webdriver.py", line 61, in __init__
    super().__init__(command_executor=executor, options=options)
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 209, in __init__
    self.start_session(capabilities)
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 293, in start_session
    response = self.execute(Command.NEW_SESSION, caps)["value"]
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 348, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome failed to start: crashed.
  (timeout: Timed out receiving message from renderer: 60.000)
  (The process started from chrome location /opt/google/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

Operating System

MacOs + Docker

Selenium version

webdriver-manager==4.0.1

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

120

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

120

Are you using Selenium Grid?

NA

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!I-defectSomething is not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions