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

Exception after configuration: 'socketClientFlags' => STREAM_CLIENT_PERSISTENT #245

Closed
7937505 opened this issue Apr 19, 2022 · 7 comments
Closed

Comments

@7937505
Copy link

7937505 commented Apr 19, 2022

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

Q A
Yii vesion 2.0.45
PHP version 8.0
Operating system debian 10
@yii-bot
Copy link

yii-bot commented Apr 21, 2022

Thanks for posting in our issue tracker.
In order to properly assist you, we need additional information:

  • When does the issue occur?
  • What do you see?
  • What was the expected result?
  • Can you supply us with a stacktrace? (optional)
  • Do you have exact code to reproduce it? Maybe a PHPUnit tests that fails? (optional)

Thanks!

This is an automated comment, triggered by adding the label status:need more info.

@7937505
Copy link
Author

7937505 commented Apr 29, 2022

'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

@7937505 7937505 closed this as completed May 13, 2022
@runtu666
Copy link

I have the same problem ,Has this been solved? How?

@runtu666
Copy link

@7937505

@runtu666
Copy link

@samdark the same issue yiisoft/yii2-queue#390 . Has this been solved too?

@samdark
Copy link
Member

samdark commented Jun 21, 2024

I think so. It's closed.

@runtu666
Copy link

@samdark
But I have the same problem. After I add <'socketClientFlags' => STREAM_CLIENT_PERSISTENT,>
<Failed to write to socket> will appear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants