Google Chrome Err Timed Out

2 views
Skip to first unread message
Message has been deleted

Fay Vitiello

unread,
Jul 14, 2024, 4:01:58 PM7/14/24
to teohetracu

I'm running about 2,000 selenium tests within a docker container and I see this failure at a rate of about 1 in 100. There are no reproducible steps as far as I can tell- the tests that fail are different with each iteration. I updated to the newest Chromedriver (2.35), but that didn't seem to have any effect. I was previously using Selenium 2.41, but have updated to the newest version (3.8.1) hoping that it might help... it did not. I'm completely at a loss as to why this might be occurring. Has anyone else noticed this? Is it possibly a bug with Chrome's newest release?

Root cause: Whenever you are loading some page with the help of selenium driver, then driver script wait till page is completely loaded. But sometime webdriver takes more time to load page, in that case you will see TimeoutException exception in your console.

Google Chrome Err timed out


Download https://tweeat.com/2yM6V4



Solution: When Page Loading takes too much time for wait so we will wait for the DOMContentLoaded event with page load strategy. This page load strategy is called Eager. A small definition of available all 3 pageload strategies.

Starting ChromeDriver 80.0.3987.16 (320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987@#185) on port 41540 Only local connections are allowed. Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code. Feb 11, 2020 10:22:12 AM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: W3C [1581412933.937][SEVERE]: Timed out receiving message from renderer: 0.100 [1581412934.066][SEVERE]: Timed out receiving message from renderer: 0.100 [1581412934.168][SEVERE]: Timed out receiving message from renderer: 0.100 [1581412934.360][SEVERE]: Timed out receiving message from renderer: 0.100 [1581412934.461][SEVERE]: Timed out receiving message from renderer: 0.100 [1581412934.618][SEVERE]: Timed out receiving message from renderer: 0.100 [1581412934.719][SEVERE]: Timed out receiving message from renderer: 0.100 [1581412934.820][SEVERE]: Timed out receiving message from renderer: 0.100 [1581412934.922][SEVERE]: Timed out receiving message from renderer: 0.100 [1581412935.097][SEVERE]: Timed out receiving message from renderer: 0.100 21

It looks like there was an issue with the newest Chrome release. Without the disable-gpu Chromeoption set, the renderer will occasionally timeout. The workaround until Google fixes this (if they do fix it at all) is to add the --disable-gpu attribute to the ChromeOptions.

In our case, we found the problem was a performance issue because the screenshot taken was huge but it happened because we realized the screenshot resolution of the screenshots created by Chrome was double than the specified in code for calling the chromedriver, for example, if we specified width 1024px and height 2000px in the screenshot, it was creating an image of 2048px width and 4000px height so that is why was taking too much for rendering and the timeout breaks the process, in cases when the process finished (after long wait) it was creating a heavy screenshot images. We found it was an option (problem) of Chrome for supporting retina devices which increase the resolution of the screenshot, so, we forced using a flag to deactivate the option and render the original resolution configured and it works well, taking between 8 seconds to 13 seconds to create the screenshot (depending on the content of the page) and the image size is less than at the begenning. This is the flag into the ChromeOptions object:

First of all the other answers have been of great help and as everyone, I too have been struggling to make the chrome webdriver work, using the endless list of arguments that it requires.Below are some of my observations after breaking my head over this for a while:

The Timeout error is received due to manually setting the timeout of the webdriver.driver.set_page_load_timeout(30)We can skip this line and resolve the error, but then the webdriver would run indefinitely if the website keeps on loading and hence is always recommended to use.

First of all, make sure the chrome driver and chrome are on the stable recent cross-compatible versions. (most common error)Since I use docker for my use-case, I let my code handle to download the latest stable versions of both chrome and chromedriver during docker build, to rule out compatibility issues.Refer here for a simple explanation of the same.

And thirdly, after the above configurations, the issue I faced was it was working for me in a docker container when run on windows, but failed to run on Linux/Kubernetes.The reason being, for Linux, it requires a PyVirtualDisplay to work.Hence adding this below piece of code before using the webdriver resolved all issues.

I tried Firefox and no issues found so this narrowed it down to Chrome. After looking through the Chromium issue tracker i found Issue 946441: Chromedriver: Timed out receiving message from renderer error for Selenium+Chrome+Jenkins(user SYSTEM)

I was seeing the Timed out receiving message from renderer: aka Net::ReadTimeout issue 100% of the time in a Cucumber test running in a Jenkins build env after the docker selenium/standalone-chrome image was updated in late Jan 2018. Adding the --disable-gpu attribute to the ChromeOptions did not fix it for me, but adding the --disable-browser-side-navigation option fixed it 100%. I found that recommendation here: =2239#c10

I know the question as about Chromedriver, but for anyone like me who isn't specifically testing on Chrome and just needs a working headless browser in Selenium: switch to Firefox (Geckodriver). I set a single option and forgot all about these Chromedriver bugs and rendering problems:

I found that in my case, the sporadic failures were because CPU resources would go up and down sporadically on the server which changes the time it takes to render elements or execute JS on a page. So, the ultimate solution for me was to simply increase the timeouts as follows:

The only tweak that reproduced reliably the Timed out receiving message from renderer error was setting page load timeout too low (in my tests "too low" was lower than 10 seconds when testing slow-loading web pages through distant and overloaded anonymous proxies).

I even gutted the entire constructor(commented out all code, removed the driver parameter, and just put a print statement in it) before posting this question and when I called the print method within the class the script failed at the line where the creation of the constructor happened.

...implies that implies that the ChromeDriver /google-chrome combo you are using is not the recent one as the current implementation of ChromeDriver follows WebDriver W3C specifications and initial logs reflects:

Hi @RajeshK It is expected that you will be signed out from time-to-time. You can avoid this by limiting the number of browser tabs you have open, avoid putting your system to sleep for long perieods of time, and limiting the amount extensions being used.

that is definitely a deeply annoying malfunction and scott brinlker may say startup should listen to customers, they should start by themselves.. from 0 to 10 it reaches the 9th stage of annoyance IMO

I noticed that I had to log in every time I closed and restarted my chrome browser. So whenever I logged in I used the gmail log in button. After I just logged in with my hubspot username and password and clicked the checkbox "remember me" it worked and whenever I closed my browser and started it again I stayed logged in.

[ChromeDriver] suppress logging of retry loop timeout: r1924789 added a retry loop while waiting for DevTools messages. This spammed users' logs with uninformative timeout reports. This CL suppresses those log messages and correctly reports the command timeout value when appropriate.

As @Tricia mentions that, ChromeDriver Version 80 modified a wait loop to allow more retries; this loop will generate that message, but it continues to listen. However the SEVERE tag for that message is misleading.

Further, in the discussion Issue 3332: Retry timeout logged as severe, @triciac [ChromeDriver Committer] also added that, ChromeDriver team added a small timeout (100 ms) to DevToolsClientImpl::HandleEventsUntil to enable additional checking of navigation status. But, unfortunately when this timeout was expiring, it is logged as SEVERE (by ProcessNextMessage). In the case of this small timeout, it should not log as SEVERE, although timeouts from SendCommandInternal still should.

So ChromeDriver needs a way to control the logging in a better way, possibly by increasing the timeout. However, if the command finally times out, the timeout duration listed being very small, then it is needed to list the user-defined timeout instead.

Root cause: Whenever you are loading some page with the help of selenium driver, then driver script wait till page is completely loaded. But sometimes webdriver takes more time to load a page, in that case, you will see the TimeoutException exception in your console.

Solution: When Page Loading takes too much time and you need to stop downloading additional subresources (images, CSS, js, etc) you can change the pageLoadStrategy through the webdriver.

Updated Solution -2: I agree with DebanjanB, PageLoad strategy with None, without download additional files (images, CSS, js, etc) is not a good idea while performing testing. I did search for all issues about it and try to find a valid solution. I tried the below options as sometimes at some point it was able to resolve this issue.

None of them helped But I found one solution again with the Page load strategy. This time we are downloading all subresources but we are waiting for the DOMContentLoaded event. This strategy called Eager. A small definition of available all 3 pageload strategies

7fc3f7cf58
Reply all
Reply to author
Forward
0 new messages