seleniumbase / SeleniumBase

📊 Python's all-in-one framework for web crawling, scraping, testing, and reporting. Supports pytest. UC Mode provides stealth. Includes many tools.
https://seleniumbase.io
MIT License
5.3k stars 973 forks source link

Prevent intermittent `SessionNotCreatedException` during UC Mode #3018

Closed mdmintz closed 2 months ago

mdmintz commented 2 months ago

Prevent intermittent SessionNotCreatedException during UC Mode

Here's where it happened: https://github.com/mdmintz/undetected-testing/actions/runs/10306599780/job/28530036367

Screenshot 2024-08-12 at 10 10 09 PM

I'm not sure what caused it, but I can add a retry when launching the browser during UC Mode. Also, it's possible that it was caused by a GitHub Actions issue, since it hasn't happened in 4 days.

oniononion36 commented 2 months ago

This is the same issue I am seeing on my Mac, only it never succeeds. My code looks like this:

with SB(uc=True, test=True) as sb: sb.driver.uc_open_with_reconnect('https://www.cnn.com/', 3)

mdmintz commented 2 months ago

It was only intermittent for me, and very rare.

mdmintz commented 2 months ago

This was resolved in 4.29.9 - https://github.com/seleniumbase/SeleniumBase/releases/tag/v4.29.9

oniononion36 commented 2 months ago

Weird, I tried it on my desktop (Windows) and seems like it's working fine there, any way to get detailed logging?

mdmintz commented 2 months ago

Review the stack trace, if available. Also try breakpoint() for manual debugging.