SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
29.76k stars 8.02k forks source link

[🐛 Bug]: Selenium Grid - WebDriver was unable to create a new instance of type org.openqa.selenium.chrome.ChromeDriver #14220

Closed balivadas closed 1 day ago

balivadas commented 2 days ago

What happened?

We have selenium grid setup in Windows Server 2016. We have hub and 6 nodes. Hub is started with the command
java -jar selenium-server-4.22.0.jar hub And nodes are started with the command java -jar selenium-server-4.22.0.jar node --selenium-manager true --hub http://servername:4444 --override-max-sessions true --max-sessions 8

Selenium Manager latest version is used.

And we run multiple jobs with 1000s of testcases. We are using Serenity Framework.

Occassionally when running testcases in the grid, we get the below error message

WebDriver was unable to create a new instance of type class org.openqa.selenium.chrome.ChromeDriver
WebDriver reported the following message: Could not start a new session. Unable to parse remote response: <HTML><HEAD>
<TITLE>Access Denied</TITLE>
</HEAD>
<BODY>
<FONT face="Helvetica">
<big><strong></strong></big><BR>
</FONT>
<blockquote>
<TABLE border=0 cellPadding=1 width="80%">
<TR><TD>
<FONT face="Helvetica">
<big>Access Denied (authentication_failed)</big>
<BR>
<BR>
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
Your credentials could not be authenticated: "Credentials are missing.". You will not be permitted access until your credentials can be verified.
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
This is typically caused by an incorrect username and/or password, but could also be caused by network problems.
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica" SIZE=2>
<BR>
For assistance, Please submit an <a href=https://internal security url> ITSM request with Endpoint Security using this link</a>.<br><br>Your request was categorized by Blue Coat Web Filter as 'none'. <br>If you wish to question or dispute this result, please click <a href="">here</a>.
</FONT>
</TD></TR>
</TABLE>
</blockquote>
</FONT>
</BODY></HTML>

Host info: host: 'HOST-NAME', ip: 'ip-address'
See below for more details.

And once we get the above error, subsequent all testcases fail to initiate the chrome driver.

I tried with Selenium Grid 4.15.0 and plus, and we see this issue. Unable to pin point the exact root cause.

Cannot use FINE log becaue, logs generated are more than 100Gb, because of the jobs and testcases being run.

How can we reproduce the issue?

Exactly do not know the root cause, but we are using Serenity Cucumber framework to run 1000s of testcases.

Relevant log output

NA

Operating System

Windows Server 2016

Selenium version

4.x.x

What are the browser(s) and version(s) where you see this issue?

Chrome 126version

What are the browser driver(s) and version(s) where you see this issue?

ChromeDriver 126version

Are you using Selenium Grid?

4.22.0

github-actions[bot] commented 2 days ago

@balivadas, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

diemol commented 1 day ago

This is caused by the layer you put on top of the Grid. You probably have some authentication before the request reaches the Grid. Please check with your network team.

balivadas commented 1 day ago

@diemol I am not sure why is the ticket closed. and i am not sure if i can comment in this ticket or open a new ticket. to add some inputs to your question.. if its network issue or credentials issue, it should not work for any testcase. but it works, for most of the time, and suddenly (do NOT yet know the reason), we get this error and from that point onwards all the tests fail.

diemol commented 1 day ago

Sorry, I missed to add a better explanation.

With the parameters you are using, Selenium Grid has no authentication enabled. The HTML you are getting back does not come from the Grid, it must come from something placed on top of it. So I closed it because the issue is not caused by Selenium Grid.

balivadas commented 1 day ago

Sorry, I missed to add a better explanation.

With the parameters you are using, Selenium Grid has no authentication enabled. The HTML you are getting back does not come from the Grid, it must come from something placed on top of it. So I closed it because the issue is not caused by Selenium Grid.

Thank you @diemol i will work with our network team.