SeleniumHQ / selenium

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

[🐛 Bug]: fails during the page refresh - "Unable to route .../refresh" #10368

Closed plagov closed 2 years ago

plagov commented 2 years ago

What happened?

I'm creating a RemoteWebDriver. I'm doing a page refresh as follows:

driver.navigate().refresh()

From time to time it fails with the following error message:

Unable to route (POST) /session/{someSessionId}/refresh
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: 'jenkins', ip: '192.168.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.14.248-189.473.amzn2.x86_64', java.version: '11.0.12'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [e86875ad9786ae4d3770a8b387cdd174, refresh {}]
Capabilities {acceptInsecureCerts: true, browserName: chrome, browserVersion: 97.0.4692.99, chrome: {chromedriverVersion: 97.0.4692.71 (adefa7837d02a..., userDataDir: /tmp/.com.google.Chrome.D6kzvT}, goog:chromeOptions: {debuggerAddress: localhost:42467}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, proxy: Proxy(manual, http=172.17.0..., se:cdp: ws://172.28.0.2:4444/sessio..., se:cdpVersion: 97.0.4692.99, se:vnc: ws://172.28.0.2:4444/sessio..., se:vncEnabled: true, se:vncLocalAddress: ws://172.28.0.2:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}
Session ID: {someSessionId}

This issue doesn't happen every time. Instead, it fails occasionally. I'm using the following docker image with the Testcontainers library: selenium/standalone-chrome:97.0-20220121

How can we reproduce the issue?

Refresh the page with a remote web driver.

driver.navigate().refresh()

### Relevant log output

```shell
See above

Operating System

Linux

Selenium version

Java 4.1.1

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

Chrome 97.0.4692.99

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

chromedriverVersion: 97.0.4692.71

Are you using Selenium Grid?

No response

github-actions[bot] commented 2 years ago

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

titusfortner commented 2 years ago

So, I'm not sure what to do with this; There's not much we can do without a way to consistently reproduce your issue.

We have refresh tests that run on Linux for Chrome via Remote driver that are consistently passing https://github.com/SeleniumHQ/selenium/runs/5128937182?check_suite_focus=true#step:9:304

So at the very least we need more information. Do you have more of an error message, chromedriver logs, or Server logs?

github-actions[bot] commented 2 years ago

Hi, @plagov. Please follow the issue template, we need more information to reproduce the issue.

Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue.

Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough.

Reply to this issue when all information is provided, thank you.

plagov commented 2 years ago

@titusfortner I really don't know what else can I provide for you to reproduce it consistently. This issue doesn't reproduce consistently in my code so I could describe the concrete state and configuration.

If you think that the refresh action is well tested in Selenium 4 and works as expected, then sure - let's close this issue and keep it in history. Maybe someone else will experience the same issue and will be able to provide more details.

At this point, I really don't have anything more to add here.

diemol commented 2 years ago

Yes, we do have tests for this. If anyone else bumps into this issue, please provide a code snippet to reproduce it.

plagov commented 2 years ago

We did with a colleague an additional analysis of this issue and looks like it happens because of an expired timeout from the RemoteWebDriver. In our program, we have cases when the driver waits for 5 min for the next command. Until then it stays idle and waits. The waiting time is floating and it isn't 5 min every time. But when it was close or reached 5 min, then this issue happened.

So, we solved that by increasing the timeout for the driver through an environment variable: SE_NODE_SESSION_TIMEOUT.

Sorry, for a "false alarm". I hope, that will help someone else should anyone encounter the same.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.