facebook-chat-api
facebook-chat-api copied to clipboard
ESOCKETTIMEDOUT in listen.js
I've checked #665 and there wasn't any solution to this error. Basically, every few hours I get this error and the only way to make it work again is to restart the whole bot. Stacktrace:
ERR! listen Error: ESOCKETTIMEDOUT
ERR! listen at ClientRequest.<anonymous> (/usr/local/lib/node_modules/miscord/node_modules/request/request.js:812:19)
ERR! listen at Object.onceWrapper (events.js:273:13)
ERR! listen at ClientRequest.emit (events.js:182:13)
ERR! listen at TLSSocket.emitTimeout (_http_client.js:706:34)
ERR! listen at Object.onceWrapper (events.js:273:13)
ERR! listen at TLSSocket.emit (events.js:182:13)
ERR! listen at TLSSocket.Socket._onTimeout (net.js:444:8)
ERR! listen at ontimeout (timers.js:427:11)
ERR! listen at tryOnTimeout (timers.js:289:5)
ERR! listen at listOnTimeout (timers.js:252:5)
ERR! listen at Timer.processTimers (timers.js:212:10)
Yes, I do have a stable internet connection. It's hosted on DigitalOcean and I never had any issues with connection on their servers.
Maybe this is relevant: https://stackoverflow.com/a/37946399
Sounds like you have a reliable repro, can you play with increasing the UV_THREADPOOL_SIZE
?
Or possibly the other answer, adding agent: false, pool: {maxSockets: 100}
to the settings of request here : https://github.com/Schmavery/facebook-chat-api/blob/7470cfe9b29d30f082f76cacc08748e4e19e8c15/utils.js#L4
I'll try to add it, I have currently 12 bots running so I hope I'll get some results soon
Update: the env variable didn't help. I'll try the maxSockets option.
EDIT: it also didn't work. still getting ESOCKETTIMEDOUT
Thanks for testing that. o.O 12 bots? I'm assuming they're on different accounts? Otherwise I wouldn't be surprised if there was some sort of rate limiting happening.
Honestly I don't really know much about what's happening here and all I'm doing is looking at stackoverflow... https://stackoverflow.com/a/43857814 This one seems to try to set keepAlive: true
somehow. Could be worth a shot if you can figure it out.
Unfortunately the only other guess I would have is to somehow catch it and optionally try to retry the call (or ignore).
12 bots, each on a different account and split in half to 2 separate servers. I'll try that approach, maybe this time it will work.
any update? I receive this error too
I've had the same problem few days ago... over 30% of requests were failing but the same script was working fine (with no changes) after 12 hours :/ I'm wondering is this is a facebook's issue ...
@ravkr Today it probably is a Facebook issue, I'm getting timeouts on servers that never had them...
I also have same issue, affter 5h active account now, how to resolved it?? thanks
How's this going? I am experiencing same thing as well
How's this going? I am experiencing same thing as well
But it still active, I try on function api.listen(). It still run ok.