{"id":"ad5c265632ad8510","repo":"redis/redis-py","slug":"rediscluster-does-not-currently-support-unix-domai","errorCode":null,"errorMessage":"RedisCluster does not currently support Unix Domain Socket connections","messagePattern":"RedisCluster does not currently support Unix Domain Socket connections","errorType":"exception","errorClass":"RedisClusterException","httpStatus":null,"severity":"error","filePath":"redis/cluster.py","lineNumber":836,"sourceCode":"                \"Argument 'db' is not possible to use in cluster mode\"\n            )\n\n        if \"retry\" in kwargs:\n            # Argument 'retry' is not possible to be used in kwargs when in cluster mode\n            # the kwargs are set to the lower level connections to the cluster nodes\n            # and there we provide retry configuration without retries allowed.\n            # The retries should be handled on cluster client level.\n            raise RedisClusterException(\n                \"The 'retry' argument cannot be used in kwargs when running in cluster mode.\"\n            )\n\n        # Get the startup node/s\n        from_url = False\n        if url is not None:\n            from_url = True\n            url_options = parse_url(url)\n            if \"path\" in url_options:\n                raise RedisClusterException(\n                    \"RedisCluster does not currently support Unix Domain \"\n                    \"Socket connections\"\n                )\n            if \"db\" in url_options and url_options[\"db\"] != 0:\n                # Argument 'db' is not possible to use in cluster mode\n                raise RedisClusterException(\n                    \"A ``db`` querystring option can only be 0 in cluster mode\"\n                )\n            kwargs.update(url_options)\n            host = kwargs.get(\"host\")\n            port = kwargs.get(\"port\", port)\n            startup_nodes.append(ClusterNode(host, port))\n        elif host is not None and port is not None:\n            startup_nodes.append(ClusterNode(host, port))\n        elif len(startup_nodes) == 0:\n            # No startup node was provided\n            raise RedisClusterException(\n                \"RedisCluster requires at least one node to discover the \"","sourceCodeStart":818,"sourceCodeEnd":854,"githubUrl":"https://github.com/redis/redis-py/blob/da03cdc7e8731092b13e395605c3c1fb2de25de1/redis/cluster.py#L818-L854","documentation":"Raised in `RedisCluster.__init__` when the URL passed to the constructor contains a `path` component, indicating a Unix Domain Socket address. The cluster client does not implement UDS-based node topology/discovery, so a UDS URL is rejected upfront with RedisClusterException rather than failing opaquely later.","triggerScenarios":"Calling `RedisCluster.from_url('unix:///path/to/redis.sock')` or `RedisCluster(url='unix://...')`. The URL parser populates `url_options['path']` and the constructor raises.","commonSituations":"Reusing a standalone Redis UDS connection string for a cluster deployment; local dev with Redis-over-UDS attempting to add clustering.","solutions":["Use a TCP URL/host for RedisCluster: `RedisCluster(host='localhost', port=7000)`.","If you only need a single local Redis over UDS, use the standalone `redis.Redis.from_url('unix://...')` instead of RedisCluster.","Run a real cluster topology (3+ nodes) reachable over TCP."],"exampleFix":"# before\nrc = RedisCluster.from_url('unix:///var/run/redis/redis.sock')  # raises\n\n# after\nrc = redis.Redis.from_url('unix:///var/run/redis/redis.sock')  # standalone","handlingStrategy":"validation","validationCode":"from urllib.parse import urlparse\nu = urlparse(url)\nif u.scheme.startswith('unix') or u.path:\n    raise ValueError('RedisCluster does not support Unix Domain Sockets; use TCP')","typeGuard":"def is_tcp_url(url: str) -> bool:\n    return url.startswith('redis://') or url.startswith('rediss://')","tryCatchPattern":null,"preventionTips":["Use TCP addresses for RedisCluster.","Use standalone redis.Redis for UDS connections."],"tags":["cluster","config","unix-socket","initialization"],"analyzedSha":"da03cdc7e8731092b13e395605c3c1fb2de25de1","analyzedAt":"2026-08-04T20:26:47.563Z","schemaVersion":2}