-
Notifications
You must be signed in to change notification settings - Fork 921
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
Timed out waiting for Chrome connection after Restarting Chrome #761
Comments
This comment was marked as outdated.
This comment was marked as outdated.
@nijinekoyo I am having the same issue and the only way to get rid of this is to restart the container as for now |
I'm currently doing the same thing, setting a super long reset chrome time, and then restarting the container regularly, but I always feel that this may cause problems: ( |
@nijinekoyo I followed this solution and it worked for me #755 |
This comment was marked as outdated.
This comment was marked as outdated.
Here on GitHub, there are several created issues with 504 errors. I tried to read the Chrome log file, but there's nothing when a 504 error happens. I think it might be somehow related either to the OS (e.g. Ubuntu Server on digital ocean), On the same Ubuntu server droplet, I tried to run this container: This docker image has older Chrome inside. I checked prerender server diff here on Github, I suspect the 504 error might be somehow related to newer Chrome, OS, or some environment configuration. views? |
I am trying a workaround by adding the code below: this.startPrerender(); at the end of which will be like: server.restartBrowser = function () {
this.isBrowserConnected = false;
util.log(`Restarting ${this.browser.name}`);
this.browser.kill();
this.startPrerender(); //<--- This will be added
}; I believe there is an issue with latest chrome versions which causes error on prerender to listen I am not sure if it will cause any memory leak but it is working for now, at least. Disable // server.use(prerender.browserForceRestart()); UPDATE: No chance :( Memory leak as I guessed. Trying to install older Chrome version that I got from the container @jirikrepl shared. |
None of the approaches I tried have worked yet. Even tried chromium versions instead of chrome-stable but no chance. Considering permission issues now. |
Hi guys, I faced the same problem. I have for this problem a quick and dirty workaround.👯 create a new file e.q monitor.js and copy paste this: const { spawn } = require('child_process'); let yourCommand; function startAndMonitorProcess() { yourCommand = spawn('node', ['server.js']); yourCommand.stdout.on('data', (data) => { yourCommand.stderr.on('data', (data) => { yourCommand.on('close', (code) => { startAndMonitorProcess(); this will check the output of server.js if the problem is listed in the console - this script will kill the instance and create a new server.js instance and begins from begin to listen the output. |
Great I've made some additions to put some pm2 magic in it. you can save it as pm2_monitor.js and run it also by using pm2 like const { spawn, exec } = require('child_process');
const pm2 = require('pm2')
let yourCommand;
function pm2Start() {
if (yourCommand) {
exec('pkill chrome');
yourCommand.stdout.removeAllListeners('data');
yourCommand.kill();
pm2.disconnect();
}
pm2.connect(function (err) {
if (err) {
console.error(err)
process.exit(2)
}
pm2.start({
script: 'server.js',
name: 'server',
instances: 7
}, function (err, apps) {
if (err) {
console.error(err)
return pm2.disconnect()
}
yourCommand = spawn('pm2', ['log']);
yourCommand.stdout.on('data', (data) => {
if (data.includes('page timed out') || data.includes('parse html timed out') || data.includes('Timed out waiting for')) {
console.log("Error detected! Restarting...");
pm2.kill(function () {
pm2Start();
});
}
});
})
});
}
pm2Start(); |
We should find a proper solution for the main issue btw. I am still investigating. |
Same issue.. confirmed on Mac M2 with Chrome 114 |
Is there any update for this? Facing the same issue |
Facing the same with ubuntu 22.04 and chrome 71 |
The same Debian 10 + Chrome 120 |
I'm having the same problem on my deployment. The way I partially solved was to run 4 processes (4 containers, each one running I'm not sure if it's related to browser restarting (the restart plugin is enabled) but saw this on container's stdout:
|
Running prerender in a docker container, after a period of time, all requests
Timed out waiting for Chrome connection
will appear. After observation, I found that most of them appear afterRestarting Chrome
. I try to setBROWSER_TRY_RESTART_PERIOD
time This problem will appear faster after being shortened. It is speculated that the source of the problem is a problem with the steps to reset ChromeVersion:
The text was updated successfully, but these errors were encountered: