In the Python implementation, when I enable BiDi, I get an error log when calling WebDriver.quit().
websocket - ERROR - Thread-1 (run_socket) - _logging.py:77 - Connection to remote host was lost. - goodbye
websocket - ERROR - Thread-1 (run_socket) - _logging.py:77 - fin=1 opcode=8 data=b'\x03\xe8' - goodbye
It seems that the WebSocket connection is never closed.
Tested on Ubuntu 24.04.4.
2026-06-09 10:11:42,676 - selenium.webdriver.common.selenium_manager - DEBUG - MainThread - selenium_manager.py:124 - Selenium Manager binary found at: .venv/lib/python3.11/site-packages/selenium/webdriver/common/linux/selenium-manager
2026-06-09 10:11:42,676 - selenium.webdriver.common.selenium_manager - DEBUG - MainThread - selenium_manager.py:139 - Executing process: .venv/lib/python3.11/site-packages/selenium/webdriver/common/linux/selenium-manager --browser chrome --debug --language-binding python --output json
2026-06-09 10:11:42,728 - selenium.webdriver.common.selenium_manager - DEBUG - MainThread - selenium_manager.py:165 - Found chromedriver 149.0.7827.55 in PATH: /usr/local/bin/chromedriver
2026-06-09 10:11:42,728 - selenium.webdriver.common.selenium_manager - DEBUG - MainThread - selenium_manager.py:165 - chrome detected at /usr/bin/google-chrome
2026-06-09 10:11:42,728 - selenium.webdriver.common.selenium_manager - DEBUG - MainThread - selenium_manager.py:165 - Running command: /usr/bin/google-chrome --version
2026-06-09 10:11:42,728 - selenium.webdriver.common.selenium_manager - DEBUG - MainThread - selenium_manager.py:165 - Output: "Google Chrome 149.0.7827.102 "
2026-06-09 10:11:42,728 - selenium.webdriver.common.selenium_manager - DEBUG - MainThread - selenium_manager.py:165 - Detected browser: chrome 149.0.7827.102
2026-06-09 10:11:42,728 - selenium.webdriver.common.selenium_manager - DEBUG - MainThread - selenium_manager.py:165 - Required driver: chromedriver 149.0.7827.55
2026-06-09 10:11:42,729 - selenium.webdriver.common.selenium_manager - DEBUG - MainThread - selenium_manager.py:165 - Driver path: /usr/local/bin/chromedriver
2026-06-09 10:11:42,729 - selenium.webdriver.common.selenium_manager - DEBUG - MainThread - selenium_manager.py:165 - Browser path: /usr/bin/google-chrome
2026-06-09 10:11:42,729 - selenium.webdriver.common.service - DEBUG - MainThread - service.py:234 - Started executable: `/usr/local/bin/chromedriver` in a child process with pid: 30296 using 0 to output -3
2026-06-09 10:11:42,743 - selenium.webdriver.remote.remote_connection - DEBUG - MainThread - remote_connection.py:406 - POST http://localhost:58055/session {'capabilities': {'firstMatch': [{}], 'alwaysMatch': {'browserName': 'chrome', 'pageLoadStrategy': <PageLoadStrategy.normal: 'normal'>, 'webSocketUrl': True, 'browserVersion': None, 'goog:chromeOptions': {'extensions': [], 'binary': '/usr/bin/google-chrome', 'args': ['--enable-unsafe-extension-debugging', '--remote-debugging-pipe']}}}}
2026-06-09 10:11:42,744 - urllib3.connectionpool - DEBUG - MainThread - connectionpool.py:241 - Starting new HTTP connection (1): localhost:58055
2026-06-09 10:11:43,491 - urllib3.connectionpool - DEBUG - MainThread - connectionpool.py:544 - http://localhost:58055 "POST /session HTTP/1.1" 200 0
2026-06-09 10:11:43,491 - selenium.webdriver.remote.remote_connection - DEBUG - MainThread - remote_connection.py:439 - Remote response: status=200 | data={"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"149.0.7827.102","chrome":{"chromedriverVersion":"149.0.7827.55 (3188f8a607ae7e067593be8aab7f02d2451fec07-refs/branch-heads/7827@{#1982})","userDataDir":"/tmp/org.chromium.Chromium.scoped_dir.XAfwAT"},"fedcm:accounts":true,"goog:processID":30302,"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platformName":"linux","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify","webSocketUrl":"ws://localhost:58055/session/082db04596539fd732bdfcc93aa6c0d9","webauthn:extension:credBlob":true,"webauthn:extension:largeBlob":true,"webauthn:extension:minPinLength":true,"webauthn:extension:prf":true,"webauthn:virtualAuthenticators":true},"sessionId":"082db04596539fd732bdfcc93aa6c0d9"}} | headers=HTTPHeaderDict({'Content-Length': '902', 'Content-Type': 'application/json; charset=utf-8', 'cache-control': 'no-cache'})
2026-06-09 10:11:43,491 - selenium.webdriver.remote.remote_connection - DEBUG - MainThread - remote_connection.py:468 - Finished Request
2026-06-09 10:11:43,492 - websocket - INFO - Thread-1 (run_socket) - _logging.py:89 - Websocket connected
2026-06-09 10:11:43,592 - selenium.webdriver.remote.remote_connection - DEBUG - MainThread - remote_connection.py:406 - DELETE http://localhost:58055/session/082db04596539fd732bdfcc93aa6c0d9 {}
2026-06-09 10:11:43,644 - urllib3.connectionpool - DEBUG - MainThread - connectionpool.py:544 - http://localhost:58055 "DELETE /session/082db04596539fd732bdfcc93aa6c0d9 HTTP/1.1" 200 0
2026-06-09 10:11:43,645 - selenium.webdriver.remote.remote_connection - DEBUG - MainThread - remote_connection.py:439 - Remote response: status=200 | data={"value":null} | headers=HTTPHeaderDict({'Content-Length': '14', 'Content-Type': 'application/json; charset=utf-8', 'cache-control': 'no-cache'})
2026-06-09 10:11:43,645 - selenium.webdriver.remote.remote_connection - DEBUG - MainThread - remote_connection.py:468 - Finished Request
2026-06-09 10:11:43,648 - selenium.webdriver.remote.websocket_connection - DEBUG - Thread-1 (run_socket) - websocket_connection.py:178 - error: Connection to remote host was lost.
2026-06-09 10:11:43,649 - websocket - ERROR - Thread-1 (run_socket) - _logging.py:77 - Connection to remote host was lost. - goodbye
Description
In the Python implementation, when I enable BiDi, I get an error log when calling WebDriver.quit().
Error log when using chromedriver:
Error log when using firefox:
It seems that the WebSocket connection is never closed.
Tested on Ubuntu 24.04.4.
Reproducible Code
Debugging Logs