Puppeteer error crash: Failed to launch the browser process!

Project id: cc7f19a6-bd5b-4ec4-8b2c-4f69684f4cc4 My puppeteer application occasionally crash. Puppeteer is launched with args: ["--no-sandbox"] In that time of a crash i can see on metrics that app ram usage spike from 600mb to 1gb and i get this error log: https://pastebin.com/9DK4Jqes
Pastebin
Railway log - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
34 Replies
Percy
Percy2y ago
Project ID: cc7f19a6-bd5b-4ec4-8b2c-4f69684f4cc4
Brody
Brody2y ago
send your package.json?
Brody
Brody2y ago
thats it?
lowzyyy
lowzyyyOP2y ago
yeah
Brody
Brody2y ago
tiny
lowzyyy
lowzyyyOP2y ago
its simple telegram bot app
Brody
Brody2y ago
fair send me your repo please?
lowzyyy
lowzyyyOP2y ago
GitHub
GitHub - lowzyyy/crypto-price-telegram-bot
Contribute to lowzyyy/crypto-price-telegram-bot development by creating an account on GitHub.
lowzyyy
lowzyyyOP2y ago
here there is node-fetch but node 18 has it so i should uninstall it i am deploying railway branch, almost the same as master
Brody
Brody2y ago
does coingecko not have an api?
lowzyyy
lowzyyyOP2y ago
i am using coingecko in there
Brody
Brody2y ago
yeah but with puppet, not an api
lowzyyy
lowzyyyOP2y ago
but puppeteer for traidingview scrape chart pictures for various timeframes
Brody
Brody2y ago
you cant access that data with coingeckos api?
lowzyyy
lowzyyyOP2y ago
i want chart image so i screenshot the web page
Brody
Brody2y ago
okay understood
lowzyyy
lowzyyyOP2y ago
so why is this happening?
Brody
Brody2y ago
Brody
Brody2y ago
i cant replicate your error
lowzyyy
lowzyyyOP2y ago
i am saying that error is happening occasionally
Brody
Brody2y ago
code issue and thus out of the scope of these help threads
lowzyyy
lowzyyyOP2y ago
my code or puppeteer code?
Brody
Brody2y ago
yours
lowzyyy
lowzyyyOP2y ago
i am not doing pthread_create
Brody
Brody2y ago
you dont have to be to cause such an error
lowzyyy
lowzyyyOP2y ago
error is saying that operating system had error some source is not available i dont know how can my code make this problem
Brody
Brody2y ago
yes scary error means you are doing something very wrong
lowzyyy
lowzyyyOP2y ago
opening and closing browser on interval. Very hardcore programming 😄
Brody
Brody2y ago
with all due respect, your codebase isnt good to put it lightly hard to read, bad formatting, bad practices, etc etc
lowzyyy
lowzyyyOP2y ago
can you point out what bad practices, i am trying to learn formatting is done with prettier extension
Brody
Brody2y ago
out of the scope of what these help threads are for unfortunately if it was simple id tell you, but the code is what some would call "spaghetti code"
lowzyyy
lowzyyyOP2y ago
ok, thanks for help after a lot of inspections i came to conclusion that i am not doing anything wrong. It seems (for now) that keeping the browser opened and opening/closing pages works better than opening and closing browser. There is some problem with opening the browser on linux because i did not have this problem at windows at all Update2: puppeteer definitely leaks memory if you open/close pages a lot or at least on interval. RAM memory was always growing to the 700-800mb and i just used 3 pages!!! Then i switched again to open/close browser strategy because closing the browser will free the used RAM until next call of the function. BUT linux have problem with opening the chrome browser. It would often crash, at least once a day. Sometime it wont even restart the container because how bad crash was!!! So i found the solution. For some unknown reason chrome wont close properly in this container so i had to manually kill the process to free threads being used. Because chrome would not free the thread, after some time it would crash container because there would not be free threads to use. This fixed my problem for now: import shell from "shelljs"; Then after await browser.close() i would run: shell.exec("pkill chrome");
Want results from more Discord servers?
Add your server