Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

[BUG] selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:xxx from chrome not reachable #502

Closed
bios000 opened this issue Feb 1, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@bios000
Copy link

bios000 commented Feb 1, 2023

Environment
OS: centos 7
Python version: 3.10.6
ChatGPT Version: latest
google-version : Google Chrome 109.0.5414.119
chromedriver-version : 109.0.5414.74

Description
A clear and concise description of what the bug is.
Startup reports about chrome-related errors

Spawning browser...
Traceback (most recent call last):
File "/root/ChatGPT/src/revChatGPT/ChatGPT.py", line 626, in get_cf_cookies
driver = uc.Chrome(
File "/usr/local/bin/python310/lib/python3.10/site-packages/undetected_chromedriver/init.py", line 431, in init
super(Chrome, self).init(
File "/usr/local/bin/python310/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 80, in init
super().init(
File "/usr/local/bin/python310/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 104, in init
super().init(
File "/usr/local/bin/python310/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 286, in init
self.start_session(capabilities, browser_profile)
File "/usr/local/bin/python310/lib/python3.10/site-packages/undetected_chromedriver/init.py", line 693, in start_session
super(selenium.webdriver.chrome.webdriver.WebDriver, self).start_session(
File "/usr/local/bin/python310/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 378, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/bin/python310/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute
self.error_handler.check_response(response)
File "/usr/local/bin/python310/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:39002
from chrome not reachable
Stacktrace:
#0 0x5650dc853303
#1 0x5650dc627bbd
#2 0x5650dc6165ab
#3 0x5650dc6543c3
#4 0x5650dc64bae9
#5 0x5650dc68d4a6
#6 0x5650dc684753
#7 0x5650dc657a14
#8 0x5650dc658b7e
#9 0x5650dc8a232e
#10 0x5650dc8a5c0e
#11 0x5650dc888610
#12 0x5650dc8a6c23
#13 0x5650dc87a545
#14 0x5650dc8c76a8
#15 0x5650dc8c7836
#16 0x5650dc8e2d13
#17 0x7f8ca015dea5 start_thread

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/root/ChatGPT/test.py", line 3, in
chatbot = Chatbot(config={
File "/root/ChatGPT/src/revChatGPT/ChatGPT.py", line 91, in init
self.get_cf_cookies()
File "/root/ChatGPT/src/revChatGPT/ChatGPT.py", line 646, in get_cf_cookies
driver.quit()
UnboundLocalError: local variable 'driver' referenced before assignment

@bios000 bios000 added the bug Something isn't working label Feb 1, 2023
@acheong08
Copy link
Owner

Check if it is properly installed with the right version. Or alternatively, use the official API (free for now)

@nsde
Copy link

nsde commented Feb 9, 2023

I'm running on a headless server. Getting:

selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:57819
from chrome not reachable
Stacktrace:
#0 0x563caca2dd93 <unknown>
#1 0x563cac7fc15d <unknown>
#2 0x563cac7eaa2b <unknown>
#3 0x563cac828c63 <unknown>
#4 0x563cac8202fc <unknown>
#5 0x563cac8654f4 <unknown>
#6 0x563cac85c353 <unknown>
#7 0x563cac82be40 <unknown>
#8 0x563cac82d038 <unknown>
#9 0x563caca818be <unknown>
#10 0x563caca858f0 <unknown>
#11 0x563caca65f90 <unknown>
#12 0x563caca86b7d <unknown>
#13 0x563caca57578 <unknown>
#14 0x563cacaab348 <unknown>
#15 0x563cacaab4d6 <unknown>
#16 0x563cacac5341 <unknown>
#17 0x7f91e6c7dfa3 start_thread

@acheong08
Copy link
Owner

Install chrome and use Xvfb

@nsde
Copy link

nsde commented Feb 10, 2023

Thanks for the quick response, but how do I use Xvfb? Do I have to configure anything?

@acheong08
Copy link
Owner

#353

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants