Skip to content

selenium.common.exceptions.SessionNotCreatedException when running in Ubuntu #2312

Closed
@el-bekasto

Description

@el-bekasto

I'm having this error while running seleniumbase with undetected_chromedriver moduke. This is how I declare driver:
driver = Driver(headless2=True, uc=True, no_sandbox=True)
This is the error printed in console:

  File "/usr/local/lib/python3.10/dist-packages/seleniumbase/core/browser_launcher.py", line 3391, in get_local_driver
    driver = undetected.Chrome(
  File "/usr/local/lib/python3.10/dist-packages/seleniumbase/undetected/__init__.py", line 217, in __init__
    options.binary_location = (
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chromium/options.py", line 52, in binary_location
    raise TypeError(self.BINARY_LOCATION_ERROR)
TypeError: Binary Location Must be a String

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/bot/automator.py", line 149, in <module>
    automate_selen([16502702])
  File "/bot/automator.py", line 101, in automate_selen
    driver = Driver(headless2=True, uc=True, no_sandbox=True)
  File "/usr/local/lib/python3.10/dist-packages/seleniumbase/plugins/driver_manager.py", line 463, in Driver
    driver = browser_launcher.get_driver(
  File "/usr/local/lib/python3.10/dist-packages/seleniumbase/core/browser_launcher.py", line 1562, in get_driver
    return get_local_driver(
  File "/usr/local/lib/python3.10/dist-packages/seleniumbase/core/browser_launcher.py", line 3757, in get_local_driver
    driver = webdriver.Chrome(service=service)
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
    super().__init__(
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chromium/webdriver.py", line 56, in __init__
    super().__init__(
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 208, in __init__
    self.start_session(capabilities)
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 292, in start_session
    response = self.execute(Command.NEW_SESSION, caps)["value"]
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 347, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.10/dist-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: exited normally.
  (session not created: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /root/.cache/selenium/chrome/linux64/119.0.6045.105/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Stacktrace:
#0 0x55aa7d0b25e3 <unknown>
#1 0x55aa7cd750b7 <unknown>
#2 0x55aa7cdabe55 <unknown>
#3 0x55aa7cda8b81 <unknown>
#4 0x55aa7cdf347f <unknown>
#5 0x55aa7cde9cc3 <unknown>
#6 0x55aa7cdb50e4 <unknown>
#7 0x55aa7cdb60ae <unknown>
#8 0x55aa7d078ce1 <unknown>
#9 0x55aa7d07cb7e <unknown>
#10 0x55aa7d0664b5 <unknown>
#11 0x55aa7d07d7d6 <unknown>
#12 0x55aa7d049dbf <unknown>
#13 0x55aa7d0a0748 <unknown>
#14 0x55aa7d0a0917 <unknown>
#15 0x55aa7d0b1773 <unknown>
#16 0x7ff22bec8ac3 <unknown>```

Metadata

Metadata

Assignees

No one assigned

    Labels

    UC Mode / CDP ModeUndetected Chromedriver Mode / CDP Modeself-resolvedYou closed/solved the issue on your own

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions