{"action":"closed","issue":{"url":"https://api.github.com/repos/Grokzen/redis-py-cluster/issues/217","repository_url":"https://api.github.com/repos/Grokzen/redis-py-cluster","labels_url":"https://api.github.com/repos/Grokzen/redis-py-cluster/issues/217/labels{/name}","comments_url":"https://api.github.com/repos/Grokzen/redis-py-cluster/issues/217/comments","events_url":"https://api.github.com/repos/Grokzen/redis-py-cluster/issues/217/events","html_url":"https://github.com/Grokzen/redis-py-cluster/issues/217","id":257377434,"number":217,"title":"Cluster Nodes raising `ValueError` with Redis 4.0.1","user":{"login":"AngusP","id":1328814,"avatar_url":"https://avatars1.githubusercontent.com/u/1328814?v=4","gravatar_id":"","url":"https://api.github.com/users/AngusP","html_url":"https://github.com/AngusP","followers_url":"https://api.github.com/users/AngusP/followers","following_url":"https://api.github.com/users/AngusP/following{/other_user}","gists_url":"https://api.github.com/users/AngusP/gists{/gist_id}","starred_url":"https://api.github.com/users/AngusP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AngusP/subscriptions","organizations_url":"https://api.github.com/users/AngusP/orgs","repos_url":"https://api.github.com/users/AngusP/repos","events_url":"https://api.github.com/users/AngusP/events{/privacy}","received_events_url":"https://api.github.com/users/AngusP/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-09-13T13:18:54Z","updated_at":"2018-03-03T19:21:15Z","closed_at":"2018-03-03T19:21:15Z","author_association":"CONTRIBUTOR","body":"`StrictRedisCluster instance.cluster_nodes()` now gives:\r\n\r\n```\r\n>>> r.cluster_nodes()\r\n\r\n---------------------------------------------------------------------------\r\nValueError                                Traceback (most recent call last)\r\n<ipython-input-9-af3a2ae28b27> in <module>()\r\n----> 1 r.cluster_nodes()\r\n\r\n/rediscluster/client.py in cluster_nodes(self)\r\n    510         Sends to random node in the cluster\r\n    511         \"\"\"\r\n--> 512         return self.execute_command('CLUSTER NODES')\r\n    513 \r\n    514     def cluster_replicate(self, target_node_id):\r\n\r\n/rediscluster/utils.py in inner(*args, **kwargs)\r\n     99         for _ in range(0, 3):\r\n    100             try:\r\n--> 101                 return func(*args, **kwargs)\r\n    102             except ClusterDownError:\r\n    103                 # Try again with the new cluster setup. All other errors\r\n\r\n/rediscluster/client.py in execute_command(self, *args, **kwargs)\r\n    317         node = self.determine_node(*args, **kwargs)\r\n    318         if node:\r\n--> 319             return self._execute_command_on_nodes(node, *args, **kwargs)\r\n    320 \r\n    321         # If set externally we must update it before calling any commands\r\n\r\n/rediscluster/client.py in _execute_command_on_nodes(self, nodes, *args, **kwargs)\r\n    401             try:\r\n    402                 connection.send_command(*args)\r\n--> 403                 res[node[\"name\"]] = self.parse_response(connection, command, **kwargs)\r\n    404             except (ConnectionError, TimeoutError) as e:\r\n    405                 connection.disconnect()\r\n\r\n/redis/client.py in parse_response(self, connection, command_name, **options)\r\n    680         response = connection.read_response()\r\n    681         if command_name in self.response_callbacks:\r\n--> 682             return self.response_callbacks[command_name](response, **options)\r\n    683         return response\r\n    684 \r\n\r\n/rediscluster/utils.py in parse_cluster_nodes(resp, **options)\r\n    188             'id': self_id,\r\n    189             'host': host or current_host,\r\n--> 190             'port': int(port),\r\n    191             'flags': tuple(flags.split(',')),\r\n    192             'master': master_id if master_id != '-' else None,\r\n\r\nValueError: invalid literal for int() with base 10: '6379@16379'\r\n```\r\n\r\nThis looks like it's simply because `CLUSTER NODES` is now annotated with both the Redis client port and the Cluster bus port, delimited with a `@` which is obviously not an `int`.\r\n\r\n`redis-cli` output (With hashes truncated for readability):\r\n\r\n```\r\n`27.0.0.1:6379> cluster nodes\r\nc92...6b5 127.0.0.1:6383@16383 slave 9c4...802 0 1505308633000 5 connected\r\ndbc...3c3 127.0.0.1:6379@16379 myself,master - 0 1505308633000 1 connected 0-5460\r\nd42...573 127.0.0.1:6382@16382 slave dbc...3c3 0 1505308633090 4 connected\r\n615...da3 127.0.0.1:6381@16381 master - 0 1505308633291 3 connected 10923-16383\r\n9c4...802 127.0.0.1:6380@16380 master - 0 1505308633492 2 connected 5461-10922\r\n33c...f92 127.0.0.1:6384@16384 slave 615...da3 0 1505308633090 6 connected\r\n```\r\n\r\nI'll PR a fix soonish when I can get around to it at work, so I thought I'd issue first."}}
{"actor":{"display_login":"Grokzen"}}