danog / MadelineProto

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

Sometimes have auth error #1482

Closed dreich closed 4 months ago

dreich commented 4 months ago

Now I have this error, yet it worked for some time.

Deprecated: Creation of dynamic property Revolt\EventLoop\UncaughtThrowable::$previous is deprecated in phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/Ipc/ExitFailure.php on line 88 danog\MadelineProto\Exception: Client backtrace in phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/Ipc/ExitFailure.php:62 Stack trace:

0 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/Ipc/ExitFailure.php(80): danog\MadelineProto\Ipc\ExitFailure->getException()

1 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/Ipc/IpcState.php(71): danog\MadelineProto\Ipc\ExitFailure->getException()

2 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/Ipc/Server.php(142): danog\MadelineProto\Ipc\IpcState->getException()

3 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/amphp/amp/src/functions.php(34): danog\MadelineProto\Ipc\Server::monitor()

4 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(425): Amp{closure}()

5 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(562): Revolt\EventLoop\Internal\AbstractDriver->invokeMicrotasks()

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

7 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(498): Fiber->start()

8 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(537): Revolt\EventLoop\Internal\AbstractDriver->invokeCallbacks()

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

10 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(94): Fiber->start()

11 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/revolt/event-loop/src/EventLoop/Internal/DriverSuspension.php(117): Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal{closure}()

12 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/amphp/amp/src/Future.php(251): Revolt\EventLoop\Internal\DriverSuspension->suspend()

13 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/API.php(307): Amp\Future->await()

14 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/API.php(194): danog\MadelineProto\API->connectToMadelineProto()

15 C:\OSPanel\domains\madeline\index.php(152): danog\MadelineProto\API->__construct()

16 {main}

Next danog\MadelineProto\SecurityException: Auth Failed, please check the logfile for more information, make sure to install https://prime.madelineproto.xyz! in phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/MTProtoSession/AuthKeyHandler.php:407 Stack trace:

0 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/DataCenterConnection.php(178): danog\MadelineProto\Connection->createAuthKey()

1 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(425): danog\MadelineProto\DataCenterConnection->initAuthorization()

2 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(616): Revolt\EventLoop\Internal\AbstractDriver->invokeMicrotasks()

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

4 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/revolt/event-loop/src/EventLoop/Internal/DriverSuspension.php(64): Fiber->resume()

5 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(425): Revolt\EventLoop\Internal\DriverSuspension::Revolt\EventLoop\Internal{closure}()

6 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(616): Revolt\EventLoop\Internal\AbstractDriver->invokeMicrotasks()

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

8 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(497): Fiber->resume()

9 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(553): Revolt\EventLoop\Internal\AbstractDriver->invokeCallbacks()

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

11 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(94): Fiber->resume()

12 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/revolt/event-loop/src/EventLoop/Internal/DriverSuspension.php(117): Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal{closure}()

13 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/amphp/amp/src/Future.php(251): Revolt\EventLoop\Internal\DriverSuspension->suspend()

14 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/Connection.php(586): Amp\Future->await()

15 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/MTProtoSession/CallHandler.php(187): danog\MadelineProto\Connection->sendMessage()

16 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/MTProtoSession/CallHandler.php(91): danog\MadelineProto\Connection->methodCallAsyncWrite()

17 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/MTProtoTools/CallHandler.php(45): danog\MadelineProto\Connection->methodCallAsyncRead()

18 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/MTProto.php(1462): danog\MadelineProto\MTProto->methodCallAsyncRead()

19 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/MTProto.php(1007): danog\MadelineProto\MTProto->fullGetSelf()

20 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/API.php(338): danog\MadelineProto\MTProto->wakeup()

21 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/API.php(194): danog\MadelineProto\API->connectToMadelineProto()

22 C:\OSPanel\userdata\temp\madeline-ipc-8.0.0-beta192_f09eb67bd24a1c1674b7.php(114): danog\MadelineProto\API->construct()

23 C:\OSPanel\userdata\temp\madeline-ipc-8.0.0-beta192___f09eb67bd24a1c1674b7.php(154): danog\MadelineProto\Ipc\Runner{closure}()

24 {main}

Next Revolt\EventLoop\UncaughtThrowable: Uncaught danog\MadelineProto\SecurityException thrown in event loop callback danog\MadelineProto\DataCenterConnection::initAuthorization defined in phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/DataCenterConnection.php:148; use Revolt\EventLoop::setErrorHandler() to gracefully handle such exceptions: Auth Failed, please check the logfile for more information, make sure to install https://prime.madelineproto.xyz! in phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/revolt/event-loop/src/EventLoop/UncaughtThrowable.php:13 Stack trace:

0 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(400): Revolt\EventLoop\UncaughtThrowable::throwingCallback()

1 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/revolt/event-loop/src/EventLoop/Internal/DriverSuspension.php(127): Revolt\EventLoop\Internal\AbstractDriver::Revolt\EventLoop\Internal{closure}()

2 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/amphp/amp/src/Future.php(251): Revolt\EventLoop\Internal\DriverSuspension->suspend()

3 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/Connection.php(586): Amp\Future->await()

4 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/MTProtoSession/CallHandler.php(187): danog\MadelineProto\Connection->sendMessage()

5 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/MTProtoSession/CallHandler.php(91): danog\MadelineProto\Connection->methodCallAsyncWrite()

6 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/MTProtoTools/CallHandler.php(45): danog\MadelineProto\Connection->methodCallAsyncRead()

7 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/MTProto.php(1462): danog\MadelineProto\MTProto->methodCallAsyncRead()

8 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/MTProto.php(1007): danog\MadelineProto\MTProto->fullGetSelf()

9 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/API.php(338): danog\MadelineProto\MTProto->wakeup()

10 phar://C:/OSPanel/domains/madeline/madeline81.phar/vendor/danog/madelineproto/src/API.php(194): danog\MadelineProto\API->connectToMadelineProto()

11 C:\OSPanel\userdata\temp\madeline-ipc-8.0.0-beta192_f09eb67bd24a1c1674b7.php(114): danog\MadelineProto\API->construct()

12 C:\OSPanel\userdata\temp\madeline-ipc-8.0.0-beta192___f09eb67bd24a1c1674b7.php(154): danog\MadelineProto\Ipc\Runner{closure}()

13 {main}

danog commented 4 months ago
  1. Please use Linux, not windows
  2. Please send the full MadelineProto.log file
dreich commented 4 months ago

Looks like the problem with big numbers. I've installed this via Composer. Also I have primemodule installed via Composer. And FFI is enabled.

Connection:         Reconnecting DC 2.0
Connection:         Disconnecting from DC 2.0
Connection:         Disconnected from DC 2.0
Connection:         Connecting to DC 2.0 via tcp://149.154.167.51:443 main DC 2, via ipv4 using AbridgedStream => BufferedRawStream => DefaultStream 
Connection:         Connected to DC 2.0 via tcp://149.154.167.51:443 main DC 2, via ipv4 using AbridgedStream => BufferedRawStream => DefaultStream!
AuthKeyHandler:     Requesting pq...
DataCenterConnection:   Acquiring lock in order to init auth for DC 2
Session:            Garbage collected 1 incoming messages in DC 2, 0 left
Session:            Garbage collected 1 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 1489883193914254589 = 1059695479 * 1405954091
**AuthKeyHandler:   An exception occurred while generating the authorization key in DC 2: danog\MadelineProto\TL\Exception: Значение 9223372036854775807 больше чем 2147483647<br>**
Revision: 8.0.0-beta192<br>
TL Trace:<br>
<br>
<br><br>
TL.php(425):            packSignedInt()<br><br>
DataCenterConnection.php(178):  createAuthKey()<br><br>
AbstractDriver.php(425):    initAuthorization()<br><br>
AbstractDriver.php(616):    invokeMicrotasks()<br><br>
Revolt\EventLoop\Internal\{closure}()<br><br>
DriverSuspension.php(64):   resume()<br><br>
AbstractDriver.php(425):    Revolt\EventLoop\Internal\{closure}()<br><br>
AbstractDriver.php(616):    invokeMicrotasks()<br><br>
Revolt\EventLoop\Internal\{closure}()<br><br>
AbstractDriver.php(497):    resume()<br><br>
AbstractDriver.php(553):    invokeCallbacks()<br><br>
Revolt\EventLoop\Internal\{closure}()<br><br>
AbstractDriver.php(94): resume()<br><br>
DriverSuspension.php(117):  Revolt\EventLoop\Internal\{closure}()<br><br>
Future.php(251):        suspend()<br><br>
Connection.php(586):    await()<br><br>
CallHandler.php(187):   sendMessage()<br><br>
CallHandler.php(91):    methodCallAsyncWrite()<br><br>
CallHandler.php(45):    methodCallAsyncRead()<br><br>
MTProto.php(1374):      methodCallAsyncRead()<br><br>
MTProto.php(544):       getConfig()<br><br>
MTProto.php(491):       initialize()<br><br>
API.php(219):           __construct()<br><br>
index.php(155):         __construct()<br>
danog commented 4 months ago

Solved privately, the issue was caused by a now-removed setting.