SeleniumHQ / selenium

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

[🐛 Bug]: selenium-driver 4.9.1 causes chrome crashes in Capybara tests #12095

Closed ngan closed 1 year ago

ngan commented 1 year ago

What happened?

After upgrading the selenium-webdriver gem from 4.9.0 => 4.9.1, we're seeing frequent chrome crashes in our capybara tests.

How can we reproduce the issue?

I'm not sure. It happens on 50% of our builds. Chrome logs don't give much information just has:

[1685009372.742][INFO]: [300ea01057ea3631a42446a81fb172a7] RESPONSE ExecuteScript ERROR unknown error: session deleted because of page crash
from unknown error: cannot determine loading status
from tab crashed
  (Session info: headless chrome=113.0.5672.126)

Please let me know how else I can be more helpful here.

Relevant log output

unknown error: session deleted because of page crash
  | from unknown error: cannot determine loading status
  | from tab crashed
  | (Session info: headless chrome=113.0.5672.126)
  |  
  | invalid session id

Operating System

Ubuntu 20.04

Selenium version

Ruby 3.2.2

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

Chrome 113.0.5672.126

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

ChromeDriver 113.0.5672.63

Are you using Selenium Grid?

No

github-actions[bot] commented 1 year ago

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

titusfortner commented 1 year ago

Duplicate of #12013

ngan commented 1 year ago

Hi @titusfortner I don't think this is a duplicate of #12013. I've already upgraded to capybara 3.39.1 which solves that argument error. This is intermittent crashes in chrome after upgrading to selenium-driver 4.9.1.

titusfortner commented 1 year ago

Oh, yes, triaging too quickly.

titusfortner commented 1 year ago

But. We need to be able to reproduce it to troubleshoot. Intermittent issues make it hard.

You can set the log level to debug to get more info. Are you using the new or the old headless mode? Does it happen in chrome 112?

ngan commented 1 year ago

Some more information. We downgraded to 4.9.0 and are still experiencing the issue. We just downgraded to 4.8.6 and will report back.

You can set the log level to debug to get more info.

Will give this a try

Are you using the new or the old headless mode?

Hm, how can I tell? Can you point me to docs 😄

Does it happen in chrome 112?

Yes, I tried downgrading chrome and chromedriver to 112 and still see the crash.

titusfortner commented 1 year ago

So it isn't just that you upgraded to 4.9.1... Any idea what else might have changed?

Was typing on my phone before; this is what turns on all the logging:

Selenium::WebDriver.logger.level = :debug

There are two headless modes now - https://www.selenium.dev/blog/2023/headless-is-going-away/

onlyoffice-testing-robot commented 1 year ago

We got similar problem - for some reason staring the browser started to fail with this error:

from unknown error: cannot determine loading status

Downgrading to google-chrome 102 didn't solve the problem

Found two similar issue in chromedriver https://bugs.chromium.org/p/chromedriver/issues/detail?id=4459 https://bugs.chromium.org/p/chromedriver/issues/detail?id=4457

But no one including us can provide detailed scenario, it just crashing on random, sometimes not crashing at all

titusfortner commented 1 year ago

Hmm, and you're using headless gem, not headless mode, so that isn't in common. :-/ I don't see how this can be caused by Selenium and not an issue with Chrome, but if you find a signal that we can use to troubleshoot, let us know.

ngan commented 1 year ago

Hi there. Just an update. We found out the Os was killing chrome due to memory issues.

brucruz commented 1 year ago

Hi there. Just an update. We found out the Os was killing chrome due to memory issues.

How did you discover that was the issue? And how did you fix it? Just upgraded the OS?

adis-io commented 1 year ago

How did you discover that was the issue? And how did you fix it? Just upgraded the OS?

+1

PS We are using docker

titusfortner commented 1 year ago

There is a bug that was fixed in 117 that causes this error, so it might be that.

ngan commented 1 year ago

@titusfortner would you happen to have the link to that bug?

ngan commented 1 year ago

How did you discover that was the issue? And how did you fix it? Just upgraded the OS?

We haven't done anything to fix the issue. Although, I've been seeing less occurrences. 🤷 I think there might have been something else running on the host that was memory intensive that we eventually moved off.

titusfortner commented 1 year ago

I lied, I mixed up another bug fix with this one. Ignore me.

github-actions[bot] commented 10 months 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.