timeout and authKeyUnregisteredError
See original GitHub issueHi, sometimes, during big downloads I get this exception:
File "/usr/local/lib/python3.5/dist-packages/telethon/extensions/tcp_client.py", line 94, in read
partial = self._socket.recv(bytes_left)
BlockingIOError: [Errno 11] Resource temporarily unavailable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/elenoon/telegram-chanel-copier/channel_copier.py", line 112, in main
client.download_msg_media(msg.media, 'media/{}_{}'.format(entity.id, msg.id))
File "/usr/local/lib/python3.5/dist-packages/telethon/telegram_client.py", line 594, in download_msg_media
add_extension, progress_callback)
File "/usr/local/lib/python3.5/dist-packages/telethon/telegram_client.py", line 672, in download_document
progress_callback=progress_callback
File "/usr/local/lib/python3.5/dist-packages/telethon/telegram_client.py", line 724, in download_file
progress_callback=progress_callback
File "/usr/local/lib/python3.5/dist-packages/telethon/telegram_bare_client.py", line 313, in download_file
GetFileRequest(input_location, offset, part_size))
File "/usr/local/lib/python3.5/dist-packages/telethon/telegram_client.py", line 247, in invoke
request, timeout=timeout, updates=updates)
File "/usr/local/lib/python3.5/dist-packages/telethon/telegram_bare_client.py", line 189, in invoke
self.sender.receive(request, timeout, updates=updates)
File "/usr/local/lib/python3.5/dist-packages/telethon/network/mtproto_sender.py", line 100, in receive
seq, body = self._transport.receive(timeout)
File "/usr/local/lib/python3.5/dist-packages/telethon/network/tcp_transport.py", line 45, in receive
packet_length_bytes = self.tcp_client.read(4, timeout)
File "/usr/local/lib/python3.5/dist-packages/telethon/extensions/tcp_client.py", line 111, in read
'The read operation exceeded the timeout.') from error
TimeoutError: The read operation exceeded the timeout.
And after that, if I try to invoke anything it will give me “you must be connected” error, and if I try to disconnect and connect it needs to re sign in.
any idea?
thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (11 by maintainers)
Top Results From Across the Web
Failed to get current state: AuthKeyUnregisteredError('The key ...
Recently I tried running the script again and it now keeps asking me for my phone number and authentication code despite the fact...
Read more >Failed to get current state: AuthKeyUnregistere...anycodings
Failed to get current state: AuthKeyUnregisteredError('The key is not registered in the system') I am using Telethon ...
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
See https://github.com/LonamiWebs/Telethon/commit/2af962230f3642f2821dba9a8b0b2805246d7ac9. Guess I better push that new version to pip.
Edit: Done. Please upgrade and try again.
No idea, official clients may use a separate connection, or several to get different parts at the same time, or maybe request larger chunk sizes…