{"record":{"id":"7a4d222a1bf1d549","repo":"redis/redis-py","slug":"maintenance-notifications-are-only-supported-with-7a4d22","errorCode":null,"errorMessage":"Maintenance notifications are only supported with RESP version 3","messagePattern":"Maintenance notifications are only supported with RESP version 3","errorType":"exception","errorClass":"RedisError","httpStatus":null,"severity":"error","filePath":"redis/cluster.py","lineNumber":894,"sourceCode":"                ),\n                retries=cluster_error_retry_attempts,\n            )\n\n        self.encoder = Encoder(\n            kwargs.get(\"encoding\", \"utf-8\"),\n            kwargs.get(\"encoding_errors\", \"strict\"),\n            kwargs.get(\"decode_responses\", False),\n        )\n        protocol = kwargs.get(\"protocol\", None)\n        if (cache_config or cache) and not check_protocol_version(protocol, 3):\n            raise RedisError(\"Client caching is only supported with RESP version 3\")\n\n        if (\n            maint_notifications_config\n            and maint_notifications_config.enabled\n            and not check_protocol_version(protocol, 3)\n        ):\n            raise RedisError(\n                \"Maintenance notifications are only supported with RESP version 3\"\n            )\n        if check_protocol_version(protocol, 3) and maint_notifications_config is None:\n            maint_notifications_config = MaintNotificationsConfig()\n\n        # Build the client-level HIMPORT registry once (always empty at construction)\n        # and share the same object with every node pool, so the fieldset registry is\n        # shared cluster-wide and runtime himport_prepare mutates one object. It is\n        # handed to the NodesManager and injected onto each node's pool in\n        # create_redis_node; it is deliberately NOT forwarded through connection_kwargs,\n        # so nodes reuse the one shared object rather than each rebuilding their own.\n        self._himport_registry = HImportRegistry()\n\n        self.command_flags = self.__class__.COMMAND_FLAGS.copy()\n        self.node_flags = self.__class__.NODE_FLAGS.copy()\n        self.read_from_replicas = read_from_replicas\n        self.load_balancing_strategy = load_balancing_strategy\n        self.reinitialize_counter = 0","sourceCodeStart":876,"sourceCodeEnd":912,"githubUrl":"https://github.com/redis/redis-py/blob/6a6b581b48225afa0b76912d1028c6035baee932/redis/cluster.py#L876-L912","documentation":"Raised by RedisCluster.__init__ when maintenance notifications (maint_notifications_config with enabled=True) are requested but the protocol is not RESP3. Maintenance notifications are delivered as RESP3 push messages, so enabling them requires negotiating RESP3. The guard is at cluster.py:894.","triggerScenarios":"RedisCluster(host=..., maint_notifications_config=MaintNotificationsConfig(enabled=True)) without protocol=3.","commonSituations":"Turning on maintenance-notification handling for managed Redis (Redis Cloud) without switching the wire protocol; inheriting a config object whose enabled flag defaults True; deploying to an environment where RESP3 is disabled by a proxy.","solutions":["Set protocol=3 when enabling maintenance notifications: RedisCluster(host=..., protocol=3, maint_notifications_config=...).","Ensure the endpoint/proxy actually supports RESP3 (some older proxies downgrade).","Leave maint_notifications_config disabled (or None) if you cannot use RESP3."],"exampleFix":"// before\ncfg = MaintNotificationsConfig(enabled=True)\nclient = RedisCluster(host='localhost', port=7000, maint_notifications_config=cfg)  # RedisError\n\n// after\ncfg = MaintNotificationsConfig(enabled=True)\nclient = RedisCluster(host='localhost', port=7000, protocol=3, maint_notifications_config=cfg)","handlingStrategy":"validation","validationCode":"from redis._parsers.helpers import check_protocol_version\nprotocol = kwargs.get('protocol')\nif maint_notifications_config and maint_notifications_config.enabled and not check_protocol_version(protocol, 3):\n    kwargs['protocol'] = 3\nclient = RedisCluster(host='localhost', port=7000, protocol=kwargs.get('protocol', 3), maint_notifications_config=maint_notifications_config)","typeGuard":"def maint_notifications_resp3_compatible(kwargs, cfg) -> bool:\n    from redis._parsers.helpers import check_protocol_version\n    return not (cfg and cfg.enabled) or check_protocol_version(kwargs.get('protocol'), 3)","tryCatchPattern":"from redis.exceptions import RedisError\ntry:\n    client = RedisCluster(host='localhost', port=7000, maint_notifications_config=cfg)\nexcept RedisError as e:\n    if 'RESP version 3' in str(e):\n        client = RedisCluster(host='localhost', port=7000, protocol=3, maint_notifications_config=cfg)\n    else:\n        raise","preventionTips":["Set protocol=3 when enabling maintenance notifications.","Confirm your endpoint/proxy supports RESP3 before relying on push messages.","Leave maint_notifications_config disabled if RESP3 is unavailable."],"tags":["cluster","config","resp3","maintenance-notifications"],"backgroundTag":null,"analyzedSha":"6a6b581b48225afa0b76912d1028c6035baee932","analyzedAt":"2026-08-10T12:52:44.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}