selenium icon indicating copy to clipboard operation
selenium copied to clipboard

[🐛 Bug]: org.openqa.selenium.WebDriverException: Unable to route (POST) /session/0405a24bf1d06c6ae8402b8d12027934/...

Open joerg1985 opened this issue 1 year ago • 8 comments

What happened?

When executing a command on a just timedout session a WebDriverException: Unable to route ... is raised.

How can we reproduce the issue?

For some seconds after the session timedout there is a inconsistent state, until the sessionCleanupNodeService of the LocalNode did run. The LocalSessionMap still tells the session does exist, but the Node.isSessionOwner does return false. This will prevent the route inside the Node is matched and lead to the WebDriverException: Unable to route ....

Relevant log output

N/A

Operating System

Win 10 x64

Selenium version

4.17.1

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

N/A

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

N/A

Are you using Selenium Grid?

N/A

joerg1985 avatar Apr 03 '24 09:04 joerg1985

@joerg1985, 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!

github-actions[bot] avatar Apr 03 '24 09:04 github-actions[bot]

How do you think Grid should behave in this case? Should the exception be more clear?

diemol avatar Apr 11 '24 09:04 diemol

@diemol At this time the exception is raised the session is allready timed out. So i would expect a NoSuchSessionException and not something that indicates an grid bug.

joerg1985 avatar Apr 11 '24 11:04 joerg1985

Do you know where this exception was shown? I can tweak the response we send to the user.

diemol avatar Apr 11 '24 12:04 diemol

It is raised here: https://github.com/SeleniumHQ/selenium/blob/2b5999625744adccf2a0ad30cdd18d503044603b/java/src/org/openqa/selenium/grid/web/RoutableHttpClientFactory.java#L60-L68

Here the session map still returns the session, but the following ownership check fails: https://github.com/SeleniumHQ/selenium/blob/2b5999625744adccf2a0ad30cdd18d503044603b/java/src/org/openqa/selenium/grid/node/Node.java#L149-L151

joerg1985 avatar Apr 11 '24 18:04 joerg1985

This issue is looking for contributors.

Please comment below or reach out to us through our IRC/Slack/Matrix channels if you are interested.

github-actions[bot] avatar Jul 12 '24 08:07 github-actions[bot]