Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message: timeout: Timed out receiving message from renderer with Chrome 113 #1280

Closed
steenb0k opened this issue May 21, 2023 · 10 comments
Closed

Comments

@steenb0k
Copy link

steenb0k commented May 21, 2023

Hello,

I have the following Python code that worked fine a few weeks ago.

Now it fails and I am struggling to understand why. Error is: TimeoutException: Message: timeout: Timed out receiving message from renderer.

I am using the following versions (latest):

  • OS: Ubuntu
  • Chrome version : 113.0.5672.126
  • Undetected Chromedriver : 3.4.7
  • Selenium: 4.9.1

The code works fine on my desktop but fails on Github Actions even though it used to work.

From what I understand, this error often occur when there is a missmatch between the Chrome driver and Chrome - but i'm using the latest versions here.

Is the current version Undetected Chromedriver not compatible with the latest version of Chrome (113.0.5672.126)?

pip install beautifulsoup4 webdriver-manager selenium undetected-chromedriver

###############################################################
# Selenium
from selenium import webdriver 
from selenium.webdriver.support.ui import Select 
from selenium.webdriver.support.ui import WebDriverWait 
from selenium.webdriver.support import expected_conditions as EC   
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By  

# BeautifulSoup
from bs4 import BeautifulSoup as soup  

# undetected_chromedriver 
import undetected_chromedriver as uc

###############################################################
# To configure
url_to_scrap = 'http://google.com'

# Configure undetected_chrome
options = uc.ChromeOptions()
options.add_argument('--headless')
driver = uc.Chrome(options=options, version_main=112)

# Open URL
driver.get(url_to_scrap)
Traceback (most recent call last):
  File "/XXX/scrapper_bots/test.py", line 28, in <module>
    driver.get(url_to_scrap)
  File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/undetected_chromedriver/__init__.py", line 621, in get_wrapped
    return orig_get(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/undetected_chromedriver/__init__.py", line 657, in get
    return super().get(url)
  File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 449, in get
    self.execute(Command.GET, {"url": url})
  File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute
    self.error_handler.check_response(response)
  File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: timeout: Timed out receiving message from renderer: -302.674
  (Session info: chrome=113.0.5672.0)
Stacktrace:
#0 0x55c3cc071fe3 <unknown>
#1 0x55c3cbdb0d36 <unknown>
#2 0x55c3cbd9ae14 <unknown>
#3 0x55c3cbd9ab30 <unknown>
#4 0x55c3cbd99608 <unknown>
#5 0x55c3cbd99db2 <unknown>
#6 0x55c3cbda7283 <unknown>
#7 0x55c3cbda82c2 <unknown>
#8 0x55c3cbdb84db <unknown>
#9 0x55c3cbdbc4eb <unknown>
#10 0x55c3cbd9a273 <unknown>
#11 0x55c3cbdb82a3 <unknown>

Error: Process completed with exit code 1.
@CreativeArtDesign
Copy link

Not sure but i have same problem:
Found this but did not work for me:
They said to change --headless=new you can try see if it works for you.

#chrome_options.add_argument("--headless")
chrome_options.add_argument("--headless=new")

@steenb0k
Copy link
Author

Not sure but i have same problem: Found this but did not work for me: They said to change --headless=new you can try see if it works for you.

#chrome_options.add_argument("--headless")
chrome_options.add_argument("--headless=new")

Thanks for the tip, didn't work for me neither :/

@cartersolutions
Copy link

These are the configurations that worked for me:

options = uc.ChromeOptions()
options.add_argument("enable-automation")
options.add_argument("--no-sandbox")
options.add_argument("--disable-extensions")
options.add_argument("--dns-prefetch-disable")
options.add_argument("--disable-gpu")

self.driver = uc.Chrome(options=options, version_main=113, enable_cdp_events=True, headless=True)

@CreativeArtDesign
Copy link

CreativeArtDesign commented May 28, 2023 via email

@steenb0k
Copy link
Author

These are the configurations that worked for me:

options = uc.ChromeOptions() options.add_argument("enable-automation") options.add_argument("--no-sandbox") options.add_argument("--disable-extensions") options.add_argument("--dns-prefetch-disable") options.add_argument("--disable-gpu")

self.driver = uc.Chrome(options=options, version_main=113, enable_cdp_events=True, headless=True)

Brilliant, this worked, thanks a lot!

Do you know what what change(s) caused this error to appear?

@cartersolutions
Copy link

cartersolutions commented May 28, 2023

These are the configurations that worked for me:
options = uc.ChromeOptions()
options.add_argument("enable-automation")
options.add_argument("--no-sandbox")
options.add_argument("--disable-extensions")
options.add_argument("--dns-prefetch-disable")
options.add_argument("--disable-gpu")
self.driver = uc.Chrome(options=options, version_main=113, enable_cdp_events=True, headless=True)

Brilliant, this worked, thanks a lot!

Do you know what what change(s) caused this error to appear?

It looks to me like Chrome has made some optimizations that target the gpu and since my running environment is virtual, it probably had a negative effect. I can't say for sure...just a guess.

@vinaykk5
Copy link

facing similar issue. When RDP is closed, getting timed out receiving response from renderer error in selenium logs and application running on chrome will be stuck. We have downgraded/upgraded chrome and chrome driver but still issue persists. When RDP is kept open, there is no issue observed. Can someone help here as its major blocker. Thanks in advance.

@dheeraj009joshi
Copy link

options = uc.ChromeOptions()
options.add_argument("enable-automation")
options.add_argument("--no-sandbox")
options.add_argument("--disable-extensions")
options.add_argument("--dns-prefetch-disable")
options.add_argument("--disable-gpu")

self.driver = uc.Chrome(options=options, version_main=113, enable_cdp_events=True, headless=True)

what is uc mean what is hat can anyone tell ?

@Pfefan
Copy link

Pfefan commented Jan 16, 2024

Probably their webdriver and the imported it as uc instead of webdriver as in my example here

import seleniumwire.undetected_chromedriver as webdriver

...

options = webdriver.ChromeOptions()

@felipesqra
Copy link

options = uc.ChromeOptions() options.add_argument("enable-automation") options.add_argument("--no-sandbox") options.add_argument("--disable-extensions") options.add_argument("--dns-prefetch-disable") options.add_argument("--disable-gpu")

self.driver = uc.Chrome(options=options, version_main=113, enable_cdp_events=True, headless=True)

what is uc mean what is hat can anyone tell ?

Actually means undetected_chromedriver

import undetected_chromedriver as uc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants