{"record":{"id":"b2cecac4aae97084","repo":"redis/redis-py","slug":"maintenance-notifications-are-not-supported-for-co-b2ceca","errorCode":null,"errorMessage":"Maintenance notifications are not supported for connections without a host","messagePattern":"Maintenance notifications are not supported for connections without a host","errorType":"exception","errorClass":"RedisError","httpStatus":null,"severity":"error","filePath":"redis/asyncio/connection.py","lineNumber":1936,"sourceCode":"                            \"Maintenance notifications are not supported for \"\n                            \"Unix domain socket connections\"\n                        )\n\n                    # Custom connection classes must inherit the async maintenance\n                    # mixin so handlers can update connection state safely.\n                    if not self._maintenance_notifications_connection_class_supported():\n                        connection_class = getattr(self, \"connection_class\", None)\n                        connection_class_name = getattr(\n                            connection_class, \"__name__\", connection_class\n                        )\n                        raise RedisError(\n                            \"Maintenance notifications are not supported for \"\n                            f\"connection class {connection_class_name}\"\n                        )\n\n                    # TCP-like connections still need a host to identify the\n                    # endpoint that can move during maintenance.\n                    raise RedisError(\n                        \"Maintenance notifications are not supported for connections \"\n                        \"without a host\"\n                    )\n                self._maint_notifications_pool_handler = None\n                self._oss_cluster_maint_notifications_handler = None\n                return\n\n            if not is_protocol_supported:\n                raise RedisError(\n                    \"Maintenance notifications handlers on connection are only supported with RESP version 3\"\n                )\n\n            if oss_cluster_maint_notifications_handler:\n                self._oss_cluster_maint_notifications_handler = (\n                    oss_cluster_maint_notifications_handler\n                )\n                self._update_connection_kwargs_for_maint_notifications(\n                    oss_cluster_maint_notifications_handler=self._oss_cluster_maint_notifications_handler","sourceCodeStart":1918,"sourceCodeEnd":1954,"githubUrl":"https://github.com/redis/redis-py/blob/6a6b581b48225afa0b76912d1028c6035baee932/redis/asyncio/connection.py#L1918-L1954","documentation":"Raised as RedisError from the maintenance-notifications pool mixin when notifications are explicitly enabled and the connection is supported (not UDS, supported class) but the connection_kwargs lack a 'host'. The feature needs a host to identify the endpoint that can move during maintenance; without one (e.g. a connection class that does not record host) the configuration is rejected.","triggerScenarios":"Constructing a pool with maint_notifications_config.enabled=True where connection_kwargs has no 'host' key (a TCP-like class that was instantiated without host, or a custom class that does not propagate host into kwargs). This is the fallthrough branch after the UDS and class checks.","commonSituations":"Custom connection that accepts a non-host address form (e.g. abstract socket, dialer URI) but is not classified as UDS; misconfigured factory that strips host from kwargs; enabling the feature on a pool whose connection was built from positional args without host.","solutions":["Pass host=<value> explicitly in connection_kwargs so the endpoint can be identified.","If your connection genuinely has no host, disable maintenance notifications.","Ensure custom connection classes propagate host into the kwargs the pool sees."],"exampleFix":"// before\npool = ConnectionPool(connection_class=TCPConn, port=6379, maint_notifications_config=MaintNotificationsConfig(enabled=True))\n// after\npool = ConnectionPool(connection_class=TCPConn, host='redis.local', port=6379, maint_notifications_config=MaintNotificationsConfig(enabled=True))","handlingStrategy":"validation","validationCode":"def kwargs_have_host(connection_kwargs: dict) -> bool:\n    return bool(connection_kwargs.get('host'))","typeGuard":"from redis.exceptions import RedisError\n\ndef is_no_host_maint_error(exc: BaseException) -> bool:\n    return isinstance(exc, RedisError) and 'without a host' in str(exc).lower()","tryCatchPattern":"from redis.exceptions import RedisError\n\ntry:\n    pool = ConnectionPool(connection_class=cls, **kw, maint_notifications_config=cfg)\nexcept RedisError as e:\n    if 'without a host' in str(e):\n        kw.setdefault('host', default_host)\n        pool = ConnectionPool(connection_class=cls, **kw, maint_notifications_config=cfg)\n    else:\n        raise","preventionTips":["Always pass host=<value> in connection_kwargs when enabling maintenance notifications.","Ensure custom connection classes propagate host into the pool-visible kwargs.","Disable the feature if the connection genuinely has no host endpoint."],"tags":["maintenance-notifications","host","config","validation","async","pool"],"backgroundTag":null,"analyzedSha":"6a6b581b48225afa0b76912d1028c6035baee932","analyzedAt":"2026-08-10T12:52:44.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}