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

The method xgroup_create of the redis cluster client fails when running on redis version 7.0.0. #2165

Closed
jdavidagudelo opened this issue May 3, 2022 · 1 comment · Fixed by #2170

Comments

@jdavidagudelo
Copy link

Describe the bug

The method xgroup_create of the redis cluster client fails when running on redis version 7.0.0.
Using the version 4.2.2 of the python redis client, the python version is 3.10.4, OS is Ubuntu 22.04.

To reproduce


from redis import RedisCluster
from redis.cluster import ClusterNode

client = RedisCluster(
    startup_nodes=[
        ClusterNode("127.0.0.1", 7001),
        ClusterNode("127.0.0.1", 7002),
        ClusterNode("127.0.0.1", 7003),
        ClusterNode("127.0.0.1", 7004),
        ClusterNode("127.0.0.1", 7005),
    ]
)

client.xgroup_create("test", "test")

Expected behavior

The method should work just like it did when using the same client version with redis version 6.2.6.

Additional information

This is the output of the python stack trace.

File ~/.cache/pypoetry/virtualenvs/poetry_venv-py3.10/lib/python3.10/site-packages/redis/cluster.py:976, in RedisCluster.determine_slot(self, *args)File ~/.cache/pypoetry/virtualenvs/ubi.events-engine-94LnMkf1-py3.10/lib/python3.10/site-packages/redis/cluster.py:976, in RedisCluster.determine_slot(self, *args)
    974         if command in ("FCALL", "FCALL_RO"):
    975             return random.randrange(0, REDIS_CLUSTER_HASH_SLOTS)
--> 976         raise RedisClusterException(
    977             "No way to dispatch this command to Redis Cluster. "
    978             "Missing key.\nYou can execute the command by specifying "
    979             f"target nodes.\nCommand: {args}"
    980         )
    982 # single key command
    983 if len(keys) == 1:

RedisClusterException: No way to dispatch this command to Redis Cluster. Missing key.
You can execute the command by specifying target nodes.
Command: ('XGROUP CREATE', 'test', 'test', '$')
@dvora-h
Copy link
Collaborator

dvora-h commented May 8, 2022

@jdavidagudelo Thank you for reporting the issue! This was caused as a result of a change in command output in Redis 7 and fixed in #2170

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

Successfully merging a pull request may close this issue.

2 participants