清空了一下redis数据库 导致session无法使用redis驱动
//seesion配置
....
'type' => 'redis', // or redis or redis_cluster
'handler' => RedisSessionHandler::class,
'config' => [
'file' => [
'save_path' => runtime_path() . '/sessions',
],
'redis' => [
'host' => '127.0.0.1',
'port' => 6379,
'auth' => '',
'timeout' => 2,
'database' => 1,
'prefix' => env('DB_NAME').'_redis_session_',
],
...
],
....
TypeError: Workerman\Protocols\Http\Session\RedisSessionHandler::read(): Return value must be of type string, bool returned in /www/wwwroot/code/xiangmu/vendor/workerman/workerman/src/Protocols/Http/Session/RedisSessionHandler.php:116
Stack trace:
#0 /www/wwwroot/code/xiangmu/vendor/workerman/workerman/src/Protocols/Http/Session.php(170): Workerman\Protocols\Http\Session\RedisSessionHandler->read()
#1 /www/wwwroot/code/xiangmu/vendor/workerman/workerman/src/Protocols/Http/Request.php(306): Workerman\Protocols\Http\Session->__construct()
#2 /www/wwwroot/code/xiangmu/plugin/admin/app/middleware/GlobalInject.php(44): Workerman\Protocols\Http\Request->session()
#3 /www/wwwroot/code/xiangmu/vendor/workerman/webman-framework/src/App.php(341): plugin\admin\app\middleware\GlobalInject->process()
#4 /www/wwwroot/code/xiangmu/vendor/workerman/webman-framework/src/App.php(141): Webman\App::Webman\{closure}()
#5 /www/wwwroot/code/xiangmu/vendor/workerman/workerman/src/Connection/TcpConnection.php(710): Webman\App->onMessage()
#6 /www/wwwroot/code/xiangmu/vendor/workerman/workerman/src/Events/Revolt.php(146): Workerman\Connection\TcpConnection->baseRead()
#7 /www/wwwroot/code/xiangmu/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(587): Workerman\Events\Revolt->Workerman\Events\{closure}()
#8 [internal function]: Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal\{closure}()
#9 /www/wwwroot/code/xiangmu/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(494): Fiber->resume()
#10 /www/wwwroot/code/xiangmu/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(549): Revolt\EventLoop\Internal\AbstractDriver->invokeCallbacks()
#11 [internal function]: Revolt\EventLoop\Internal\AbstractDriver->Revolt\EventLoop\Internal\{closure}()
#12 /www/wwwroot/code/xiangmu/vendor/revolt/event-loop/src/EventLoop/Internal/AbstractDriver.php(112): Fiber->start()
#13 /www/wwwroot/code/xiangmu/vendor/workerman/workerman/src/Events/Revolt.php(88): Revolt\EventLoop\Internal\AbstractDriver->run()
#14 /www/wwwroot/code/xiangmu/vendor/workerman/workerman/src/Worker.php(1594): Workerman\Events\Revolt->run()
#15 /www/wwwroot/code/xiangmu/vendor/workerman/workerman/src/Worker.php(1394): Workerman\Worker::forkOneWorkerForLinux()
#16 /www/wwwroot/code/xiangmu/vendor/workerman/workerman/src/Worker.php(1368): Workerman\Worker::forkWorkersForLinux()
#17 /www/wwwroot/code/xiangmu/vendor/workerman/workerman/src/Worker.php(572): Workerman\Worker::forkWorkers()
#18 /www/wwwroot/code/xiangmu/vendor/workerman/webman-framework/src/support/App.php(131): Workerman\Worker::runAll()
#19 /www/wwwroot/code/xiangmu/start.php(4): support\App::run()
#20 {main}
系统环境 Centos7
"workerman/webman-framework": "^1.5.0",
"workerman/workerman": "^5",
"workerman/http-client": "^2",
"webman-tech/laravel-http-client": "^1.2"
v5还没发正式版,你先手动改成 return (string)$this->redis->get($sessionId);
可以了 这个改包的话 线上也得手动改 可否升级下此处代码
短时间内不会发版本,因为有很多提交还没验证,你先手动改吧