{"record":{"id":"5e6d634934008344","repo":"redis/redis-py","slug":"the-server-doesn-t-support-maintenance-notificatio","errorCode":null,"errorMessage":"The server doesn't support maintenance notifications","messagePattern":"The server doesn't support maintenance notifications","errorType":"exception","errorClass":"ResponseError","httpStatus":null,"severity":"error","filePath":"redis/asyncio/connection.py","lineNumber":417,"sourceCode":"            host = getattr(self, \"host\", None)\n            if host is None:\n                raise ValueError(\n                    \"Cannot enable maintenance notifications for connection\"\n                    \" object that doesn't have a host attribute.\"\n                )\n\n            endpoint_type = maint_notifications_config.get_endpoint_type(host, self)\n            await self.send_command(\n                \"CLIENT\",\n                \"MAINT_NOTIFICATIONS\",\n                \"ON\",\n                \"moving-endpoint-type\",\n                endpoint_type.value,\n                check_health=check_health,\n            )\n            response = await self.read_response()\n            if not response or str_if_bytes(response) != \"OK\":\n                raise ResponseError(\n                    \"The server doesn't support maintenance notifications\"\n                )\n        except Exception as e:\n            if (\n                isinstance(e, ResponseError)\n                and maint_notifications_config.enabled == \"auto\"\n            ):\n                # Log warning but don't fail the connection\n                import logging\n\n                logger = logging.getLogger(__name__)\n                logger.debug(f\"Failed to enable maintenance notifications: {e}\")\n            else:\n                raise\n\n    def get_resolved_ip(self) -> str | None:\n        \"\"\"\n        Extract the resolved IP address from an established connection or host.","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/redis/redis-py/blob/6a6b581b48225afa0b76912d1028c6035baee932/redis/asyncio/connection.py#L399-L435","documentation":"ResponseError from Connection._enable_maintenance_notifications (redis/asyncio/connection.py:417) raised when CLIENT MAINT_NOTIFICATIONS ON does not return OK. The connected Redis server does not implement the MAINT_NOTIFICATIONS subcommand - typically an older Redis version, a non-cluster deployment, or a managed Redis that disables it. Note: when enabled=='auto', this is caught and logged, not raised.","triggerScenarios":"Connecting to Redis < the version that supports MAINT_NOTIFICATIONS, or a standalone (non-OSS-cluster) Redis; enabling the feature on a server that rejects the command.","commonSituations":"Pointing a maintenance-notifications-enabled client at a local dev Redis, Redis Stack, or a managed Redis without the command; version drift between client config and server.","solutions":["Set maint_notifications_config.enabled='auto' so unsupported servers log and continue","Upgrade the Redis server to a build that supports CLIENT MAINT_NOTIFICATIONS","Disable maintenance notifications if your topology does not need them"],"exampleFix":"// before\nRedis(maint_notifications_config=Config(enabled=True))\n// after\nRedis(maint_notifications_config=Config(enabled='auto'))","handlingStrategy":"fallback","validationCode":"# set enabled='auto' so unsupported servers log instead of raising\nconfig = MaintNotificationsConfig(enabled='auto')","typeGuard":null,"tryCatchPattern":"try:\n    await client.connect()\nexcept ResponseError as e:\n    if 'maintenance notifications' in str(e).lower():\n        # server lacks support; retry with notifications disabled","preventionTips":["Use enabled='auto' in mixed server-version environments","Confirm the server supports CLIENT MAINT_NOTIFICATIONS before enabling"],"tags":["async","connection","maintenance-notifications","server-version","compatibility"],"backgroundTag":null,"analyzedSha":"6a6b581b48225afa0b76912d1028c6035baee932","analyzedAt":"2026-08-10T12:52:44.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}