Telethon icon indicating copy to clipboard operation
Telethon copied to clipboard

I have a lot Security error while unpacking a received message: Server replied with a wrong session ID

Open roaste opened this issue 2 years ago • 3 comments

Code that causes the issue from telethon import TelegramClient, functions, sync, errors

client = TelegramClient('bot', api_id, api_hash) client.start()

while True: channel_info = client(functions.channels.GetMessagesRequest(channel='',id= [])) time.sleep(600) Traceback Security error while unpacking a received message: Server replied with a wrong session ID

this varn appears every time a loop is passed, how i can fix it?

I found a pattern that for the first time there is no error, but for subsequent ones it appears p.s. i use the one bot account

roaste avatar Mar 05 '22 10:03 roaste

me too!

MakStashkevich avatar Mar 27 '22 12:03 MakStashkevich

Me too

nsabot avatar Apr 03 '22 13:04 nsabot

https://github.com/LonamiWebs/Telethon/issues/1476

Thoufak avatar Apr 26 '22 12:04 Thoufak

same

Th3Err0r avatar Sep 26 '22 12:09 Th3Err0r

Yeah i have the same problem -_-

AliAsgharRanjbar avatar Oct 17 '22 12:10 AliAsgharRanjbar

me too

xuxin19941214 avatar Nov 08 '22 11:11 xuxin19941214

me too!

ATOM27 avatar Nov 11 '22 21:11 ATOM27

Same problem

mayank-lalaiya avatar Dec 06 '22 13:12 mayank-lalaiya

me too!

artemki2077 avatar Jan 22 '23 12:01 artemki2077

me too

haruo75 avatar Jan 22 '23 15:01 haruo75

Hi guys! Try instead "sleep()" write like this "await asyncio.sleep()" It worked for me Good luck!

ZenyaDAR avatar Jan 24 '23 10:01 ZenyaDAR

I meet the same problem,u can try :

client = TelegramClient(myaccount, api_id, api_hash)
while True:
   client.connect()  
   channel_info = client(functions.channels.GetMessagesRequest(channel='',id= []))
   time.sleep(5)
   client.disconnect()  
   time.sleep(600)  ##your delay time

u may notice that once u sending a request to Telegram server u need connect the client and then disconnet it. Maybe,it just deceive yourself,but it works well, Hahah. also,'server sent a very old message with id...' can be resolved this way

LoJomes avatar Jul 12 '23 17:07 LoJomes