Skip to content
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

Fatal error handling updates (this is a bug in Telethon, please report it) #4017

Closed
simbadmorehod opened this issue Jan 7, 2023 · 7 comments

Comments

@simbadmorehod
Copy link


ERROR:telethon.client.updates:Fatal error handling updates (this is a bug in Telethon, please report it)
 Traceback (most recent call last):
   File "/home/donald/donald_project/donald/venv/lib/python3.8/site-packages/telethon/client/updates.py", line 282, in _update_loop
     diff = await self(get_diff)
   File "/home/donald/donald_project/donald/venv/lib/python3.8/site-packages/telethon/client/users.py", line 30, in __call__
     return await self._call(self._sender, request, ordered=ordered)
  File "/home/donald/donald_project/donald/venv/lib/python3.8/site-packages/telethon/client/users.py", line 84, in _call
     result = await future
telethon.errors.rpcerrorlist.DateEmptyError: Date empty (caused by GetDifferenceRequest)
@Lonami
Copy link
Member

Lonami commented Jan 7, 2023

Please follow the issue template. It makes it easier for me to make sure everything is in order.

Please install master with:

pip3 install -U https://github.com/LonamiWebs/Telethon/archive/v1.zip

and configure logging with something like this:

import logging
logging.basicConfig(format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s', level=logging.WARNING)
logging.getLogger('telethon.messagebox').setLevel(logging.NOTSET + 1)

(You can configure it to your liking, but the messagebox level must be as low as possible. If you have multiple TelegramClient, please set a different base_logger='name' for each in their constructor).

This will print all updates being processed along with the current state of the MessageBox (which deals with the updates).

This log will contain sensitive information, so only share it with people you trust (or redact it before sharing it). You can send it to me privately so that I and nobody else can analyze it (please link to this issue, so I know you're not spam).

With it I'll be able to reproduce the issue reliably locally, pinpoint the problem, and fix it.

@simbadmorehod
Copy link
Author

simbadmorehod commented Jan 8, 2023

The task will not be easy, but I will try to do everything you ask.

@simbadmorehod
Copy link
Author

I can install in the main bot startup file:

import logging
logging.basicConfig(format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s', level=logging.WARNING)
logging.getLogger('telethon.messagebox').setLevel(logging.NOTSET + 1)

Then I have a piece of code where I run several different clients TelegramClient apparently there I should set base_logger='name' argument when creating a client?

@Lonami
Copy link
Member

Lonami commented Jan 8, 2023

Yes. If you use multiple TelegramClient instances, each one of them needs their own base_logger name. Otherwise, the logs will be interleaved and I won't be able to correctly reproduce the issue.

@simbadmorehod
Copy link
Author

Okay, I will create a name as the id of the user that uses this client.

@Lonami
Copy link
Member

Lonami commented Apr 6, 2023

Closing as a duplicate of #3974. Please continue discussion there if needed.

@Lonami Lonami closed this as completed Apr 6, 2023
@omkarsing6458
Copy link

omkarsing6458 commented Oct 3, 2023

telethon.client.updates: Fatal error handling updates (this is a bug in Telethon v1.28.5, please report it)

Please help me 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants