danog / MadelineProto

Async PHP client API for the telegram MTProto protocol
https://docs.madelineproto.xyz
GNU Affero General Public License v3.0
2.83k stars 654 forks source link

Number was ban after simple authorization process #1422

Closed JasonMam closed 11 months ago

JasonMam commented 12 months ago

Hello everybody. Today I decided to test the MadelineProto library. I have the latest version 8.0.0-beta153. Simple authorization process, which is in the documentation "sending code + code submit", my number was banned after several minutes. Also additionally write to recover@telegram.org. I used the following code for authorization. There was no other use of the API.

Send code

$settings = new Settings;
$appInfo = (new danog\MadelineProto\Settings\AppInfo())
     ->setApiId(app_ip)
     ->setApiHash(app_hash)
     ->setDeviceModel(device_model)
     ->setAppVersion(app_version)
     ->setSystemVersion(system_version);
$settings->setAppInfo($appInfo);
$proxy = [
     'address'  => 'my_proxy_ip',
     'port'     =>  my_proxy_port,
     'username' => 'my_proxy_user',
     'password' => 'my_proxy_pass'
];
$connection->addProxy(SocksProxy::class, $proxy ,); 
$settings->setConnection($connection);
$MadelineProto = new danog\MadelineProto\API('my_session', $settings);
$MadelineProto->phoneLogin('my_phone');

Submit code

$MadelineProto = new danog\MadelineProto\API('my_session');
$login = $MadelineProto->completePhoneLogin('phone_code');

MadelineProto.log

Logger: MadelineProto 8.0.0-beta153 Logger: Copyright (C) 2016-2023 Daniil Gentili Logger: Licensed under AGPLv3 Logger: https://github.com/danog/MadelineProto MTProto: The database settings have changed! TL: Loading TL schemes... TL: Parsing TL_telegram_v165.tl... TL: Parsing TL_mtproto_v1.tl... TL: Parsing TL_secret.tl... MTProto: The serialization settings have changed! TL: Loading TL schemes... TL: Parsing TL_telegram_v165.tl... TL: Parsing TL_mtproto_v1.tl... TL: Parsing TL_secret.tl... DataCenter: Acquiring connect lock for 2! DataCenter: Connecting to DC 2 DataCenterConnection: Restoring 0 messages to DC 2 Session: Resetting session in DC 2.0... Connection: Connecting to DC 2.0 via tcp://149.154.167.51:443 main DC 2, via ipv4 using AbridgedStream => SocksProxy ({"address":"my_proxy_adress","port":"my_proxy_port","username":"my_proxy_user","password":"my_proxy_pass"}) => BufferedRawStream => DefaultStream SocksProxy: [ "Connected to 10.2.0.2:53587 via socks5" ] Connection: Connected to DC 2.0 via tcp://149.154.167.51:443 main DC 2, via ipv4 using AbridgedStream => SocksProxy ({"address":"my_proxy_adress","port":"my_proxy_port","username":"my_proxy_user","password":"my_proxy_pass"}) => BufferedRawStream => DefaultStream! DataCenterConnection: Acquiring lock in order to init auth for DC 2 DataCenterConnection: Initing auth for DC 2 DataCenterConnection: Generating permanent authorization key for DC 2... AuthKeyHandler: Requesting pq... Session: Garbage collected 0 outgoing messages in DC 2, 1 left ResponseHandler: Trying to assign a response of type ResPQ to its request... ResponseHandler: Does the request of return type ResPQ match? ResponseHandler: Yes AuthKeyHandler: Factorizing with native_single_cpp (please wait, might take a while) AuthKeyHandler: Factorizing with python_single_alt (please wait, might take a while) AuthKeyHandler: Install https://prime.madelineproto.xyz and the FFI extension to speed this up! AuthKeyHandler: Factorizing with python_single (please wait, might take a while) AuthKeyHandler: Install https://prime.madelineproto.xyz and the FFI extension to speed this up! AuthKeyHandler: Factorizing with native_single (please wait, might take a while) AuthKeyHandler: Install https://prime.madelineproto.xyz and the FFI extension to speed this up! AuthKeyHandler: Factorization 1820353566559006639 = 1018940467 1786516117 AuthKeyHandler: Starting Diffie Hellman key exchange GarbageCollector: gc_collect_cycles done. Cleaned memory: 0 Mb ResponseHandler: Trying to assign a response of type Server_DH_Params to its request... ResponseHandler: Does the request of return type Server_DH_Params match? ResponseHandler: Yes AuthKeyHandler: Server-client time delta = 0.0 s Crypt: Executing p/g checks (1/2)... Crypt: Executing p/g checks (2/2)... Crypt: Executing g check... Crypt: Executing g_a check (1/2)... Crypt: Executing g_a check (2/2)... AuthKeyHandler: Generating b... AuthKeyHandler: Generating g_b... Crypt: Executing g_a check (1/2)... Crypt: Executing g_a check (2/2)... AuthKeyHandler: Executing g_b check... AuthKeyHandler: Preparing client_DH_inner_data... AuthKeyHandler: Executing set_client_DH_params... ResponseHandler: Trying to assign a response of type Set_client_DH_params_answer to its request... ResponseHandler: Does the request of return type Set_client_DH_params_answer match? ResponseHandler: Yes AuthKeyHandler: Generating authorization key (install gmp to speed up this process)... AuthKeyHandler: Diffie Hellman key exchange processed successfully! AuthKeyHandler: Auth key generated DataCenterConnection: Generating temporary authorization key for DC 2... AuthKeyHandler: Requesting pq... ResponseHandler: Trying to assign a response of type ResPQ to its request... ResponseHandler: Does the request of return type ResPQ match? ResponseHandler: Yes AuthKeyHandler: Factorizing with native_single_cpp (please wait, might take a while) AuthKeyHandler: Factorizing with python_single_alt (please wait, might take a while) AuthKeyHandler: Install https://prime.madelineproto.xyz and the FFI extension to speed this up! AuthKeyHandler: Factorizing with python_single (please wait, might take a while) AuthKeyHandler: Install https://prime.madelineproto.xyz and the FFI extension to speed this up! AuthKeyHandler: Factorizing with native_single (please wait, might take a while) AuthKeyHandler: Install https://prime.madelineproto.xyz and the FFI extension to speed this up! AuthKeyHandler: Factorization 2419992273246736807 = 1261878287 1917769961 AuthKeyHandler: Starting Diffie Hellman key exchange ResponseHandler: Trying to assign a response of type Server_DH_Params to its request... ResponseHandler: Does the request of return type Server_DH_Params match? ResponseHandler: Yes AuthKeyHandler: Server-client time delta = 0.0 s Crypt: Executing p/g checks (1/2)... Crypt: Executing p/g checks (2/2)... Crypt: Executing g check... Crypt: Executing g_a check (1/2)... Crypt: Executing g_a check (2/2)... AuthKeyHandler: Generating b... AuthKeyHandler: Generating g_b... Crypt: Executing g_a check (1/2)... Crypt: Executing g_a check (2/2)... AuthKeyHandler: Executing g_b check... AuthKeyHandler: Preparing client_DH_inner_data... AuthKeyHandler: Executing set_client_DH_params... ResponseHandler: Trying to assign a response of type Set_client_DH_params_answer to its request... ResponseHandler: Does the request of return type Set_client_DH_paramsanswer match? ResponseHandler: Yes AuthKeyHandler: Generating authorization key (install gmp to speed up this process)... AuthKeyHandler: Diffie Hellman key exchange processed successfully! AuthKeyHandler: Auth key generated DataCenterConnection: Binding authorization keys... WriteLoop: Skipping help.getConfig pending due to unbound keys in DC 2.0 WriteLoop: Skipping help.getConfig pending due to unbound keys in DC 2.0 WriteLoop: Skipping help.getConfig pending due to unbound keys in DC 2.0 WriteLoop: Skipping help.getConfig pending due to unbound keys in DC 2.0 DataCenterConnection: Bound temporary and permanent authorization keys, DC 2 WriteLoop: Writing client info (also executing help.getConfig)... WriteLoop: Writing client info (also executing help.getConfig)... WriteLoop: Writing client info (also executing help.getConfig)... DataCenterConnection: Flushing pending messages, DC 2 DataCenterConnection: Done initing auth for DC 2 PingLoop: Ping DC 2.0 MTProto: Updated config! MTProto: Updated config! MTProto: Starting update system APIWrapper: Prompting initial serialization... SessionPaths: Waiting for exclusive lock of session.____/safe.php.lock... SessionPaths: Got exclusive lock of session./safe.php.lock... SessionPaths: Waiting for exclusive lock of session./lightState.php.lock... SessionPaths: Got exclusive lock of session./lightState.php.lock... APIWrapper: Saved session! APIWrapper: Done initial serialization! APIWrapper: MadelineProto is ready! Login: Sending code... Login: Code sent successfully! Once you receive the code you should use the completePhoneLogin function. MTProto: Prompting final serialization (SHUTDOWN)... SessionPaths: Waiting for exclusive lock of session./safe.php.lock... SessionPaths: Got exclusive lock of session./safe.php.lock... SessionPaths: Waiting for exclusive lock of session./lightState.php.lock... SessionPaths: Got exclusive lock of session./lightState.php.lock... APIWrapper: Saved session! MTProto: Done final serialization (SHUTDOWN)! MTProto: Shutting down MadelineProto (MTProto) MTProto: Will unreference instance DataCenterConnection: Disconnecting from shared DC 2 Connection: Disconnecting from DC 2.0 DataCenterConnection: Backed up from DC 2.0 Connection: Disconnected from DC 2.0 DataCenterConnection: Backed up 0, added to 0 existing messages) from DC 2 MTProto: Unreferenced instance MTProto: Successfully destroyed MadelineProto Logger: MadelineProto 8.0.0-beta153 Logger: Copyright (C) 2016-2023 Daniil Gentili Logger: Licensed under AGPLv3 Logger: https://github.com/danog/MadelineProto Server: Starting IPC server session. (process) ProcessRunner: Starting process with '/usr/bin/php' '-dhtml_errors=0' '-ddisplay_errors=0' '-dlogerrors=1' '/var/www/tg/vendor/danog/madelineproto/src/Ipc/Runner/entry.php' 'madeline-ipc' 'session.____' '1569156922' Exception: fsockopen(): php_networkgetaddresses: getaddrinfo for failed: Temporary failure in name resolution in WebRunner.php:122 WebRunner: Error while sending to tcp://_:80: \danog\MadelineProto\Exception: fsockopen(): php_networkgetaddresses: getaddrinfo for failed: Temporary failure in name resolution in /var/www/tg/vendor/danog/madelineproto/src/Ipc/Runner/WebRunner.php:122 Revision: 8.0.0-beta153 TL Trace:
exceptionErrorHandler()
WebRunner.php(122): fsockopen()
WebRunner.php(77): selfStart()
Server.php(110): start()
Serialization.php(183): startMe()
AbstractDriver.php(422): Amp{closure}()
AbstractDriver.php(558): invokeMicrotasks()
Revolt\EventLoop\Internal{closure}()
AbstractDriver.php(495): start()
AbstractDriver.php(534): invokeCallbacks()
Revolt\EventLoop\Internal{closure}()
AbstractDriver.php(93): start()
DriverSuspension.php(99): Revolt\EventLoop\Internal{closure}()
Future.php(251): suspend()
API.php(307): await()
API.php(194): connectToMadelineProto()
index.php(502): construct() Exception: fsockopen(): php_networkgetaddresses: getaddrinfo for failed: Temporary failure in name resolution in WebRunner.php:122 WebRunner: Error while sending to tls://_:80: \danog\MadelineProto\Exception: fsockopen(): php_networkgetaddresses: getaddrinfo for failed: Temporary failure in name resolution in /var/www/tg/vendor/danog/madelineproto/src/Ipc/Runner/WebRunner.php:122 Revision: 8.0.0-beta153 TL Trace:
exceptionErrorHandler()
WebRunner.php(122): fsockopen()
WebRunner.php(77): selfStart()
Server.php(110): start()
Serialization.php(183): startMe()
AbstractDriver.php(422): Amp{closure}()
AbstractDriver.php(558): invokeMicrotasks()
Revolt\EventLoop\Internal{closure}()
AbstractDriver.php(495): start()
AbstractDriver.php(534): invokeCallbacks()
Revolt\EventLoop\Internal{closure}()
AbstractDriver.php(93): start()
DriverSuspension.php(99): Revolt\EventLoop\Internal{closure}()
Future.php(251): suspend()
API.php(307): await()
API.php(194): connectToMadelineProto()
index.php(502): __construct() Exception: fsockopen(): php_networkgetaddresses: getaddrinfo for failed: Temporary failure in name resolution in WebRunner.php:122 WebRunner: Error while sending to tls://_:443: \danog\MadelineProto\Exception: fsockopen(): php_networkgetaddresses: getaddrinfo for failed: Temporary failure in name resolution in /var/www/tg/vendor/danog/madelineproto/src/Ipc/Runner/WebRunner.php:122 Revision: 8.0.0-beta153 TL Trace:
exceptionErrorHandler()
WebRunner.php(122): fsockopen()
WebRunner.php(77): selfStart()
Server.php(110): start()
Serialization.php(183): startMe()
AbstractDriver.php(422): Amp{closure}()
AbstractDriver.php(558): invokeMicrotasks()
Revolt\EventLoop\Internal{closure}()
AbstractDriver.php(495): start()
AbstractDriver.php(534): invokeCallbacks()
Revolt\EventLoop\Internal{closure}()
AbstractDriver.php(93): start()
DriverSuspension.php(99): Revolt\EventLoop\Internal{closure}()
Future.php(251): suspend()
API.php(307): await()
API.php(194): connectToMadelineProto()
index.php(502):
construct() Exception: Could not connect to ourselves, please check the server configuration! in WebRunner.php:135 Server: \danog\MadelineProto\Exception: Could not connect to ourselves, please check the server configuration! in /var/www/tg/vendor/danog/madelineproto/src/Ipc/Runner/WebRunner.php:135 Revision: 8.0.0-beta153 TL Trace:
WebRunner.php(77): selfStart()
Server.php(110): start()
Serialization.php(183): startMe()
AbstractDriver.php(422): Amp{closure}()
AbstractDriver.php(558): invokeMicrotasks()
Revolt\EventLoop\Internal{closure}()
AbstractDriver.php(495): start()
AbstractDriver.php(534): invokeCallbacks()
Revolt\EventLoop\Internal{closure}()
AbstractDriver.php(93): start()
DriverSuspension.php(99): Revolt\EventLoop\Internal{closure}()
Future.php(251): suspend()
API.php(307): await()
API.php(194): connectToMadelineProto()
index.php(502): construct() Server: Starting IPC server session._____ (web) Exception: fsockopen(): php_networkgetaddresses: getaddrinfo for failed: Temporary failure in name resolution in WebRunner.php:122 WebRunner: Error while sending to tcp://_:80: \danog\MadelineProto\Exception: fsockopen(): php_networkgetaddresses: getaddrinfo for failed: Temporary failure in name resolution in /var/www/tg/vendor/danog/madelineproto/src/Ipc/Runner/WebRunner.php:122 Revision: 8.0.0-beta153 TL Trace:
exceptionErrorHandler()
WebRunner.php(122): fsockopen()
WebRunner.php(77): selfStart()
Server.php(117): start()
Serialization.php(183): startMe()
AbstractDriver.php(422): Amp{closure}()
AbstractDriver.php(558): invokeMicrotasks()
Revolt\EventLoop\Internal{closure}()
AbstractDriver.php(495): start()
AbstractDriver.php(534): invokeCallbacks()
Revolt\EventLoop\Internal{closure}()
AbstractDriver.php(93): start()
DriverSuspension.php(99): Revolt\EventLoop\Internal{closure}()
Future.php(251): suspend()
API.php(307): await()
API.php(194): connectToMadelineProto()
index.php(502):
construct() Exception: fsockopen(): php_networkgetaddresses: getaddrinfo for failed: Temporary failure in name resolution in WebRunner.php:122 WebRunner: Error while sending to tls://_:80: \danog\MadelineProto\Exception: fsockopen(): php_networkgetaddresses: getaddrinfo for failed: Temporary failure in name resolution in /var/www/tg/vendor/danog/madelineproto/src/Ipc/Runner/WebRunner.php:122 Revision: 8.0.0-beta153 TL Trace:
exceptionErrorHandler()
WebRunner.php(122): fsockopen()
WebRunner.php(77): selfStart()
Server.php(117): start()
Serialization.php(183): startMe()
AbstractDriver.php(422): Amp{closure}()
AbstractDriver.php(558): invokeMicrotasks()
Revolt\EventLoop\Internal{closure}()
AbstractDriver.php(495): start()
AbstractDriver.php(534): invokeCallbacks()
Revolt\EventLoop\Internal{closure}()
AbstractDriver.php(93): start()
DriverSuspension.php(99): Revolt\EventLoop\Internal{closure}()
Future.php(251): suspend()
API.php(307): await()
API.php(194): connectToMadelineProto()
index.php(502): construct() Exception: fsockopen(): php_networkgetaddresses: getaddrinfo for failed: Temporary failure in name resolution in WebRunner.php:122 WebRunner: Error while sending to tls://_:443: \danog\MadelineProto\Exception: fsockopen(): php_networkgetaddresses: getaddrinfo for failed: Temporary failure in name resolution in /var/www/tg/vendor/danog/madelineproto/src/Ipc/Runner/WebRunner.php:122 Revision: 8.0.0-beta153 TL Trace:
exceptionErrorHandler()
WebRunner.php(122): fsockopen()
WebRunner.php(77): selfStart()
Server.php(117): start()
Serialization.php(183): startMe()
AbstractDriver.php(422): Amp{closure}()
AbstractDriver.php(558): invokeMicrotasks()
Revolt\EventLoop\Internal{closure}()
AbstractDriver.php(495): start()
AbstractDriver.php(534): invokeCallbacks()
Revolt\EventLoop\Internal{closure}()
AbstractDriver.php(93): start()
DriverSuspension.php(99): Revolt\EventLoop\Internal{closure}()
Future.php(251): suspend()
API.php(307): await()
API.php(194): connectToMadelineProto()
index.php(502): construct() Exception: Could not connect to ourselves, please check the server configuration! in WebRunner.php:135 Server: \danog\MadelineProto\Exception: Could not connect to ourselves, please check the server configuration! in /var/www/tg/vendor/danog/madelineproto/src/Ipc/Runner/WebRunner.php:135 Revision: 8.0.0-beta153 TL Trace:
WebRunner.php(77): selfStart()
Server.php(117): start()
Serialization.php(183): startMe()
AbstractDriver.php(422): Amp{closure}()
AbstractDriver.php(558): invokeMicrotasks()
Revolt\EventLoop\Internal{closure}()
AbstractDriver.php(495): start()
AbstractDriver.php(534): invokeCallbacks()
Revolt\EventLoop\Internal{closure}()
AbstractDriver.php(93): start()
DriverSuspension.php(99): Revolt\EventLoop\Internal{closure}()
Future.php(251): suspend()
API.php(307): await()
API.php(194): connectToMadelineProto()
index.php(502):
construct() Serialization: MadelineProto is starting, please wait... Logger: MadelineProto 8.0.0-beta153 Logger: Copyright (C) 2016-2023 Daniil Gentili Logger: Licensed under AGPLv3 Logger: https://github.com/danog/MadelineProto Serialization: Got exclusive session lock! DataCenter: Acquiring connect lock for 2! DataCenter: Connecting to DC 2 DataCenterConnection: Restoring 0 messages to DC 2 Session: Resetting session in DC 2.0... Connection: Connecting to DC 2.0 via tcp://149.154.167.41:443 main DC 2, via ipv4 using AbridgedStream => SocksProxy ({"address":"my_proxy_adress","port":"my_proxy_port","username":"my_proxy_user","password":"my_proxy_pass"}) => BufferedRawStream => DefaultStream SocksProxy: [ "Connected to 10.2.0.2:59485 via socks5" ] Connection: Connected to DC 2.0 via tcp://149.154.167.41:443 main DC 2, via ipv4 using AbridgedStream => SocksProxy ({"address":"my_proxy_adress","port":"my_proxy_port","username":"my_proxy_user","password":"my_proxy_pass"}) => BufferedRawStream => DefaultStream! DataCenterConnection: Acquiring lock in order to init auth for DC 2 DataCenterConnection: Initing auth for DC 2 DataCenterConnection: Done initing auth for DC 2 Session: Garbage collected 0 outgoing messages in DC 2, 1 left PingLoop: Ping DC 2.0 MTProto: AUTH_KEY_UNREGISTERED MTProto: Starting update system APIWrapper: MadelineProto is ready! SessionPaths: Waiting for exclusive lock of session.___
/ipcState.php.lock... SessionPaths: Got exclusive lock of session./ipcState.php.lock... SessionPaths: Waiting for exclusive lock of session./safe.php.lock... SessionPaths: Got exclusive lock of session./safe.php.lock... SessionPaths: Waiting for exclusive lock of session./lightState.php.lock... SessionPaths: Got exclusive lock of session._/lightState.php.lock... APIWrapper: Saved session! Server: Accepted IPC client connection! Serialization: MadelineProto is starting, please wait... Serialization: Connected to IPC socket! Login: Logging in as a normal user... Server: IPC server started successfully! Login: Logged in successfully! MTProto: Starting update system UpdateHandler: Parsing updates (updateShortMessage) received via the socket... GarbageCollector: gc_collectcycles done. Cleaned memory: 0 Mb FeedLoop: Resumed update feed loop generic UpdateHandler: Parsing updates (updates) received via the socket... FeedLoop: Resumed update feed loop generic ProcessRunner: Got final message from worker: ProcessRunner: Got final message from worker: FeedLoop: Getdiff fed me message of type message in update feed loop generic... FeedLoop: Resumed update feed loop generic UpdateHandler: Saving update of type updateNewMessage UpdateHandler: Saving update of type updateReadHistoryInbox Session: Garbage collected 18 incoming messages in DC 2, 0 left Session: Garbage collected 16 outgoing messages in DC 2, 0 left UpdateHandler: Parsing updates (updates) received via the socket... FeedLoop: Resumed update feed loop generic UpdateHandler: Saving update of type updateDeleteMessages UpdateHandler: Parsing updates (updates) received via the socket... SeqLoop: Was fed updates of type updates... FeedLoop: Resumed update feed loop generic UpdateHandler: Saving update of type updateUserStatus Session: Garbage collected 3 incoming messages in DC 2, 0 left Session: Garbage collected 2 outgoing messages in DC 2, 0 left Session: Garbage collected 1 incoming messages in DC 2, 0 left Session: Garbage collected 2 outgoing messages in DC 2, 0 left SessionPaths: Waiting for exclusive lock of session./safe.php.lock... SessionPaths: Got exclusive lock of session./safe.php.lock... SessionPaths: Waiting for exclusive lock of session./lightState.php.lock... SessionPaths: Got exclusive lock of session._/lightState.php.lock... APIWrapper: Saved session! UpdateHandler: Parsing updates (updatesTooLong) received via the socket... ResponseHandler: Auth key not registered in DC 2 with RPC error AUTH_KEYUNREGISTERED, resetting temporary and permanent auth keys... ResponseHandler: Permanent auth key was main authorized key, logging out... ResponseHandler: !!!!!!! WARNING !!!!!!! Telegram's flood prevention system suspended this account. To continue, manual verification is required. Send an email to recover@telegram.org, asking to unban the phone number +, and shortly describe what will you do with this phone number. Then login again. If you intentionally deleted this account, ignore this message. Session: Garbage collected 3 incoming messages in DC 2, 0 left Session: Garbage collected 3 outgoing messages in DC 2, 1 left Session: Can't garbage collect updates.getDifference with message ID 7287854589805128028 sent 11 seconds ago in DC 2, no response has been received or it wasn't yet handled! Session: Garbage collected 0 outgoing messages in DC 2, 1 left Session: Can't garbage collect updates.getDifference with message ID 7287854589805128028 sent 21 seconds ago in DC 2, no response has been received or it wasn't yet handled! Session: Garbage collected 0 outgoing messages in DC 2, 1 left Session: Can't garbage collect updates.getDifference with message ID 7287854589805128028 sent 31 seconds ago in DC 2, no response has been received or it wasn't yet handled! Session: Garbage collected 0 outgoing messages in DC 2, 1 left ReadLoop: danog\MadelineProto\NothingInTheSocketException in /var/www/tg/vendor/danog/madelineproto/src/Stream/Common/BufferedRawStream.php:154 Stack trace:

0 /var/www/tg/vendor/danog/madelineproto/src/Stream/MTProtoTransport/AbridgedStream.php(78): danog\MadelineProto\Stream\Common\BufferedRawStream->bufferRead()

1 /var/www/tg/vendor/danog/madelineproto/src/Loop/Connection/ReadLoop.php(132): danog\MadelineProto\Stream\MTProtoTransport\AbridgedStream->getReadBuffer()

2 /var/www/tg/vendor/danog/madelineproto/src/Loop/Connection/ReadLoop.php(57): danog\MadelineProto\Loop\Connection\ReadLoop->readMessage()

3 /var/www/tg/vendor/danog/loop/lib/Loop.php(139): danog\MadelineProto\Loop\Connection\ReadLoop->loop()

4 /var/www/tg/vendor/danog/loop/lib/Loop.php(166): danog\Loop\Loop->loopInternal()

5 /var/www/tg/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(593): danog\Loop\Loop->danog\Loop{closure}()

6 [internal function]: Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal{closure}()

7 /var/www/tg/vendor/revolt/event-loop/src/EventLoop/Internal/DriverSuspension.php(54): Fiber->resume()

8 /var/www/tg/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(422): Revolt\EventLoop\Internal\DriverSuspension::Revolt\EventLoop\Internal{closure}()

9 /var/www/tg/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(612): Revolt\EventLoop\Internal\AbstractDriver->invokeMicrotasks()

10 [internal function]: Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal{closure}()

11 /var/www/tg/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(494): Fiber->resume()

12 /var/www/tg/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(549): Revolt\EventLoop\Internal\AbstractDriver->invokeCallbacks()

13 [internal function]: Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal{closure}()

14 /var/www/tg/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(93): Fiber->resume()

15 /var/www/tg/vendor/revolt/event-loop/src/EventLoop/Internal/DriverSuspension.php(99): Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal{closure}()

16 /var/www/tg/vendor/amphp/amp/src/Future.php(251): Revolt\EventLoop\Internal\DriverSuspension->suspend()

17 /var/www/tg/vendor/danog/madelineproto/src/Ipc/Server.php(165): Amp\Future->await()

18 /var/www/tg/vendor/danog/madelineproto/src/Ipc/Runner/entry.php(119): danog\MadelineProto\Ipc\Server::waitShutdown()

19 /var/www/tg/vendor/danog/madelineproto/src/Ipc/Runner/entry.php(154): danog\MadelineProto\Ipc\Runner{closure}()

20 {main}

ReadLoop: Got exception in DC 2.0, reconnecting... Connection: Reconnecting DC 2.0 Connection: Disconnecting from DC 2.0 Connection: Disconnected from DC 2.0 Session: Resetting session in DC 2.0... Connection: Connecting to DC 2.0 via tcp://149.154.167.41:443 main DC 2, via ipv4 using AbridgedStream => SocksProxy ({"address":"my_proxy_adress","port":"my_proxy_port","username":"my_proxy_user","password":"my_proxy_pass"}) => BufferedRawStream => DefaultStream SocksProxy: [ "Connected to 10.2.0.2:48113 via socks5" ] Connection: Connected to DC 2.0 via tcp://149.154.167.41:443 main DC 2, via ipv4 using AbridgedStream => SocksProxy ({"address":"my_proxy_adress","port":"my_proxy_port","username":"my_proxy_user","password":"my_proxy_pass"}) => BufferedRawStream => DefaultStream! DataCenterConnection: Acquiring lock in order to init auth for DC 2 DataCenterConnection: Initing auth for DC 2 DataCenterConnection: Generating permanent authorization key for DC 2... AuthKeyHandler: Requesting pq... Session: Can't garbage collect updates.getDifference sent 36 seconds ago in DC 2, no response has been received or it wasn't yet handled! Session: Garbage collected 0 outgoing messages in DC 2, 2 left ResponseHandler: Trying to assign a response of type ResPQ to its request... ResponseHandler: Does the request of return type updates.Difference match? ResponseHandler: No ResponseHandler: Does the request of return type ResPQ match? ResponseHandler: Yes AuthKeyHandler: Factorizing with native_single_cpp (please wait, might take a while) AuthKeyHandler: Factorizing with python_single_alt (please wait, might take a while) AuthKeyHandler: Install https://prime.madelineproto.xyz and the FFI extension to speed this up! AuthKeyHandler: Factorizing with python_single (please wait, might take a while) AuthKeyHandler: Install https://prime.madelineproto.xyz and the FFI extension to speed this up! AuthKeyHandler: Factorizing with native_single (please wait, might take a while) AuthKeyHandler: Install https://prime.madelineproto.xyz and the FFI extension to speed this up! AuthKeyHandler: Factorization 1297923894532215397 = 1002027283 1295297959 AuthKeyHandler: Starting Diffie Hellman key exchange ResponseHandler: Trying to assign a response of type Server_DH_Params to its request... ResponseHandler: Does the request of return type updates.Difference match? ResponseHandler: No ResponseHandler: Does the request of return type Server_DH_Params match? ResponseHandler: Yes AuthKeyHandler: Server-client time delta = 0.0 s Crypt: Executing p/g checks (1/2)... Crypt: Executing p/g checks (2/2)... Crypt: Executing g check... Crypt: Executing g_a check (1/2)... Crypt: Executing g_a check (2/2)... AuthKeyHandler: Generating b... AuthKeyHandler: Generating g_b... Crypt: Executing g_a check (1/2)... Crypt: Executing g_a check (2/2)... AuthKeyHandler: Executing g_b check... AuthKeyHandler: Preparing client_DH_inner_data... AuthKeyHandler: Executing set_client_DH_params... ResponseHandler: Trying to assign a response of type Set_client_DH_params_answer to its request... ResponseHandler: Does the request of return type updates.Difference match? ResponseHandler: No ResponseHandler: Does the request of return type Set_client_DH_params_answer match? ResponseHandler: Yes AuthKeyHandler: Generating authorization key (install gmp to speed up this process)... AuthKeyHandler: Diffie Hellman key exchange processed successfully! AuthKeyHandler: Auth key generated DataCenterConnection: Generating temporary authorization key for DC 2... AuthKeyHandler: Requesting pq... ResponseHandler: Trying to assign a response of type ResPQ to its request... ResponseHandler: Does the request of return type updates.Difference match? ResponseHandler: No ResponseHandler: Does the request of return type ResPQ match? ResponseHandler: Yes AuthKeyHandler: Factorizing with native_single_cpp (please wait, might take a while) AuthKeyHandler: Factorizing with python_single_alt (please wait, might take a while) AuthKeyHandler: Install https://prime.madelineproto.xyz and the FFI extension to speed this up! AuthKeyHandler: Factorizing with python_single (please wait, might take a while) AuthKeyHandler: Install https://prime.madelineproto.xyz and the FFI extension to speed this up! AuthKeyHandler: Factorizing with native_single (please wait, might take a while) AuthKeyHandler: Install https://prime.madelineproto.xyz and the FFI extension to speed this up! AuthKeyHandler: Factorization 1727939565777758063 = 1051024939 1644051917 AuthKeyHandler: Starting Diffie Hellman key exchange ResponseHandler: Trying to assign a response of type Server_DH_Params to its request... ResponseHandler: Does the request of return type updates.Difference match? ResponseHandler: No ResponseHandler: Does the request of return type Server_DH_Params match? ResponseHandler: Yes AuthKeyHandler: Server-client time delta = 0.0 s Crypt: Executing p/g checks (1/2)... Crypt: Executing p/g checks (2/2)... Crypt: Executing g check... Crypt: Executing g_a check (1/2)... Crypt: Executing g_a check (2/2)... AuthKeyHandler: Generating b... AuthKeyHandler: Generating g_b... Crypt: Executing g_a check (1/2)... Crypt: Executing g_a check (2/2)... AuthKeyHandler: Executing g_b check... AuthKeyHandler: Preparing client_DH_inner_data... AuthKeyHandler: Executing set_client_DH_params... ResponseHandler: Trying to assign a response of type Set_client_DH_params_answer to its request... ResponseHandler: Does the request of return type updates.Difference match? ResponseHandler: No ResponseHandler: Does the request of return type Set_client_DH_params_answer match? ResponseHandler: Yes AuthKeyHandler: Generating authorization key (install gmp to speed up this process)... AuthKeyHandler: Diffie Hellman key exchange processed successfully! AuthKeyHandler: Auth key generated DataCenterConnection: Binding authorization keys... WriteLoop: Skipping auth.logOut pending due to unbound keys in DC 2.0 WriteLoop: Skipping auth.logOut pending due to unbound keys in DC 2.0 DataCenterConnection: Bound temporary and permanent authorization keys, DC 2 WriteLoop: Skipping auth.logOut pending due to uninited connection in DC 2.0 WriteLoop: Writing client info (also executing help.getConfig)... CheckLoop: Still missing updates.getDifference, on DC 2.0, sending state request WriteLoop: Skipping auth.logOut pending due to uninited connection in DC 2.0 CheckLoop: Message updates.getDifference sent 39 seconds ago not received by server, resending... WriteLoop: Skipping auth.logOut pending due to uninited connection in DC 2.0 WriteLoop: Skipping updates.getDifference sent 39 seconds ago due to uninited connection in DC 2.0 WriteLoop: NO MESSAGE SENT in write loop in DC 2.0, pending auth.logOut pending, updates.getDifference sent 39 seconds ago DataCenterConnection: Flushing pending messages, DC 2 DataCenterConnection: Done initing auth for DC 2 PingLoop: Ping DC 2.0 entry: Telegram returned an RPC error: The authorization key has expired (401) (AUTH_KEY_UNREGISTERED), caused by /var/www/tg/vendor/danog/madelineproto/src/MTProtoSession/ResponseHandler.php:403 Revision: 8.0.0-beta153

TL trace: ['updates.getDifference'] WrappedFuture.php(59): danog\MadelineProto\MTProtoSession{closure}() CallHandler.php(99): await() CallHandler.php(45): methodCallAsyncRead() UpdateLoop.php(164): methodCallAsyncRead() Loop.php(139): loop() Loop.php(251): loopInternal() AbstractDriver.php(593): danog\Loop{closure}() Revolt\EventLoop\Internal{closure}() DriverSuspension.php(54): resume() AbstractDriver.php(422): Revolt\EventLoop\Internal{closure}() AbstractDriver.php(612): invokeMicrotasks() Revolt\EventLoop\Internal{closure}() DriverSuspension.php(54): resume() AbstractDriver.php(422): Revolt\EventLoop\Internal{closure}() AbstractDriver.php(612): invokeMicrotasks() Revolt\EventLoop\Internal{closure}() AbstractDriver.php(495): start() AbstractDriver.php(549): invokeCallbacks() Revolt\EventLoop\Internal{closure}() AbstractDriver.php(93): resume() DriverSuspension.php(99): Revolt\EventLoop\Internal{closure}() Future.php(251): suspend() Server.php(165): await() entry.php(119): waitShutdown() entry.php(154): danog\MadelineProto\Ipc\Runner{closure}()

entry: A restart was triggered! MTProto: Prompting final serialization (SHUTDOWN)... MTProto: Done final serialization (SHUTDOWN)! APIWrapper: Shutting down MadelineProto (danog\MadelineProto\API) MTProto: Will unreference instance DataCenterConnection: Disconnecting from shared DC 2 Connection: Disconnecting from DC 2.0 DataCenterConnection: Backed up updates.getDifference, from DC 2.0 Connection: Disconnected from DC 2.0 DataCenterConnection: Backed up 1, added to 0 existing messages) from DC 2 MTProto: Unreferenced instance APIWrapper: Prompting final serialization... APIWrapper: Done final serialization! Serialization: Unlocking exclusive session lock! Serialization: Unlocked exclusive session lock! MTProto: Shutting down MadelineProto (MTProto) MTProto: Will unreference instance DataCenterConnection: Disconnecting from shared DC 2 DataCenterConnection: Backed up 0, added to 1 existing messages) from DC 2 MTProto: Unreferenced instance MTProto: Successfully destroyed MadelineProto

psqq commented 12 months ago

I have the same problem. My two numbers have been blocked. Maybe this is the reason: https://telegram.org/privacy/ru#5-3-spam-i-zloupotrebleniya

The question is, what should I do to prevent the number from being blocked?

JasonMam commented 12 months ago

I have already simplified the code as much as possible. Just call send and enter the code, no proxy even. Ban immediately.

$MadelineProto = new danog\MadelineProto\API('session/my_session');

Send code

$login = $MadelineProto->phoneLogin("my_phone_number");

Submit code

$authorization = $MadelineProto->completePhoneLogin("received_code");

JasonMam commented 12 months ago

4 numbers flew into the ban, the first time such a thing happened with this lib. I wrote about all the numbers to recover@telegram.org, I hope they will restore them.

danog commented 11 months ago

I wrote about all the numbers to recover@telegram.org, I hope they will restore them.

Yep, that's the only way to recover them.