Closed 7937505 closed 2 years ago
Thanks for posting in our issue tracker. In order to properly assist you, we need additional information:
Thanks!
This is an automated comment, triggered by adding the label status:need more info
.
'class' => 'yii\redis\Connection', 'hostname' => '10.0.4.7', 'port' => 6379, 'database' => 7, 'socketClientFlags' => STREAM_CLIENT_PERSISTENT,
When I increased the socketClientFlags setting, the exception appeared
I have the same problem ,Has this been solved? How?
@7937505
@samdark the same issue https://github.com/yiisoft/yii2-queue/issues/390 . Has this been solved too?
I think so. It's closed.
@samdark
But I have the same problem. After I add <'socketClientFlags' => STREAM_CLIENT_PERSISTENT,>
<Failed to write to socket> will appear.
You can't use STREAM_CLIENT_PERSISTENT
standalone, needs to be STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT
, it's a bit mask
@particleflux yes , it is STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT , but get
name "Redis Socket Exception" message "Failed to write to socket. 0 of 23 bytes written.\nRedis command was: 2\r\n$6\r\nSELECT\r\n$1\r\n7\r\n" code "" type "yii\redis\SocketException" file "/vendor/yiisoft/yii2-redis/src/Connection.php" line 827 stack-trace 0 "#0 /vendor/yiisoft/yii2-redis/src/Connection.php(796): yii\redis\Connection->sendRawCommand('2\r\n$6\r\nSELECT\r...', Array)" 1 "#1 /vendor/yiisoft/yii2-redis/src/Connection.php(652): yii\redis\Connection->executeCommand('SELECT', Array)" 2 "#2 /vendor/yiisoft/yii2-redis/src/Connection.php(759): yii\redis\Connection->open()" 3 "#3 /vendor/yiisoft/yii2-redis/src/Cache.php(198): yii\redis\Connection->executeCommand('GET', Array)" 4 "#4 /vendor/yiisoft/yii2/caching/Cache.php(134): yii\redis\Cache->getValue('8301292eb993d3f...')" 5 "#5 /vendor/yiisoft/yii2/web/UrlManager.php(311): yii\caching\Cache->get('8301292eb993d3f...')" 6 "#6 /vendor/yiisoft/yii2/web/UrlManager.php(229): yii\web\UrlManager->getBuiltRulesFromCache(Array)" 7 "#7 /vendor/yiisoft/yii2/web/UrlManager.php(211): yii\web\UrlManager->buildRules(Array)" 8 "#8 /vendor/yiisoft/yii2-debug/src/Module.php(293): yii\web\UrlManager->addRules(Array, false)" 9 "#9 /vendor/yiisoft/yii2/base/Application.php(325): yii\debug\Module->bootstrap(Object(yii\web\Application))" 10 "#10 /vendor/yiisoft/yii2/web/Application.php(69): yii\base\Application->bootstrap()" 11 "#11 /vendor/yiisoft/yii2/base/Application.php(271): yii\web\Application->bootstrap()" 12 "#12 /vendor/yiisoft/yii2/base/BaseObject.php(109): yii\base\Application->init()" 13 "#13 /vendor/yiisoft/yii2/base/Application.php(204): yii\base\BaseObject->construct(Array)" 14 "#14 /public/web/index.php(20): yii\base\Application->construct(Array)" 15 "#15 {main}"
Additional info