[Bug] Crash of process exit(1) [puppeteer-extra-plugin-recaptcha]
See original GitHub issueWhen using the “puppeteer-extra-plugin-recaptcha” module, I often encounter the error:
exit(1)
events.js:292
throw er; // Unhandled 'error' event
^
Error: connect ECONNREFUSED 89.108.117.181:80
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
Emitted 'error' event on ClientRequest instance at:
at Socket.socketErrorListener (_http_client.js:469:9)
at Socket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '89.108.117.181',
port: 80
}
It is most likely related to network problems.
We check the ip address and get the culprit:
host 89.108.117.181
181.117.108.89.in-addr.arpa domain name pointer 2captcha.com.
My packages in package.json:
{
"dependencies": {
"cheerio": "^1.0.0-rc.3",
"node-telegram-bot-api": "^0.50.0",
"puppeteer": "^5.5.0",
"puppeteer-extra": "^3.1.15",
"puppeteer-extra-plugin-adblocker": "^2.11.9",
"puppeteer-extra-plugin-recaptcha": "^3.3.0",
"puppeteer-extra-plugin-stealth": "^2.6.5",
"request": "^2.88.2",
"simple-proxy-agent": "^1.1.0",
"tough-cookie-file-store": "^2.0.2"
}
}
Calling packages in index.js:
const puppeteer = require('puppeteer-extra');
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
puppeteer.use(StealthPlugin());
const RecaptchaPlugin = require('puppeteer-extra-plugin-recaptcha');
puppeteer.use(
RecaptchaPlugin({
provider: {
id: '2captcha',
token: '<2captcha key>',
},
visualFeedback: true,
})
);
Search by code in the project where the entry exit(1) was encountered.
All functions in the code are wrapped in try/catch. Process termination exit(1) - calls the package from dependencies. Any ideas on how to fix the problem?
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (9 by maintainers)
Top Results From Across the Web
node.js - How to handle Puppeteer "Error: Page crashed!"
I close all pages once done, so there is only 1 page open at a time. And the droplet does only this process....
Read more >Let It Crash: Best Practices for Handling Node.js Errors on ...
If it's greater than that, it indicates that an error occurred; 1 is a common exit code for failures here. Another option is...
Read more >How to Exit a Process in Node.js: process.exit() Method
Learn how to terminate a Node.js application in the best possible way. We will explain how to do this with the process.exit() function...
Read more >The Death of a Node.js Process - Thomas Hunter II
Manual process exit, process.exit(1). Uncaught exception, throw new Error(). Unhandled promise rejection, Promise.reject(). Ignored error ...
Read more >Node.js process.exit() Method - GeeksforGeeks
Case 1: Without using process.exit() method: ... that automatically stops the NodeJS program when there is some problem with the code.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Now my script periodically saves its state in JSON. And after the fall, it restores its state from this file. Therefore, the problem is not so critical.
But so far I have not been able to accurately track the error.
According to statistics:
package.json
I’ll try to change the code from code.js
to this code code.js
Maybe I’ll get a little more data.
@ergcode great to hear 😃 Closing for now, I will keep this in mind when I do a planned rewrite of the recaptcha plugin.
PS: I added Github Sponsors links a few days ago 😃