{"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/da03cdc7e8731092b13e395605c3c1fb2de25de1/redis/asyncio/connection.py#L399-L435","documentation":"Raised as ResponseError in _enable_maintenance_notifications when the server's reply to CLIENT MAINT_NOTIFICATIONS ON is not 'OK'. It signals that the connected Redis does not implement the MAINT_NOTIFICATIONS subcommand (older server, or a build without it).","triggerScenarios":"Connecting with maintenance notifications enabled (and protocol=3) to a Redis server that predates or does not support CLIENT MAINT_NOTIFICATIONS; pointing the client at a Redis version < the one that introduced the feature.","commonSituations":"Local dev against an older Redis (e.g. 6.x or a stripped build); a managed Redis that disables the subcommand; CI images that lag the production server version.","solutions":["Upgrade the Redis server to a version that supports CLIENT MAINT_NOTIFICATIONS.","Set maint_notifications_config.enabled = 'auto' so a ResponseError is logged but does not fail the connection.","Disable maintenance notifications entirely (enabled = False) if your server doesn't support them."],"exampleFix":"// before\ncfg = MaintNotificationsConfig(enabled=True)\nclient = Redis(url=..., protocol=3, maint_notifications_config=cfg)  # raises [93]\n// after\ncfg = MaintNotificationsConfig(enabled='auto')  # logs warning, keeps working","handlingStrategy":"fallback","validationCode":"# Probe server support once, then decide\ncfg = MaintNotificationsConfig(enabled='auto' if not server_supports else True)","typeGuard":null,"tryCatchPattern":"from redis.exceptions import ResponseError\ntry:\n    await client.ping()\nexcept ResponseError as e:\n    if \"doesn't support maintenance notifications\" in str(e):\n        # set enabled='auto' or False, then reconnect","preventionTips":["Use enabled='auto' against mixed-version Redis fleets.","Verify server version supports CLIENT MAINT_NOTIFICATIONS before enabling."],"tags":["connection","maintenance-notifications","server-version","compatibility"],"analyzedSha":"da03cdc7e8731092b13e395605c3c1fb2de25de1","analyzedAt":"2026-08-04T20:26:47.563Z","schemaVersion":2}