Telegram TdLib Auto Logout After Login
I logged in to telegram via Telegram.td.dll. I didn't make any transaction/request after logging in. And telegram logged out/destroyed session on all my devices in less than 30 seconds. Does anyone know the problem and solution based on the log I got?
[ 3][t 5][1725784552.887528896][ConnectionCreator.cpp:958][#1][!PingActor<[149.154.175.50:80] to DcId{1} from [0.0.0.0:65093]>][&connections] Ready connection (checked) 0000019A02A02390 [rtt:284.4ms] [149.154.175.50:80] to DcId{1} from [0.0.0.0:65093]
[ 3][t 5][1725784552.887563228][ConnectionCreator.cpp:1011][#1][!ConnectionCreator][&connections] Add ready connection 0000019A02A02390 for [client:0xc50dc335]
[ 3][t 5][1725784552.887570381][ConnectionCreator.cpp:820][#1][!ConnectionCreator][&connections] In client_loop: [client:0xc50dc335]
[ 3][t 5][1725784552.887576341][ConnectionCreator.cpp:836][#1][!ConnectionCreator][&connections] Send to promise [connection:0000019A02A02390]
[ 3][t 5][1725784552.887584686][Session.cpp:1298][#1][!Session:1:main] Finished to open connection Session:1:main::Connect::TCP::[149.154.175.50:80] to DcId{1} from [0.0.0.0:65093]
[ 3][t 5][1725784552.887591361][SessionConnection.cpp:853][#1][!Session:1:main] Set need_destroy_auth_key to true
[ 4][t 5][1725784552.887596368][SessionConnection.cpp:782][#1][!Session:1:main] Set online to true
[ 4][t 5][1725784552.887615680][AuthData.cpp:122][#1][!Session:1:main] Create identifier for message 0x66dd61e6dc1176dc at 433192.027169
[ 4][t 5][1725784552.887627840][AuthData.cpp:122][#1][!Session:1:main] Create identifier for message 0x66dd61e6dc11954c at 433192.027181
[ 4][t 5][1725784552.887634992][AuthData.cpp:122][#1][!Session:1:main] Create identifier for message 0x66dd61e6dc193bb4 at 433192.027189
[ 4][t 5][1725784552.887641668][AuthData.cpp:122][#1][!Session:1:main] Create identifier for message 0x66dd61e6dc193c7c at 433192.027195
[ 4][t 5][1725784552.887696504][BufferedFd.h:215][#1][!Session:1:main] Flush write: +156B[left:0B]
[ 4][t 5][1725784552.887703895][SessionConnection.cpp:1141][#1][!Session:1:main] Last pong was in 0.000090/433192.027258, last read was in 0.000090/433192.027258, RTT = 2.000000, ping timeout = 5.000000, read timeout = 7.000000, flush packet in 1.999911, wakeup in 1.999911
[ 4][t 5][1725784552.906661510][BufferedFd.h:206][#1][!PingActor<[149.154.175.50:443] to DcId{1} from [0.0.0.0:65092]>] Flush read: +184B[total:184B]
[ 4][t 5][1725784552.906736850][BufferedFd.h:140][#1][!PingActor<[149.154.175.50:443] to DcId{1} from [0.0.0.0:65092]>] Nothing to write to [fd:000000000000074C]
[ 3][t 5][1725784552.906759977][ConnectionCreator.cpp:958][#1][!PingActor<[149.154.175.50:443] to DcId{1} from [0.0.0.0:65092]>][&connections] Ready connection (checked) 0000019A02A02050 [rtt:288.7ms] [149.154.175.50:443] to DcId{1} from [0.0.0.0:65092]
[ 3][t 5][1725784552.906905174][ConnectionCreator.cpp:1011][#1][!ConnectionCreator][&connections] Add ready connection 0000019A02A02050 for [client:0xc50dc335]
[ 3][t 5][1725784552.906922101][ConnectionCreator.cpp:820][#1][!ConnectionCreator][&connections] In client_loop: [client:0xc50dc335]
[ 3][t 5][1725784552.906929016][ConnectionCreator.cpp:996][#1][!ConnectionCreator][&connections] [client:0xc50dc335] set timeout in 9.999998
[ 4][t 5][1725784553.040274858][BufferedFd.h:206][#1][!PingActor<[149.154.175.50:5222] to DcId{1} from [0.0.0.0:65094]>] Flush read: +116B[total:116B]
[ 3][t 5][1725784553.040396213][RawConnection.cpp:95][#1][!PingActor<[149.154.175.50:5222] to DcId{1} from [0.0.0.0:65094]>] Send handshake packet:
00000000 00000000 00000001 00000000 00000020 be7e8ef1 08d3df6e 93a967bb ca36545f 4f2c9783 2dc10e76 e5fabebd b4087389
[ 4][t 5][1725784553.040448665][BufferedFd.h:215][#1][!PingActor<[149.154.175.50:5222] to DcId{1} from [0.0.0.0:65094]>] Flush write: +56B[left:0B]
[ 4][t 5][1725784553.040464401][BufferedFd.h:140][#1][!PingActor<[149.154.175.50:5222] to DcId{1} from [0.0.0.0:65094]>] Nothing to write to [fd:0000000000000708]
[ 4][t 5][1725784553.169119358][BufferedFd.h:206][#1][!Session:1:main] Flush read: +8B[total:8B]
[ 4][t 5][1725784553.169243574][RawConnection.cpp:124][#1][!Session:1:main] Close raw connection 0000019A02A02390
[ 2][t 5][1725784553.169302225][Session.cpp:643][#1][!Session:1:main] Session connection was closed, because main auth_key has been successfully destroyed
[ 2][t 5][1725784553.169392585][AuthDataShared.cpp:118][#1][!Session:1:main] DcId{1} [auth_key_id:0][state:Empty][created_at:0][last_used:1725901401]
[ 3][t 5][1725784553.169437408][SessionProxy.cpp:192][#1][!SessionProxy:1:main] Close session from update_auth_key_state
[ 4][t 5][1725784553.169460535][RawConnection.cpp:36][#1][!Session:1:main] Destroy raw connection 0000019A02A02390
[ 4][t 5][1725784553.169472694][SessionConnection.cpp:1127][#1][!Session:1:main] Close session because of an error
[ 2][t 5][1725784553.169489145][Td.cpp:3312][#1][!Td] Destroy Td in state 1
[ 3][t 1][1725784553.169491767][SessionProxy.cpp:192][#1][!SessionProxy:1:upload#0] Close session from update_auth_key_state
[ 4][t 5][1725784553.169512033][Session.cpp:351][#1][!Session:5:main] Set logging out flag to true
[ 3][t 1][1725784553.169577598][SessionProxy.cpp:192][#1][!SessionProxy:1:upload#1] Close session from update_auth_key_state
[ 3][t 1][1725784553.169656515][SessionProxy.cpp:192][#1][!SessionProxy:1:upload#2] Close session from update_auth_key_state
[ 3][t 5][1725784553.169658184][TdDb.cpp:260][#1][!Td] Flush all databases
[ 3][t 1][1725784553.169668197][SessionProxy.cpp:192][#1][!SessionProxy:1:upload#3] Close session from update_auth_key_state
[ 3][t 1][1725784553.169740438][SessionProxy.cpp:192][#1][!SessionProxy:1:upload#4] Close session from update_auth_key_state
[ 3][t 1][1725784553.169751405][SessionProxy.cpp:192][#1][!SessionProxy:1:upload#5] Close session from update_auth_key_state
[ 3][t 1][1725784553.169763088][SessionProxy.cpp:192][#1][!SessionProxy:1:upload#6] Close session from update_auth_key_state
[ 3][t 5][1725784553.169770002][Session.cpp:506][#1][!Session:1:main] Close session (external)
[ 4][t 5][1725784553.169830560][Td.cpp:3158][#1][!Td] Decrease request actor count to 0
[ 3][t 5][1725784553.169849157][Td.cpp:3187][#1][!Td] Clear Td
[ 3][t 5][1725784553.169865369][NotificationManager.cpp:1391][#1][!Td][¬ifications] Flush all pending notification updates with delayed chats from destroy_all_notifications
[ 3][t 1][1725784553.169774532][SessionProxy.cpp:192][#1][!SessionProxy:1:upload#7] Close session from update_auth_key_state
[ 3][t 5][1725784553.169944286][NotificationManager.cpp:1407][#1][!Td][¬ifications] Flush pending updates in 0 notification groups
[ 3][t 2][1725784553.169879674][MessageDb.cpp:1180][#1][!MessageDbActor] MessageDb flushed
[ 3][t 1][1725784553.170035362][SessionProxy.cpp:192][#1][!SessionProxy:1:download#0] Close session from update_auth_key_state
[ 3][t 5][1725784553.170039892][NotificationManager.cpp:4302][#1][!Td][¬ifications] Update unreceived notification count with diff -1 to 0 from group 0 and destroy_all_notifications
[ 3][t 1][1725784553.170188426][SessionProxy.cpp:192][#1][!SessionProxy:1:download#1] Close session from update_auth_key_state
[ 3][t 5][1725784553.170218706][NotificationManager.cpp:4279][#1][!Td][¬ifications] Send updateHavePendingNotifications { have_delayed_notifications = false have_unreceived_notifications = false }
[ 3][t 1][1725784553.170227289][SessionProxy.cpp:192][#1][!SessionProxy:1:download_small#0] Close session from update_auth_key_state
[ 3][t 2][1725784553.170170783][DialogDb.cpp:429][#1][!DialogDbActor] DialogDb flushed
[ 4][t 5][1725784553.170249223][Td.cpp:3201][#1][!Td] Handlers were cleared in 387.4us
[ 3][t 1][1725784553.170257329][SessionProxy.cpp:192][#1][!SessionProxy:1:download_small#1] Close session from update_auth_key_state
[ 3][t 2][1725784553.170301437][StoryDb.cpp:512][#1][!StoryDbActor] StoryDb flushed
[ 4][t 5][1725784553.170357704][Session.cpp:532][#1][!Session:5:main] HANGUP
[ 3][t 5][1725784553.170373678][Session.cpp:506][#1][!Session:5:main] Close session (external)
The server decided that your account was stolen. There is no way to avoid this from the app side.
I use a Telegram account on my mobile phone. If I use TdLib, is it that I can't use it on my mobile phone or Telegram Web? I checked that the devices connected to Telegram are only from my mobile phone and the TdLib application or Web, there are no other devices besides the one I use.
If I use the development environment telegram server this problem does not occur.
recently i have got automatically logged out from one of my account from all sessions ( desktop, mobile app ) unfortunately i dont have access to phone number i lost my account forever. Telegram team is helpless on such issues.
@FlexAmigo You can use Telegram on multiple devices simultaneously. There are no restirctions.
recently i have got automatically logged out from one of my account from all sessions ( desktop, mobile app ) unfortunately i dont have access to phone number i lost my account forever. Telegram team is helpless on such issues.
Try logging back in 24 hours after being banned. Previously I also felt that my account was banned because of testing TdLib in a production environment where my application was not ready. The next day I tried to log in and it worked.
@FlexAmigo You can use Telegram on multiple devices simultaneously. There are no restirctions.
@levlam So the session disconnection on all devices that I experienced before means it is not because my account was used / hacked by someone. But maybe there is something lacking in the application. And I think the TdLib (Debug) log does not provide clear information why my application can automatically log out on all devices. While in the development environment it runs smoothly and there are no obstacles. Are there any other ideas / solutions to find out the cause of my account being automatically logged out after the TdLib I use is online and experiences obstacles?
There is no way to find the cause of the account being logged out.
@levlam What is the difference between development environment and production environment? Why does the application run well in the development environment while in the production environment it always logs out? I have not found a solution to this problem. What I am worried about is that the problem is not in my application, but in the TdLIb compilation results where I cannot debug. I am using C# Net Core version 8 (Windows Form) and C# Net Framework 4.8.1. I have tried using TdLIb version 1.8.33 and 1.8.36 and found the same issue.
Server logs out or bans account if a suspicious behavior was detected. There is no way to avoid this.
@levlam What is the difference between development environment and production environment? Why does the application run well in the development environment while in the production environment it always logs out? I have not found a solution to this problem. What I am worried about is that the problem is not in my application, but in the TdLIb compilation results where I cannot debug. I am using C# Net Core version 8 (Windows Form) and C# Net Framework 4.8.1. I have tried using TdLIb version 1.8.33 and 1.8.36 and found the same issue.
@FlexAmigo have you found any solution to this problem? Did changing any specific configuration or implementation details help resolve the issue?
I've noticed this only happens in the production environment, which aligns with your experience. Would be great to know if you've discovered any workarounds or if there's any specific setting that needs to be adjusted when moving from development to production.