{"record":{"id":"70f6b7327fc6d5ad","repo":"redis/redis-py","slug":"maintenance-notifications-handlers-on-connection-a-70f6b7","errorCode":null,"errorMessage":"Maintenance notifications handlers on connection are only supported with RESP version 3","messagePattern":"Maintenance notifications handlers on connection are only supported with RESP version 3","errorType":"exception","errorClass":"RedisError","httpStatus":null,"severity":"error","filePath":"redis/asyncio/connection.py","lineNumber":1945,"sourceCode":"                            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\n                )\n                self._maint_notifications_pool_handler = None\n            else:\n                self._oss_cluster_maint_notifications_handler = None\n                self._maint_notifications_pool_handler = (\n                    AsyncMaintNotificationsPoolHandler(self, maint_notifications_config)\n                )\n                self._update_connection_kwargs_for_maint_notifications(\n                    maint_notifications_pool_handler=self._maint_notifications_pool_handler","sourceCodeStart":1927,"sourceCodeEnd":1963,"githubUrl":"https://github.com/redis/redis-py/blob/6a6b581b48225afa0b76912d1028c6035baee932/redis/asyncio/connection.py#L1927-L1963","documentation":"Maintenance notifications rely on the server's CLIENT MAINT_NOTIFICATIONS push mechanism, which only exists over the RESP3 wire protocol. The async connection pool raises RedisError when maintenance notifications are explicitly enabled (or an enabled config is passed) while the connection resolves to a non-RESP3 protocol (e.g. protocol=2). The default auto-enable is skipped entirely on RESP2, so this only fires when the user insists on enabling notifications on a RESP2 connection.","triggerScenarios":"Constructing an async client/ConnectionPool (or calling update_maint_notifications_config) with both a maint_notifications_config whose enabled=True AND protocol=2; or RESP2 set while explicitly passing an enabled MaintNotificationsConfig. The check at redis/asyncio/connection.py:1944 (is_protocol_supported == False) fires only after the connection-support checks pass.","commonSituations":"Downgrading to protocol=2 to get RESP2-style response shapes while keeping maintenance notifications on; copy-pasting a RESP3 notifications config into a RESP2 client; targeting a Redis server older than 7.x that has no RESP3 support.","solutions":["Set protocol=3 (or omit protocol to use the RESP3 default) so the server can push maintenance notifications.","If you must stay on RESP2, do not pass an enabled maint_notifications_config.","Upgrade the Redis server to a version that supports RESP3 (>=7.x)."],"exampleFix":"# before\npool = ConnectionPool(host='redis.local', protocol=2,\n                    maint_notifications_config=MaintNotificationsConfig(enabled=True))\n# after\npool = ConnectionPool(host='redis.local', protocol=3,\n                    maint_notifications_config=MaintNotificationsConfig(enabled=True))","handlingStrategy":"validation","validationCode":"from redis.utils import check_protocol_version\nif enabled_maint and not check_protocol_version(protocol, 3):\n    raise ConfigError('Maintenance notifications require RESP3; set protocol=3 or disable them.')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Centralise client construction so protocol and maint_notifications_config are validated together.","Treat protocol=2 and maintenance notifications as mutually exclusive in config checks."],"tags":["config","resp3","maintenance-notifications","async"],"backgroundTag":null,"analyzedSha":"6a6b581b48225afa0b76912d1028c6035baee932","analyzedAt":"2026-08-10T12:52:44.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}