-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ERROR:telethon.network.connection.connection:Unexpected exception in the receive loop #4092
Comments
You need to provide the necessary code, preferably under 100 lines long, and steps needed to reproduce the issue. |
i have same error client = TelegramClient(........)
await client.connect()
print(await client.get_me())
####################################################
ERROR:telethon.network.connection.connection:Unexpected exception in the receive loop
Traceback (most recent call last):
File "D:\Python379\lib\site-packages\telethon\network\connection\connection.py", line 332, in _recv_loop
data = await self._recv()
File "D:\Python379\lib\site-packages\telethon\network\connection\connection.py", line 369, in _recv
return await self._codec.read_packet(self._reader)
File "D:\Python379\lib\site-packages\telethon\network\connection\tcpfull.py", line 25, in read_packet
packet_len_seq = await reader.readexactly(8) # 4 and 4
File "D:\Python379\lib\asyncio\streams.py", line 679, in readexactly
await self._wait_for_data('readexactly')
File "D:\Python379\lib\asyncio\streams.py", line 473, in _wait_for_data
await self._waiter
concurrent.futures._base.CancelledError
ERROR:telethon.network.mtprotosender:Unhandled error while receiving data
Traceback (most recent call last):
File "D:\Python379\lib\site-packages\telethon\network\mtprotosender.py", line 505, in _recv_loop
body = await self._connection.recv()
File "D:\Python379\lib\site-packages\telethon\network\connection\connection.py", line 299, in recv
result, err = await self._recv_queue.get()
File "D:\Python379\lib\asyncio\queues.py", line 159, in get
await getter
concurrent.futures._base.CancelledError
INFO:telethon.network.mtprotosender:Closing current connection to begin reconnect...
ERROR:telethon.network.connection.connection:Unexpected exception in the receive loop
Traceback (most recent call last):
File "D:\Python379\lib\site-packages\telethon\network\connection\connection.py", line 332, in _recv_loop
data = await self._recv()
File "D:\Python379\lib\site-packages\telethon\network\connection\connection.py", line 369, in _recv
return await self._codec.read_packet(self._reader)
File "D:\Python379\lib\site-packages\telethon\network\connection\tcpfull.py", line 25, in read_packet
packet_len_seq = await reader.readexactly(8) # 4 and 4
File "D:\Python379\lib\asyncio\streams.py", line 679, in readexactly
await self._wait_for_data('readexactly')
File "D:\Python379\lib\asyncio\streams.py", line 473, in _wait_for_data
await self._waiter
concurrent.futures._base.CancelledError``` |
hi @Lonami While looking at the error Traceback, i couldn't find any error in the code. The errors are from the library!
|
I also meet this question, and i try several version of telethon all get the same question, it must bu the platform API had changed something. |
Hi @Lonami any updates on this issue🙂 |
meet the same question too(Windows 10 1809 withi Python 3.10.1 amd64,telethon==1.28.5),when I try to reinstall the telethon version below telethon==1.28.0(like 1.27.0,1.24.0 etc.), no error produced. |
As I've said before I've been unable to reproduce the issue myself so it's hard for me to reliably trigger it and try to diagnose it. Someone that experiences the issue and looks into it would be of great help. If older versions truly "work" and newer ones don't, it would be truly great to |
How can I help? |
my program get this error on higher version because of my server's unstable proxy connection(like unstable VPN etc). Its a pitty that I cannot provide any support to you, Sry😢 |
You can message me privately, with a link to this issue so I know you are not spam. Then depending on the setup perhaps I can generate and give you one SSH key so I can login and try to diagnose the problem. Not sure when I'll get to it though. But I'll keep this open so I remember. |
same problem
try fix:
|
I have same problem. I use proxy to connect to telegram. Sometimes, while downloading large files, following log appeared continuously and I must reset my program manually to get rid of that.
to fix it, should change current code:
should be:
|
I believe the idea behind that is that, after enough failures, the library would give up. But, maybe it's fine to always raise on unknown errors. Feel free to send a PR @JavadZahedi. |
Install python-socks helps me with
|
Checklist
pip install -U https://github.com/LonamiWebs/Telethon/archive/v1.zip
and triggered the bug in the latest version.Traceback
The text was updated successfully, but these errors were encountered: