ChatGPT icon indicating copy to clipboard operation
ChatGPT copied to clipboard

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

Open bios000 opened this issue 3 years ago • 5 comments

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 avatar Feb 01 '23 09:02 bios000

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

acheong08 avatar Feb 01 '23 10:02 acheong08

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

nsde avatar Feb 09 '23 20:02 nsde

Install chrome and use Xvfb

acheong08 avatar Feb 09 '23 23:02 acheong08

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

nsde avatar Feb 10 '23 08:02 nsde

https://github.com/acheong08/ChatGPT/issues/353

acheong08 avatar Feb 10 '23 10:02 acheong08