Skip to content

Ubuntu 24 - X11 display failed! Will use regular xvfb! #3404

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

Closed
alepodj opened this issue Jan 9, 2025 · 2 comments
Closed

Ubuntu 24 - X11 display failed! Will use regular xvfb! #3404

alepodj opened this issue Jan 9, 2025 · 2 comments
Labels
duplicate The answer/solution already exists somewhere question Someone is looking for answers UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode

Comments

@alepodj
Copy link

alepodj commented Jan 9, 2025

Hello

Currently having an interesting issue running on of the examples "as is" but with my own url: examples/cdp_mode/raw_res_sb.py

I seem to be unable to get Chrome to open with the following errors:

start error

X11 display failed! Will use regular xvfb!

...

File "/home/<user>/Documents/Dev/inventory/venv/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: cannot connect to chrome at 127.0.0.1:9222
from chrome not reachable
...

From previous posts ive also followed up on having all X11 requirements install which i seem to have based on the outcome of all commands found in the links provided

Additionally, even when using xvfb=False it doesnt give the X11 error but it failed with the same traceback error.

I honestly dont need chrome to show up, just need to get a given event.response from the site, but neither of the modes above seem to be working for me

Thanks in advance 🙏

@mdmintz mdmintz added duplicate The answer/solution already exists somewhere question Someone is looking for answers UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode labels Jan 9, 2025
@mdmintz
Copy link
Member

mdmintz commented Jan 9, 2025

For the X11 display failed!, that's a duplicate of #3060 and #2982.

Check the following to find out if your Linux distribution is missing X11 display dependencies:


For the other error, that's a duplicate of #3370 (comment).

Message: session not created: cannot connect to chrome at 127.0.0.1:9222 from chrome not reachable

That usually means Chrome is not in the default location for the OS being used, so you must set it manually with binary_location. Eg: binary_location="/usr/bin/google-chrome". Figure out where Chrome is located, and then set it. Note that on Linux, you'll need to use either google-chrome-stable or google-chrome (but NOT chromium).

Other possible reasons may include port conflicts if multithreading, or missing Linux permissions.

Note that the point of xvfb is so that you don't have to use headless Chrome, which is detectable.

@mdmintz mdmintz closed this as completed Jan 9, 2025
@alepodj
Copy link
Author

alepodj commented Jan 9, 2025

Lifesaver!

It was: binary_location="/usr/bin/google-chrome-stable"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate The answer/solution already exists somewhere question Someone is looking for answers UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode
Projects
None yet
Development

No branches or pull requests

2 participants