{"record":{"id":"004f4c5667bdc0f2","repo":"redis/redis-py","slug":"maintenance-notifications-are-only-supported-with-004f4c","errorCode":null,"errorMessage":"Maintenance notifications are only supported with hiredis and RESP3 parsers!","messagePattern":"Maintenance notifications are only supported with hiredis and RESP3 parsers!","errorType":"exception","errorClass":"RedisError","httpStatus":null,"severity":"error","filePath":"redis/asyncio/connection.py","lineNumber":194,"sourceCode":"        self._processed_start_maint_notifications: set[int] = set()\n        self._skipped_end_maint_notifications: set[int] = set()\n        self._configure_maintenance_notifications(\n            maint_notifications_pool_handler,\n            orig_host_address,\n            orig_socket_timeout,\n            orig_socket_connect_timeout,\n            oss_cluster_maint_notifications_handler,\n            parser,\n        )\n\n    @abstractmethod\n    def _get_parser(self) -> BaseParser:\n        pass\n\n    def _get_push_notifications_parser(self) -> AsyncPushNotificationsParser:\n        parser = self._get_parser()\n        if not isinstance(parser, (_AsyncHiredisParser, _AsyncRESP3Parser)):\n            raise RedisError(\n                \"Maintenance notifications are only supported with hiredis and RESP3 parsers!\"\n            )\n        return parser\n\n    @abstractmethod\n    def get_protocol(self):\n        pass\n\n    @abstractmethod\n    async def send_command(self, *args: Any, **kwargs: Any) -> None:\n        pass\n\n    @abstractmethod\n    async def read_response(\n        self,\n        disable_decoding: bool = False,\n        timeout: float | None = None,\n        *,","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/redis/redis-py/blob/6a6b581b48225afa0b76912d1028c6035baee932/redis/asyncio/connection.py#L176-L212","documentation":"RedisError from AbstractConnection._get_push_notifications_parser (redis/asyncio/connection.py:191) when the active parser is neither _AsyncHiredisParser nor _AsyncRESP3Parser. Maintenance notifications arrive over the RESP3 push protocol, which only the hiredis and RESP3 parsers can decode. Enabling them under the RESP2 Python parser is unsupported.","triggerScenarios":"Constructing an async connection with protocol=2 (RESP2) and maintenance_notifications enabled, or forcing the RESP2 Python parser while maint notifications are on.","commonSituations":"Forcing protocol=2 for compatibility while also requesting OSS cluster maintenance notifications; misconfigured connection pool used by a multidb/maintenance setup.","solutions":["Use protocol=3 (RESP3) so push notifications are decoded","Install and use hiredis (parser=_AsyncHiredisParser) which supports push notifications on both protocols","Disable maintenance notifications if RESP2 with the Python parser is required"],"exampleFix":"// before\nRedis(protocol=2, maint_notifications_config=...)\n// after\nRedis(protocol=3, maint_notifications_config=...)\n# or install hiredis and keep protocol default","handlingStrategy":"validation","validationCode":"if maint_enabled and protocol == 2 and not hiredis_available:\n    raise ValueError('maintenance notifications need RESP3 or hiredis')","typeGuard":null,"tryCatchPattern":"try:\n    client = Redis(protocol=2, maint_notifications_config=cfg)\nexcept RedisError as e:\n    if 'Maintenance notifications' in str(e):\n        client = Redis(protocol=3, maint_notifications_config=cfg)","preventionTips":["Use protocol=3 when enabling maintenance notifications","Install hiredis so both protocols support push notifications"],"tags":["async","connection","resp3","maintenance-notifications","parser"],"backgroundTag":null,"analyzedSha":"6a6b581b48225afa0b76912d1028c6035baee932","analyzedAt":"2026-08-10T12:52:44.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}