Error: Cannot send requests while disconnected. You need to call .connect()
See original GitHub issueMy app work fine, but sometimes it fall down with error:
Error: Cannot send requests while disconnected. You need to call .connect(), which begin run in endless cycle
then script die with another error:
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
so my question is:
what is the bug with this:
Error: Cannot send requests while disconnected. You need to call .connect()
?
Why this sometimes run in endless cycle and never end? This definitely need to be fixed.
This bug was in version 2.5.* and now in 2.6.13 it has too.
Full error look like this:
Error: Cannot send requests while disconnected. You need to call .connect()
at MTProtoSender.send (/code/node_modules/telegram/network/MTProtoSender.js:197:19)
at Object.invoke (/code/node_modules/telegram/client/users.js:31:36)
at async TelegramClient.getDC (/code/node_modules/telegram/client/TelegramClient.js:1120:28)
at async TelegramClient._connectSender (/code/node_modules/telegram/client/telegramBaseClient.js:200:20)
at async TelegramClient._borrowExportedSender (/code/node_modules/telegram/client/telegramBaseClient.js:243:22)
p.s.: right before this error it show this:
Error: Disconnect
at /code/node_modules/telegram/extensions/MessagePacker.js:106:33
at Array.forEach (<anonymous>)
at MessagePacker.rejectAll (/code/node_modules/telegram/extensions/MessagePacker.js:105:29)
at MTProtoSender._disconnect (/code/node_modules/telegram/network/MTProtoSender.js:247:25)
at MTProtoSender.disconnect (/code/node_modules/telegram/network/MTProtoSender.js:168:20)
at MTProtoSender._reconnect (/code/node_modules/telegram/network/MTProtoSender.js:728:24)
at /code/node_modules/telegram/network/MTProtoSender.js:721:22
Thanks.
Issue Analytics
- State:
- Created a year ago
- Comments:30 (8 by maintainers)
Top Results From Across the Web
"Cannot send requests while disconnected" error when ...
I try to write code to download all messages and media from specific channel. Getting messages without downloading media works fine.
Read more >flask - Connection error while connection has already been ...
') The following error occurs despite the fact that I have already established a connection: ConnectionError: Cannot send requests while ...
Read more >"Cannot send requests while disconnected" error when ...
I try to write code to download all messages and media from specific channel. Getting messages without downloading media works fine.
Read more >Client API
An "error" event is emitted if verification fails. Verification happens at the connection level, before the HTTP request is sent.
Read more >Why do I get a connection error when installing or ...
I get an error that I cannot connect to MathWorks when running the MathWorks installer or the activation client; however, I can access...
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 Free
Top 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
this may happen during client.connect(), but not during authentication process. So this is another situation here.
FLOOD_WAIT issue is just a case when “Error: Cannot send requests while disconnected” and crash happens