Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

cdp mode in container without noroot user. #3838

Answered by mdmintz
serg-sno asked this question in Q&A
Discussion options

Hello, and thank you for your project!
SeleniumBase works perfectly in CDP mode in Kubernetes when run as the root user, but when I try to run it as a non-root user, I get an error.
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: cannot connect to chrome at 127.0.0.1:9222
Could you please advise if it’s possible to run SeleniumBase without root privileges?

You must be logged in to vote

Sounds like Chrome might not be in the default location for non-root users.
Try setting the binary_location arg with the location of Chrome when using a non-root user.
If that doesn't help, then there are probably missing permissions that are needed.

UC Mode / CDP Mode require more permissions than regular mode because of launching Chrome from the command-line, and for modifying the default chromedriver to turn it into uc_driver.

Replies: 2 comments 1 reply

Comment options

Sounds like Chrome might not be in the default location for non-root users.
Try setting the binary_location arg with the location of Chrome when using a non-root user.
If that doesn't help, then there are probably missing permissions that are needed.

UC Mode / CDP Mode require more permissions than regular mode because of launching Chrome from the command-line, and for modifying the default chromedriver to turn it into uc_driver.

You must be logged in to vote
0 replies
Answer selected by mdmintz
Comment options

As I understand, Chrome should use --no-sandbox flag. But there is no option to set sandbox parameter to False for cdp here: source

You must be logged in to vote
1 reply
Comment options

It’s already set when using Linux from SB():

chrome_options.add_argument("--no-sandbox")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /