Telethon
Telethon copied to clipboard
telethon.errors.rpcerrorlist.AuthKeyUnregisteredError: The key is not registered in the system (caused by GetDialogsRequest)
Checklist
- [x] The error is in the library's code, and not in my own.
- [x] I have searched for this issue before posting it and there isn't a duplicate.
- [x] I ran
pip install -U https://github.com/LonamiWebs/Telethon/archive/master.zip
and triggered the bug in the latest version.
Good afternoon! Already contacted you personally, waiting for a solution to the problem with "telethon.errors.rpcerrorlist.AuthKeyUnregisteredError: The key is not registered in the system (caused by GetDialogsRequest) "
I have the same problem since 5 feb
I have the same problem. Moreover, if you do not enter the phone nouber, but restart the program, it work for a while, then it appears again. I use version 1.24.0/
same problem, spawning at random time
If anyone has any specific reasons why this may be happening, please telegraph me at @lovgraa. lonami has already passed the information on.
I have a similar problem since some days now. The error appears at random times, usually after the client is running for some longer time more and more often. My code looks like this (simplified):
client = TelegramClient(label, api_id, api_hash)
try:
await client.start()
except Exception as e:
logging.warning(f"client.start() >-> {e}\n{traceback.format_exc()}")
async for message in client.iter_messages(**kwargs):
...
Sometimes the exception is thrown when executing start()
, which is not a big problem, since i handle it:
client.start() >-> Connection not initialized (caused by GetUsersRequest)
Traceback (most recent call last):
File "/.../telegram.py", line X
await self.client.start(
File "/.../.local/lib/python3.9/site-packages/telethon/client/auth.py", line 146, in _start
me = await self.get_me()
File "/.../.local/lib/python3.9/site-packages/telethon/client/users.py", line 161, in get_me
me = (await self(
File "/.../.local/lib/python3.9/site-packages/telethon/client/users.py", line 30, in __call__
return await self._call(self._sender, request, ordered=ordered)
File "/.../.local/lib/python3.9/site-packages/telethon/client/users.py", line 84, in _call
result = await future
telethon.errors.rpcerrorlist.ConnectionNotInitedError: Connection not initialized (caused by GetUsersRequest)
But sometimes the exception is thrown after the connect at some random position in my telethon code:
File "/.../telegram.py", line X
async for message in client.iter_messages(**kwargs):
File "/.../.local/lib/python3.9/site-packages/telethon/requestiter.py", line 74, in __anext__
if await self._load_next_chunk():
File "/.../.local/lib/python3.9/site-packages/telethon/client/messages.py", line 184, in _load_next_chunk
F r = await self.client(self.request)
File "/.../.local/lib/python3.9/site-packages/telethon/client/users.py", line 30, in __call__
return await self._call(self._sender, request, ordered=ordered)
File "/.../.local/lib/python3.9/site-packages/telethon/client/users.py", line 84, in _call
result = await future
telethon.errors.rpcerrorlist.ConnectionNotInitedError: Connection not initialized (caused by GetHistoryRequest)
I started to handle the exception everywhere in my code now, but its annoying, because its appears more and more often after a longer execution time of my client.
p.s. The title of this issue is not matching the error in the screenshot?
I have a similar problem since some days now. The error appears at random times, usually after the client is running for some longer time more and more often. My code looks like this (simplified):
client = TelegramClient(label, api_id, api_hash) try: await client.start() except Exception as e: logging.warning(f"client.start() >-> {e}\n{traceback.format_exc()}") async for message in client.iter_messages(**kwargs): ...
Sometimes the exception is thrown when executing
start()
, which is not a big problem, since i handle it:client.start() >-> Connection not initialized (caused by GetUsersRequest) Traceback (most recent call last): File "/.../telegram.py", line X await self.client.start( File "/.../.local/lib/python3.9/site-packages/telethon/client/auth.py", line 146, in _start me = await self.get_me() File "/.../.local/lib/python3.9/site-packages/telethon/client/users.py", line 161, in get_me me = (await self( File "/.../.local/lib/python3.9/site-packages/telethon/client/users.py", line 30, in __call__ return await self._call(self._sender, request, ordered=ordered) File "/.../.local/lib/python3.9/site-packages/telethon/client/users.py", line 84, in _call result = await future telethon.errors.rpcerrorlist.ConnectionNotInitedError: Connection not initialized (caused by GetUsersRequest)
But sometimes the exception is thrown after the connect at some random position in my telethon code:
File "/.../telegram.py", line X async for message in client.iter_messages(**kwargs): File "/.../.local/lib/python3.9/site-packages/telethon/requestiter.py", line 74, in __anext__ if await self._load_next_chunk(): File "/.../.local/lib/python3.9/site-packages/telethon/client/messages.py", line 184, in _load_next_chunk F r = await self.client(self.request) File "/.../.local/lib/python3.9/site-packages/telethon/client/users.py", line 30, in __call__ return await self._call(self._sender, request, ordered=ordered) File "/.../.local/lib/python3.9/site-packages/telethon/client/users.py", line 84, in _call result = await future telethon.errors.rpcerrorlist.ConnectionNotInitedError: Connection not initialized (caused by GetHistoryRequest)
I started to handle the exception everywhere in my code now, but its annoying, because its appears more and more often after a longer execution time of my client.
p.s. The title of this issue is not matching the error in the screenshot?
The title is matching the error. There're 2 errors:
- telethon.errors.rpcerrorlist.AuthKeyUnregisteredError: The key is not registered in the system
- telethon.errors.rpcerrorlist.ConnectionNotInitedError: Connection not initialized
1st one appears more often in my case. Restarting the session usually helps, but sometimes the session cannot be started after this errors.
Update: It's been 2 hours since I got this error on 40 sessions. Somehow self-corrected, it is not clear, but the topic is still open, until the full clarification of the circumstances.
Up. I haven't received this error for a day, it's strange.
AuthKeyUnregisteredError
means the account is no longer logged-in, for whatever reason. This is not something the library can really fix, so I'm closing the issue. The user simply has to login.