{"id":"1a8ce98011070c9d","repo":"redis/redis-py","slug":"unix-domain-socket-is-not-supported-in-cluster-mod","errorCode":null,"errorMessage":"Unix domain socket is not supported in cluster mode","messagePattern":"Unix domain socket is not supported in cluster mode","errorType":"exception","errorClass":"RedisClusterException","httpStatus":null,"severity":"error","filePath":"redis/asyncio/cluster.py","lineNumber":466,"sourceCode":"        ssl_certfile: str | None = None,\n        ssl_check_hostname: bool = True,\n        ssl_keyfile: str | None = None,\n        ssl_min_version: \"TLSVersion | None\" = None,\n        ssl_ciphers: str | None = None,\n        protocol: int | None = None,\n        legacy_responses: bool = True,\n        address_remap: Callable[[Tuple[str, int]], Tuple[str, int]] | None = None,\n        event_dispatcher: EventDispatcher | None = None,\n        policy_resolver: AsyncPolicyResolver = AsyncStaticPolicyResolver(),\n        maint_notifications_config: MaintNotificationsConfig | None = None,\n    ) -> None:\n        if db:\n            raise RedisClusterException(\n                \"Argument 'db' must be 0 or None in cluster mode\"\n            )\n\n        if path:\n            raise RedisClusterException(\n                \"Unix domain socket is not supported in cluster mode\"\n            )\n\n        if (not host or not port) and not startup_nodes:\n            raise RedisClusterException(\n                \"RedisCluster requires at least one node to discover the cluster.\\n\"\n                \"Please provide one of the following or use RedisCluster.from_url:\\n\"\n                '   - host and port: RedisCluster(host=\"localhost\", port=6379)\\n'\n                \"   - startup_nodes: RedisCluster(startup_nodes=[\"\n                'ClusterNode(\"localhost\", 6379), ClusterNode(\"localhost\", 6380)])'\n            )\n\n        computed_driver_info = resolve_driver_info(driver_info, lib_name, lib_version)\n\n        kwargs: Dict[str, Any] = {\n            \"max_connections\": max_connections,\n            \"connection_class\": Connection,\n            # Client related kwargs","sourceCodeStart":448,"sourceCodeEnd":484,"githubUrl":"https://github.com/redis/redis-py/blob/da03cdc7e8731092b13e395605c3c1fb2de25de1/redis/asyncio/cluster.py#L448-L484","documentation":"Raised by RedisCluster.__init__ (redis/asyncio/cluster.py:466) when a `path` (Unix domain socket) argument is provided. Cluster routing relies on host:port endpoints discovered via CLUSTER NODES/SLOTS, and UDS endpoints do not fit that discovery model, so the async cluster client rejects them at construction with RedisClusterException.","triggerScenarios":"Constructing RedisCluster(path='/var/run/redis/redis.sock', ...). The `if path:` guard fires right after the db check.","commonSituations":"Porting a standalone client that connected over a Unix socket to a cluster topology; local-dev setups that prefer UDS for performance.","solutions":["Connect over TCP (host + port) for cluster mode.","If a UDS front-end exists, put it behind a TCP proxy/sidecar and point the cluster client at the TCP endpoint.","Use the standalone redis.asyncio.Redis (not RedisCluster) for single-node UDS access."],"exampleFix":"// before\nc = RedisCluster(path='/var/run/redis/redis.sock')\n// after\nc = RedisCluster(host='localhost', port=16379)","handlingStrategy":"validation","validationCode":"if path:\n    raise ValueError('RedisCluster does not support Unix domain sockets; use TCP')\nc = RedisCluster(host=host, port=port)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use TCP host:port for cluster connections.","If a UDS is mandatory, front it with a TCP proxy.","Use redis.asyncio.Redis for single-node UDS access."],"tags":["redis","asyncio","cluster","configuration","unix-socket"],"analyzedSha":"da03cdc7e8731092b13e395605c3c1fb2de25de1","analyzedAt":"2026-08-04T20:26:47.563Z","schemaVersion":2}