-
Notifications
You must be signed in to change notification settings - Fork 9k
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
TimeoutError: Timed out after 30000 ms while trying to connect to Chrome! #4796
Comments
Quick update I downloaded the previous code, no really big changes... |
Did you get it to work? Same problem here ): |
not yet :/ |
Same here. Cannot get it to work |
I also have this issue, Node v10.15.3 |
Yes, but it's a different kind of error :) |
bumping because I also get this error and can't seem to find a solution. I get both |
I'm getting the similar error:
I've tried numerous 'fixes' and nothing seems to work. Node v10.16.3 |
Having the same problem was anybody able to fix this? |
If it helps anyone my issue with was due to the usage of Puppeteer in Google Cloud Function and have it running in the background. I changed the function to respond only after Puppeteer is done and it worked just fine. |
That's exactly my problem. What exactly do you mean by changing it to respond only after Puppeteer is done? |
@bruriah1999 your entry function will have a response call. Once invoked the functions technically terminated which means all other tasks are considered background tasks and won’t execute. Check the Function Execution Timeline in this article https://cloud.google.com/functions/docs/concepts/exec |
@tbadlov thank you man, you saved my day, i was struggling here for hours. |
I also faced the same problem. it got fixed on upgrading to the latest package version. |
I'm using the latest puppeteer version (2.0.0) and receiving this error. |
Unfortunately i'm having this issue with 2.1.1 |
I had the same problem. I noticed that if you deploy it using the PUB/SUB trigger, this would happen. If you use HTTP as trigger instead, it runs just fine. node.js 10 (beta) |
I'm having this issue with
I'm also using these extensions
|
I am also having this issue Uncaught (in promise) TimeoutError: Timed out after 30000 ms while trying to connect to the browser! Only Chrome at revision r756035 is guaranteed to work. |
Fix child process killing when the parent process SIGINTs. If you `ctrl + c` the Puppeteer parent process, we would sometimes not properly handle killing of the child processes. This would then leave child processes behind, with running Chromium instances. This in turn could block Puppeteer from launching again and results in cryptic errors. Instead of using the generic `process.kill` with the process id (which for some reason is negative the pid, which I don't get), we can kill the child process directly by calling `proc.kill`. Fixes #5729. Fixes #4796. Fixes #4963. Fixes #4333. Fixes #1825.
@mathiasbynens #6011 meant to fix |
Seeing this error |
i'm obtaining this error randomly after upgrading to puppeteer 3.1 |
moving to puppeteer 5 even i'm not able to understand if this fix #6011 is inside puppeteer 5 |
testing puppeteer 5.2.1, puppeteer 5 doesn't solve the issue. |
I'm getting this too; |
having the same issue. Using puppeteer |
I am having the same issue, can anyone help me with it? I am using puppeteer in AWS EC2 |
Google Cloud Functions @tbadlov's suggestions solved this for me.
I changed my main function to return a promise (via |
I am having this issue too, on Firebase Functions. Can’t figure it out. Works fine ~20% of the time and fails all others with timeout. |
I have this issue only on Firebase pubsub scheduled function. @Greyson-Sawyer can you provide the code including the Trigger function definition ? Thanks |
I am getting the same error using Cloud functions triggered by pubsub Error: TimeoutError: Timed out after 30000 ms while trying to connect to the browser! Only Chrome at revision r1036745 is guaranteed to work. Node 16 |
It's magic. Node: 18.9.0 |
@paveltretyakovru are you invoking it a lot? I found Firebase Cloud was getting throttled by the website I was connecting to due to the volume of requests. For me it was ~ 5 times a second. I put the function in multiple regions and had the clients randomly pick one as a way to load balance a little to fix it. |
@saldous , aloha! Thanks for your attention. console.log('Launch browser');
const browser = await pup.launch({ headless: false });
console.log('Opening page');
const page = await browser.newPage();
console.log('Go to page');
await page.goto('https://google.com'); My script stoping on "Launch browser", and I can't see log with "Opening page". UPD:
.... so... something wrong with WSL, but I repeat - I used my script many taimes in last month :-( |
@paveltretyakovru did you allocate enough memory? |
@saldous Sorry, memory for what? |
I got this error only when running on my Apple Silicon (with |
puppeteer-cluster randomly crashes // Create reference instance
const marked = require('marked')
const Handlebars = require("handlebars");
const fs = require('fs');
const nodeHtmlToImage = require('node-html-to-image');
const githubMarkdownTemplate = fs.readFileSync('./github-markdown-html-template.html', { encoding: 'utf-8' });
const githubMarkdown = marked.parse(`Environment: vdallano%0A%0A### Metadata Failures ###%0A| API Name |Type |Line |Column |Error Message |%0A | ------------- | ------------- | ------------- | ------------- | ------------- |%0A| Order_Record_Page |FlexiPage | | |We couldn't retrieve the design time component information for component c:rhcSignedDocumentUploader. |%0A%0A%0A### Vlocity Errors ###%0A| Errors |%0A | ------------- |%0A| error 1 |%0A| error 2 |%0A| error 3 |`.replaceAll('%0A', '\n'));
const template = Handlebars.compile(githubMarkdownTemplate);
const html = template({
githubMarkdown
});
//fs.writeFileSync('./github-markdown.html', html, { encoding: 'utf-8' });
nodeHtmlToImage({
output: './image.png',
html
})
.then(() => console.log('The image was created successfully!')) {
"name": "markdown-2-image",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"handlebars": "^4.7.7",
"html-to-image": "^1.10.8",
"marked": "^4.1.1",
"node-html-to-image": "^3.2.4"
}
}
|
lib puppeteer-extra helped me to resolve this issue code example -> https://github.com/cobalt-intelligence/log-into-google-with-puppeteer/blob/master/src/index.ts |
Do you have a code example for this? |
I encounter the same issue on MacOS, after switch to |
Had the same problem. There's a recent stackoverflow post about running puppeteer on WSL2 and the problem was that my firewall prevented access to my x-server. I followed the instruction and got it to work! https://stackoverflow.com/questions/73561240/running-puppeteer-on-wsl2 |
This was the issue for me as well. Setting up a rosetta terminal and running the command again works fine. Might be worth pointing out in the documentation. |
So what seemed to fix it for me is to simply make sure I'm spawning only one instance of the browser instead of many. let browserPromise: Promise<puppeteer.Browser>;;
const prepareBrowser = async () => {
// function responsible for launching chrome
}
const handler = () => {
...
if (!browserPromise) {
browserPromise = prepareBrowser();
}
const browser = await browserPromise;
...
} I guess that killing the browser at the end of the function should also solve the problem, but "caching" seems to be more appropriate 🤔 |
In GPC i had problem with timeout, when i instantiate the puppeteer out of the function. This is my source code working const puppeter = require('puppeteer'); //when instantiate out of the function report, a had a problem `
} |
Expanding upon this answer by @tbadlov I have 1st async function to generate a file and 2nd async (inner) function to email the generated file. Example Code Snippet:
|
For anyone still struggling with this, I managed to fix it in Cloud Run by increasing the Request timeout setting and |
I have exactly the same error with the latest version of puppeteer (21.5.0). Approximately one time out of 2, the error is impossible to catch with the try catch block, and the script ends by crashing.
|
I removed the launch options: |
@tbadlov Thank you, your suggestion worked for me. I had this which was NOT working:
Which returned immediately and stopped the puppeteer execution. |
In my case I run |
I experienced this on my chromium, this happened because I gave chromium permission to push notifications to my mac, after I turned off the permission, it went back to normal. Thank you for the disable google cloud functions suggestion above. |
I have a timeout problem with puppeteer 12.0.0, using a dockerfile with aws |
Hello
I try to implement/deploy puppeteer on Google Cloud but I have some issues. What I don't understand, it worked well 2 days ago.
Since then, I have this error:
TimeoutError: Timed out after 30000 ms while trying to connect to Chrome! The only Chrome revision guaranteed to work is r674921 at Timeout.onTimeout
I ran this command and everything seems fine : DEBUG=* node app.js
Version puppeteer : ^1.19.0
Version Node : v8.11.3
And here the code:
`async function main_screenshot(project_id) {
try {
const browser = await puppeteer.launch({
headless: true,
args: ["--window-size=1440,1000", "--no-sandbox", "--disable-setuid-sandbox", "--disable-gpu"]
});
// const browser = await puppeteer.launch({dumpio: true});
const page = await browser.newPage()
page.setUserAgent('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36')
page.setViewport({ width: 1440, height: 721 })
console.log('entering in screenshot zone')
page.setDefaultNavigationTimeout(30000)
await page.goto('https://app.slack.com/client/TLW4JE7AA/CLTFQT9GC')
await page.waitFor(3000)
await page.type('#email', process.env.SLACK_EMAIL)
await page.type('#password', process.env.SLACK_PWD)
await page.waitFor(3000)
await page.click('#signin_btn')
console.log('credentials done')
await page.waitFor(3000)
console.log('so?')
await page.goto('https://app.slack.com/client/TLW4JE7AA/CLTFQT9GC')
await page.waitFor(3000)
console.log('connected to the right environment')
const div = await page.$$('.c-message.c-message--light')
var nuwwmber_loop= 0
for (var i = div.length ; i > 0; i--) {
var text = await (await div[i - 1].getProperty('textContent')).jsonValue();
} catch (e) {
console.log(e)
}
}`
The text was updated successfully, but these errors were encountered: