Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot connect to chrome in Linux Ubuntu 22.04 #729

Open
kisoo opened this issue Jul 18, 2022 · 3 comments
Open

cannot connect to chrome in Linux Ubuntu 22.04 #729

kisoo opened this issue Jul 18, 2022 · 3 comments

Comments

@kisoo
Copy link

kisoo commented Jul 18, 2022

My Env is
Ubuntu 22.04 Server Install (Non X Window)
Google Chrome: 103.0.5060.114 (Latest version)
Python: 3.10.4

My Dsektop: windows 10
X Server: vcxrv 64.1.20.14.0

Case 1. ssh connect with user A (wheel group)
run my script with Chrome Browser in GUI (X Window) --> works fine

Case 2. ssh connect with user A (wheel group)
run my script with headless mode --> works fine

Case 3. ssh connect with user jenkins (jenkins group)
run my script with Chrome Browser in GUI (X Window) --> works fine

Problem
Case 4. ssh connect with user jenkins (jenkins group)
run my script with headless mode --> connect error message

--- Error Message is
Traceback (most recent call last):
File "/opt/websystemcheck/dbinc-portal.py", line 574, in
driver = init_driver()
File "/opt/websystemcheck/dbinc-portal.py", line 28, in init_driver
driver = uc.Chrome(options=options)
File "/usr/local/lib/python3.10/dist-packages/undetected_chromedriver/init.py", line 401, in init
super(Chrome, self).init(
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chrome/webdriver.py", line 69, in init
super().init(DesiredCapabilities.CHROME['browserName'], "goog",
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chromium/webdriver.py", line 92, in init
super().init(
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 277, in init
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python3.10/dist-packages/undetected_chromedriver/init.py", line 589, in start_session
super(selenium.webdriver.chrome.webdriver.WebDriver, self).start_session(
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 370, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 435, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py", line 247, 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:52731
from chrome not reachable
Stacktrace:
#0 0x560409d18b13
#1 0x560409b1f51f
#2 0x560409b0eb59
#3 0x560409b4739f
#4 0x560409b3f256
#5 0x560409b7a64a
#6 0x560409b747a3
#7 0x560409b4a0ea
#8 0x560409b4b225
#9 0x560409d602dd
#10 0x560409d642c7
#11 0x560409d4a22e
#12 0x560409d650a8
#13 0x560409d3ebc0
#14 0x560409d816c8
#15 0x560409d81848
#16 0x560409d9bc0d
#17 0x7fb2b7aa4b43

@kisoo
Copy link
Author

kisoo commented Jul 18, 2022

Case 5. ssh connect with user jenkins (add to wheel group)
run my script with headless mode --> works fine

@bibs2091
Copy link

I downgraded my chrome browser to match my webdriver and it solved the problem!

@zsbai
Copy link

zsbai commented Aug 21, 2022

Google Chrome 104.0.5112.101
ChromeDriver 104.0.5112.79 (3cf3e8c8a07d104b9e1260c910efb8f383285dc5-refs/branch-heads/5112@{#1307} options.add_argument('--headless')
and i still get this error.
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:47925 from chrome not reachable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants