-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Unable to connect to redis sentinel. Getting: unexpected keyword argument 'connection_pool' #3595
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
Comments
Hi @Manhar0911, thank you for bringing this to our attention. I've identified the root cause and will be posting a fix shortly. |
@Manhar0911 Actually, when digging a bit deeper into the code, I noticed that a different class needs to be used for Sentinel connections. In your example, you provided SSLContext, but for Sentinel connections, SentinelManagedSSLConnection should be used instead. Moreover, when ssl=True is specified for Sentinel, there's no need to explicitly set the connection class — it's automatically mapped. |
@petyaslavova can you please give a pseudo code for above. Also specify which redis version to use.
|
Hi @Manhar0911, I hit another issue after setting up the correct class, and there is already an existing old (still open) issue about it. It will need some time to be done properly. I'll add this to my todo list. |
This issue appears to be a duplicate of #3128 |
I am using python client to connect with sentinel master. But getting this error
Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/ecprt/agents/cli/cli.py", line 266, in _worker_run await worker.run() File "/usr/local/lib/python3.12/site-packages/ecprt/agents/worker.py", line 550, in run self.connect_to_redis() File "/usr/local/lib/python3.12/site-packages/ecprt/agents/worker.py", line 476, in connect_to_redis redis_client.ping() File "/usr/local/lib/python3.12/site-packages/redis/commands/core.py", line 1212, in ping return self.execute_command("PING", **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/redis/client.py", line 559, in execute_command return self._execute_command(*args, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/redis/client.py", line 565, in _execute_command conn = self.connection or pool.get_connection(command_name, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/redis/connection.py", line 1417, in get_connection connection = self.make_connection() ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/redis/connection.py", line 1463, in make_connection return self.connection_class(**self.connection_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/redis/connection.py", line 1013, in __init__ super().__init__(**kwargs) File "/usr/local/lib/python3.12/site-packages/redis/connection.py", line 684, in __init__ super().__init__(**kwargs) TypeError: AbstractConnection.__init__() got an unexpected keyword argument 'connection_pool' {"message": "worker failed", "level": "ERROR", "name": "livekit.agents", "exc_info": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/redis/connection.py\", line 1415, in get_connection\n connection = self._available_connections.pop()\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nIndexError: pop from empty list\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/myapp/cli/cli.py\", line 266, in _worker_run\n await worker.run()\n File \"/usr/local/lib/python3.12/site-packages/myapp/worker.py\", line 550, in run\n self.connect_to_redis()\n File \"/usr/local/lib/python3.12/site-packages/myapp/worker.py\", line 476, in connect_to_redis\n redis_client.ping()\n File \"/usr/local/lib/python3.12/site-packages/redis/commands/core.py\", line 1212, in ping\n return self.execute_command(\"PING\", **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/redis/client.py\", line 559, in execute_command\n return self._execute_command(*args, **options)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/redis/client.py\", line 565, in _execute_command\n conn = self.connection or pool.get_connection(command_name, **options)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/redis/connection.py\", line 1417, in get_connection\n connection = self.make_connection()\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/redis/connection.py\", line 1463, in make_connection\n return self.connection_class(**self.connection_kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/redis/connection.py\", line 1013, in __init__\n super().__init__(**kwargs)\n File \"/usr/local/lib/python3.12/site-packages/redis/connection.py\", line 684, in __init__\n super().__init__(**kwargs)\nTypeError: AbstractConnection.__init__() got an unexpected keyword argument 'connection_pool'", "timestamp": "2025-04-11T08:47:09.997584+00:00"}
Below is my code for connecting with sentinel master node.
`def connect_to_redis(self):
The text was updated successfully, but these errors were encountered: