Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An invalid ID was specified! #1449

Closed
MrParAziT opened this issue Dec 14, 2023 · 13 comments
Closed

An invalid ID was specified! #1449

MrParAziT opened this issue Dec 14, 2023 · 13 comments

Comments

@MrParAziT
Copy link

Surfaced: Webmozart\Assert\InvalidArgumentException: An invalid ID was specified! in /var/www/html/files/vendor/webmozart/assert/src/Assert.php:2074
Stack trace:
#0 /var/www/html/files/vendor/webmozart/assert/src/Assert.php(635): Webmozart\Assert\Assert::reportInvalidArgument()
#1 /var/www/html/files/vendor/danog/madelineproto/src/MTProtoTools/PeerHandler.php(416): Webmozart\Assert\Assert::true()
#2 /var/www/html/files/vendor/danog/madelineproto/src/MTProtoTools/PeerHandler.php(338): danog\MadelineProto\MTProto->getInfo()
#3 /var/www/html/files/vendor/danog/madelineproto/src/TL/TL.php(583): danog\MadelineProto\MTProto->getInputPeer()
#4 /var/www/html/files/vendor/danog/madelineproto/src/TL/TL.php(761): danog\MadelineProto\TL\TL->serializeObject()
#5 /var/www/html/files/vendor/danog/madelineproto/src/TL/TL.php(631): danog\MadelineProto\TL\TL->serializeParams()
#6 /var/www/html/files/vendor/danog/madelineproto/src/Connection.php(550): danog\MadelineProto\TL\TL->serializeMethod()
#7 /var/www/html/files/vendor/danog/madelineproto/src/MTProtoSession/CallHandler.php(198): danog\MadelineProto\Connection->sendMessage()
#8 /var/www/html/files/vendor/danog/madelineproto/src/MTProtoSession/CallHandler.php(98): danog\MadelineProto\Connection->methodCallAsyncWrite()
#9 /var/www/html/files/vendor/danog/madelineproto/src/MTProtoTools/CallHandler.php(45): danog\MadelineProto\Connection->methodCallAsyncRead()
#10 /var/www/html/files/vendor/danog/madelineproto/src/Namespace/AbstractAPI.php(70): danog\MadelineProto\MTProto->methodCallAsyncRead()
#11 /var/www/html/files/f2l_bot.php(256): danog\MadelineProto\Namespace\AbstractAPI->__call()
#12 /var/www/html/files/vendor/danog/madelineproto/src/EventHandler.php(227): MyEventHandler->handleMessage()
#13 /var/www/html/files/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(425): danog\MadelineProto\EventHandler::danog\MadelineProto{closure}()
#14 /var/www/html/files/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(616): Revolt\EventLoop\Internal\AbstractDriver->invokeMicrotasks()
#15 [internal function]: Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal{closure}()
#16 /var/www/html/files/vendor/revolt/event-loop/src/EventLoop/Internal/DriverSuspension.php(64): Fiber->resume()
#17 /var/www/html/files/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(425): Revolt\EventLoop\Internal\DriverSuspension::Revolt\EventLoop\Internal{closure}()
#18 /var/www/html/files/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(616): Revolt\EventLoop\Internal\AbstractDriver->invokeMicrotasks()
#19 [internal function]: Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal{closure}()
#20 /var/www/html/files/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(498): Fiber->start()
#21 /var/www/html/files/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(553): Revolt\EventLoop\Internal\AbstractDriver->invokeCallbacks()
#22 [internal function]: Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal{closure}()
#23 /var/www/html/files/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(94): Fiber->resume()
#24 /var/www/html/files/vendor/revolt/event-loop/src/EventLoop/Internal/DriverSuspension.php(117): Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal{closure}()
#25 /var/www/html/files/vendor/amphp/amp/src/Future.php(251): Revolt\EventLoop\Internal\DriverSuspension->suspend()
#26 /var/www/html/files/vendor/danog/madelineproto/src/Wrappers/Loop.php(107): Amp\Future->await()
#27 /var/www/html/files/vendor/danog/madelineproto/src/AbstractAPI.php(84): danog\MadelineProto\MTProto->loop()
#28 /var/www/html/files/vendor/danog/madelineproto/src/AbstractAPI.php(65): danog\MadelineProto\AbstractAPI->startAndLoopLogic()
#29 /var/www/html/files/vendor/danog/madelineproto/src/EventHandler.php(100): danog\MadelineProto\AbstractAPI->startAndLoopInternal()
#30 /var/www/html/files/f2l_bot.php(315): danog\MadelineProto\EventHandler::startAndLoopBot()

Surfaced: AssertionError: Invalid ID 0 provided! in /var/www/html/files/vendor/danog/madelineproto/src/MTProtoTools/DialogId.php:41
Stack trace:
#0 /var/www/html/files/vendor/danog/madelineproto/src/MTProtoTools/DialogId.php(116): danog\MadelineProto\MTProtoTools\DialogId::getType()
#1 /var/www/html/files/vendor/danog/madelineproto/src/Connection.php(362): danog\MadelineProto\MTProtoTools\DialogId::isSecretChat()
#2 /var/www/html/files/vendor/danog/madelineproto/src/MTProtoSession/CallHandler.php(164): danog\MadelineProto\Connection->methodAbstractions()
#3 /var/www/html/files/vendor/danog/madelineproto/src/MTProtoSession/CallHandler.php(98): danog\MadelineProto\Connection->methodCallAsyncWrite()
#4 /var/www/html/files/vendor/danog/madelineproto/src/MTProtoTools/CallHandler.php(45): danog\MadelineProto\Connection->methodCallAsyncRead()
#5 /var/www/html/files/vendor/danog/madelineproto/src/Namespace/AbstractAPI.php(70): danog\MadelineProto\MTProto->methodCallAsyncRead()
#6 /var/www/html/files/f2l_bot.php(70): danog\MadelineProto\Namespace\AbstractAPI->__call()
#7 /var/www/html/files/vendor/danog/madelineproto/src/EventHandler.php(227): MyEventHandler->handleMessage()
#8 /var/www/html/files/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(425): danog\MadelineProto\EventHandler::danog\MadelineProto{closure}()
#9 /var/www/html/files/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(616): Revolt\EventLoop\Internal\AbstractDriver->invokeMicrotasks()
#10 [internal function]: Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal{closure}()
#11 /var/www/html/files/vendor/revolt/event-loop/src/EventLoop/Internal/DriverSuspension.php(64): Fiber->resume()
#12 /var/www/html/files/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(425): Revolt\EventLoop\Internal\DriverSuspension::Revolt\EventLoop\Internal{closure}()
#13 /var/www/html/files/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(616): Revolt\EventLoop\Internal\AbstractDriver->invokeMicrotasks()
#14 [internal function]: Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal{closure}()
#15 /var/www/html/files/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(497): Fiber->resume()
#16 /var/www/html/files/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(553): Revolt\EventLoop\Internal\AbstractDriver->invokeCallbacks()
#17 [internal function]: Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal{closure}()
#18 /var/www/html/files/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(94): Fiber->resume()
#19 /var/www/html/files/vendor/revolt/event-loop/src/EventLoop/Internal/DriverSuspension.php(117): Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal{closure}()
#20 /var/www/html/files/vendor/amphp/amp/src/Future.php(251): Revolt\EventLoop\Internal\DriverSuspension->suspend()
#21 /var/www/html/files/vendor/danog/madelineproto/src/Wrappers/Loop.php(107): Amp\Future->await()
#22 /var/www/html/files/vendor/danog/madelineproto/src/AbstractAPI.php(84): danog\MadelineProto\MTProto->loop()
#23 /var/www/html/files/vendor/danog/madelineproto/src/AbstractAPI.php(65): danog\MadelineProto\AbstractAPI->startAndLoopLogic()
#24 /var/www/html/files/vendor/danog/madelineproto/src/EventHandler.php(100): danog\MadelineProto\AbstractAPI->startAndLoopInternal()
#25 /var/www/html/files/f2l_bot.php(315): danog\MadelineProto\EventHandler::startAndLoopBot()
#26 {main}

@danog
Copy link
Owner

danog commented Dec 14, 2023

What does f2l_bot.php:256 do?

@danog
Copy link
Owner

danog commented Dec 14, 2023

And f2l_bot.php:70

@MrParAziT
Copy link
Author

70:
$this->messages->sendMessage
256:
$this->messages->sendMessage

@danog
Copy link
Owner

danog commented Dec 14, 2023

And what parameters are being passed?

@danog
Copy link
Owner

danog commented Dec 14, 2023

Make sure you're using the SimpleEventHandler pls

@MrParAziT
Copy link
Author

Make sure you're using the SimpleEventHandler pls

I'm sure.
class MyEventHandler extends SimpleEventHandler
{
....

@MrParAziT
Copy link
Author

And what parameters are being passed?

peer, message

@danog
Copy link
Owner

danog commented Dec 14, 2023

And how are you obtaining the peer? You should be using $message->chatId with simple filters (NOT onUpdateNew... handlers)

@danog
Copy link
Owner

danog commented Dec 14, 2023

Basically you're 100% just passing an invalid ID, try logging the exact ID you're passing before the exception

@MrParAziT
Copy link
Author

And how are you obtaining the peer? You should be using $message->chatId with simple filters (NOT onUpdateNew... handlers)

Ummm... I'm using id from database, now what can i do?Is it related to this?

@danog
Copy link
Owner

danog commented Dec 14, 2023

The problem is that the ID is 100% incorrect, either an invalid string, or something else.
Log the ID you're passing to the method when the exception is thrown to debug the issue.

@MrParAziT
Copy link
Author

The problem is that the ID is 100% incorrect, either an invalid string, or something else. Log the ID you're passing to the method when the exception is thrown to debug the issue.

The problem is that the ID is 100% incorrect, either an invalid string, or something else. Log the ID you're passing to the method when the exception is thrown to debug the issue.

Ok I will tell you the result, thank you...

@MrParAziT
Copy link
Author

Nice, The problem was solved.

@danog danog closed this as completed Dec 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants