webman,升级 1.4.6,报错

evilk

php = 7.3.33
workerman/webman-framework = v1.4.6
workerman/workerman = v4.1.0

报错信息如下

[2022-09-19 14:50:32] default.ERROR: xxx POST xxx/xxx/xxx/xxx
DI\Definition\Exception\InvalidDefinition: Entry "Webman\Http\Request" cannot be resolved: Parameter $buffer of __construct() has no value defined or guessable
Full definition:
Object (
class = Webman\Http\Request
lazy = false
__construct(
$buffer = #UNDEFINED#
)
) in /var/www/xxx/master/vendor/php-di/php-di/src/Definition/Exception/InvalidDefinition.php:19
Stack trace:
#0 /var/www/xxx/master/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php(156): DI\Definition\Exception\InvalidDefinition::create(Object(DI\Definition\ObjectDefinition), 'Entry "Webman\\H...')
#1 /var/www/xxx/master/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php(71): DI\Definition\Resolver\ObjectCreator->createInstance(Object(DI\Definition\ObjectDefinition), Array)
#2 /var/www/xxx/master/vendor/php-di/php-di/src/Definition/Resolver/ResolverDispatcher.php(71): DI\Definition\Resolver\ObjectCreator->resolve(Object(DI\Definition\ObjectDefinition), Array)
#3 /var/www/xxx/master/vendor/php-di/php-di/src/Container.php(390): DI\Definition\Resolver\ResolverDispatcher->resolve(Object(DI\Definition\ObjectDefinition), Array)
#4 /var/www/xxx/master/vendor/php-di/php-di/src/Container.php(199): DI\Container->resolveDefinition(Object(DI\Definition\ObjectDefinition), Array)
#5 /var/www/xxx/master/vendor/workerman/webman-framework/src/App.php(423): DI\Container->make('Webman\\Http\\Req...')
#6 /var/www/xxx/master/vendor/workerman/webman-framework/src/App.php(342): Webman\App::resolveMethodDependencies('', Object(support\Request), Array, Object(ReflectionMethod))
#7 /var/www/xxx/master/vendor/workerman/webman-framework/src/App.php(304): Webman\App::Webman\{closure}(Object(support\Request))
#8 /var/www/xxx/master/app/console/middleware/Arms.php(26): Webman\App::Webman\{closure}(Object(support\Request))
#9 /var/www/xxx/master/vendor/workerman/webman-framework/src/App.php(299): app\console\middleware\Arms->process(Object(support\Request), Object(Closure))
#10 /var/www/xxx/master/vendor/evilk123/throttle/src/Throttle.php(147): Webman\App::Webman\{closure}(Object(support\Request))
#11 /var/www/xxx/master/app/api/middleware/Throttle.php(22): evilk123\middleware\Throttle->handle(Object(support\Request), Object(Closure), Array)
#12 /var/www/xxx/master/vendor/workerman/webman-framework/src/App.php(299): app\api\middleware\Throttle->process(Object(support\Request), Object(Closure))
#13 /var/www/xxx/master/app/api/middleware/AuthorizationCheck.php(102): Webman\App::Webman\{closure}(Object(support\Request))
#14 /var/www/xxx/master/vendor/workerman/webman-framework/src/App.php(299): app\api\middleware\AuthorizationCheck->process(Object(support\Request), Object(Closure))
#15 /var/www/xxx/master/vendor/webman/log/src/Middleware.php(84): Webman\App::Webman\{closure}(Object(support\Request))
#16 /var/www/xxx/master/vendor/workerman/webman-framework/src/App.php(299): Webman\Log\Middleware->process(Object(support\Request), Object(Closure))
#17 /var/www/xxx/master/vendor/workerman/webman-framework/src/App.php(506): Webman\App::Webman\{closure}(Object(support\Request))
#18 /var/www/xxx/master/vendor/workerman/webman-framework/src/App.php(128): Webman\App::findRoute(Object(Workerman\Connection\TcpConnection), '/api/star/gain', 'POST/api/star/g...', Object(support\Request))
#19 /var/www/xxx/master/vendor/workerman/workerman/Connection/TcpConnection.php(638): Webman\App->onMessage(Object(Workerman\Connection\TcpConnection), Object(support\Request))
#20 [internal function]: Workerman\Connection\TcpConnection->baseRead(Resource id #405, 2, Resource id #405)
#21 /var/www/xxx/master/vendor/workerman/workerman/Events/Event.php(193): EventBase->loop()
#22 /var/www/xxx/master/vendor/workerman/workerman/Worker.php(2463): Workerman\Events\Event->loop()
#23 /var/www/xxx/master/vendor/workerman/workerman/Worker.php(1574): Workerman\Worker->run()
#24 /var/www/xxx/master/vendor/workerman/workerman/Worker.php(1416): Workerman\Worker::forkOneWorkerForLinux(Object(Workerman\Worker))
#25 /var/www/xxx/master/vendor/workerman/workerman/Worker.php(1390): Workerman\Worker::forkWorkersForLinux()
#26 /var/www/xxx/master/vendor/workerman/workerman/Worker.php(1720): Workerman\Worker::forkWorkers()
#27 /var/www/xxx/master/vendor/workerman/workerman/Worker.php(1660): Workerman\Worker::monitorWorkersForLinux()
#28 /var/www/xxx/master/vendor/workerman/workerman/Worker.php(559): Workerman\Worker::monitorWorkers()
#29 /var/www/xxx/master/vendor/workerman/webman-framework/src/support/App.php(124): Workerman\Worker::runAll()
#30 /var/www/xxx/master/start.php(4): support\App::run()
#31 {main} [] []
2160 2 0
2个回答

walkor 打赏

试下主干版本, composer require workerman/webman-framework dev-master
如果无法安装主干版本,直接到vendor/workerman/下删除 webman-framework,然后执行 git clone https://github.com/walkor/webman-framework 试下

walkor 打赏

刚发了一个1.4.7,兼容控制器注入的一些特殊情况,试下

  • 暂无评论
年代过于久远,无法发表回答
×
🔝