-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
configure native redis clustering results in error message #45566
Comments
Thank you for reporting this issue! As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub. If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team. Thank you! |
It seems this config is incorrect. Please read the docs here thoroughly: https://laravel.com/docs/9.x/redis#clusters |
@dries I use
My config file is excactly as mentioned on laravel page (second code box):
My config file seems to be correct. |
You’re setting HOST and CLUSTER, I think you need to only set one. |
@tillkruss I've removed the
Inside laravel doc it says:
so where / how to define the |
You're still using host + port in that config. If you define those then cluster won't be used. |
But removing both ( |
You run several clusters? That sounds like a terrible idea.
Clusters don't use host+port, but an array of primary cluster nodes. Look at |
@tillkruss it seems like the combination of host + port is still "supported"? But I don't see any chance to get it working like this. |
You can find your answer on Google/SO. |
Check redis cluster docs Each cluster is array of arrays and not just array Example from the docs
And your example
|
Description: configure native redis clustering results in error message
Steps To Reproduce:
database.php
like this:` 'redis' => [
Env values (only relevant, skipped queue details f.e.):
Run redis cluster (docker-compose.yaml)
I'm revceiving the following error message when trying to call default laravel mainpage
Same goes for queue worker (on startup), including more readable details:
root@36f9e34e9915:/var/www/html# php artisan queue:Work INFO Processing jobs from the [{default}] queue. [2023-01-09 10:18:34] local.ERROR: array_key_exists(): Argument #2 ($array) must be of type array, null given {"exception":"[object] (TypeError(code: 0): array_key_exists(): Argument #2 ($array) must be of type array, null given at /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Arr.php:177) [stacktrace] #0 /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(177): array_key_exists('url', NULL) #1 /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(275): Illuminate\\Support\\Arr::exists(NULL, 'url') #2 /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(599): Illuminate\\Support\\Arr::forget(NULL, Array) #3 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/ConfigurationUrlParser.php(36): Illuminate\\Support\\Arr::pull(NULL, 'url') #4 /var/www/html/vendor/laravel/framework/src/Illuminate/Redis/RedisManager.php(186): Illuminate\\Support\\ConfigurationUrlParser->parseConfiguration(NULL) #5 /var/www/html/vendor/laravel/framework/src/Illuminate/Redis/RedisManager.php(133): Illuminate\\Redis\\RedisManager->parseConnectionConfiguration(NULL) #6 [internal function]: Illuminate\\Redis\\RedisManager->Illuminate\\Redis\\{closure}(NULL) [...redacted] "} TypeError array_key_exists(): Argument #2 ($array) must be of type array, null given at vendor/laravel/framework/src/Illuminate/Collections/Arr.php:177
Steps to
Please let me know if more information is required.
-Thanks for help and all of the work on laravel.
The text was updated successfully, but these errors were encountered: