-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Stops recieving messages after 10-20 hours #4521
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
Comments
I use telethon for 24/7 monitoring of specific telegram channels, have not encountered any problems yet. Here is my code:
|
We’ve been experiencing the same issue: This occurred for the first time recently. The client was running continuously for 2 days without issues, and then it started throwing this error. Restarting the service temporarily resolves the problem. Our setup had been running stably for months, and there were no significant code or environmental changes before this started happening. |
|
I had this problem with real accounts too, they stop receiving updates. This doesn't happen with bots, I think Telegram doesn't allow normal users to be online 24/7. My solution was to call _disconnect() every 24 hours, wait 30 seconds and reconnect at a convenient time. Attention! Call _disconnect and not disconnect, because disconnect() ends up disconnecting the database too, unless you want to recreate the Client Object again. |
Code that causes the issue
Expected behavior
The program would run until disconnected or user interrupted
Actual behavior
after 10-20h the program stop logging messages. I then have to manually interrupt the program and restart the script.
Traceback
The last log is usually this:
2024-12-21 11:31:39,980 - WARNING - Server sent a very old message with ID xxxxxxxxxxxxxxxx, ignoring (see FAQ for details)
2024-12-21 11:31:39,980 - WARNING - Security error while unpacking a received message: Too many messages had to be ignored consecutively
Telethon version
1.38.1
Python version
3.11.9
Operating system (including distribution name and version)
Windows 10
Other details
No response
Checklist
pip install -U https://github.com/LonamiWebs/Telethon/archive/v1.zip
and triggered the bug in the latest version.The text was updated successfully, but these errors were encountered: