Repository navigation
Closed
Labels
not enough infoA maintainer has requested additional information from the reporter.A maintainer has requested additional information from the reporter.
Description
PHP Version
8.4
Swoole Extension Version
6.0.2
Database Driver & Version
No response
Description
[2025-05-02 14:59:42 *403.0] channel is destroyed, 1 consumers will be discarded
[2025-05-02 14:59:42 *403.0] Fatal error: Uncaught TypeError: Hyperf\Context\RequestContext::get(): Return value must be of type Swow\Psr7\Message\ServerRequestPlusInterface, null returned in /var/www/html/vendor/hyperf/context/src/RequestContext.php:23
Stack trace:
#0 /var/www/html/vendor/hyperf/http-server/src/Request.php(604): Hyperf\Context\RequestContext::get()
#1 /var/www/html/vendor/hyperf/http-server/src/Request.php(595): Hyperf\HttpServer\Request->getRequest()
#2 /var/www/html/vendor/hyperf/http-server/src/Request.php(391): Hyperf\HttpServer\Request->call()
#3 /var/www/html/app/Exceptions/TelegramLogHandler.php(19): Hyperf\HttpServer\Request->getBody()
#4 /var/www/html/vendor/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php(250): App\Exceptions\TelegramLogHandler->sendCurl()
#5 /var/www/html/vendor/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php(235): Monolog\Handler\TelegramBotHandler->send()
#6 /var/www/html/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(44): Monolog\Handler\TelegramBotHandler->write()
#7 /var/www/html/vendor/monolog/monolog/src/Monolog/Logger.php(391): Monolog\Handler\AbstractProcessingHandler->handle()
#8 /var/www/html/vendor/monolog/monolog/src/Monolog/Logger.php(646): Monolog\Logger->addRecord()
#9 /var/www/html/vendor/hypervel/log/src/Logger.php(138): Monolog\Logger->error()
#10 /var/www/html/vendor/hypervel/log/src/Logger.php(65): Hypervel\Log\Logger->writeLog()
#11 /var/www/html/vendor/hypervel/log/src/LogManager.php(588): Hypervel\Log\Logger->error()
#12 /var/www/html/vendor/hypervel/foundation/src/Exceptions/Handler.php(311): Hypervel\Log\LogManager->error()
#13 /var/www/html/vendor/hypervel/foundation/src/Exceptions/Handler.php(270): Hypervel\Foundation\Exceptions\Handler->reportThrowable()
#14 /var/www/html/vendor/hypervel/coroutine/src/Coroutine.php(26): Hypervel\Foundation\Exceptions\Handler->report()
#15 /var/www/html/vendor/hyperf/coroutine/src/Coroutine.php(82): Hypervel\Coroutine\Coroutine::printLog()
#16 [internal function]: Hyperf\Coroutine\Coroutine::{closure:Hyperf\Coroutine\Coroutine::create():78}()
#17 {main}
thrown in /var/www/html/vendor/hyperf/context/src/RequestContext.php on line 23
Steps To Reproduce
request()->getBody()->getContents();Metadata
Metadata
Assignees
Labels
not enough infoA maintainer has requested additional information from the reporter.A maintainer has requested additional information from the reporter.
Activity
albertcht commentedon May 2, 2025
It happened when there's exception happening in the coroutine?
You didn't provide the detailed reproducible steps. Unable to reproduce it.
It looks like something went wrong in your own
TelegramBotHandler?foremtehan commentedon May 2, 2025
The error happens when we call
request()->getBody()->getContents();out of Http context, For example if you call it inphp artisan tinkeralbertcht commentedon May 3, 2025
This is a really important message! It's very misleading without it. Please describe your questions in as much detail as possible next time, thanks.
I think this is an expected error since the request is only available in HTTP environment.