redis/redis-py · error · ResponseError

The server doesn't support maintenance notifications

Error message

The server doesn't support maintenance notifications

What it means

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).

Source

Thrown at redis/asyncio/connection.py:417

            host = getattr(self, "host", None)
            if host is None:
                raise ValueError(
                    "Cannot enable maintenance notifications for connection"
                    " object that doesn't have a host attribute."
                )

            endpoint_type = maint_notifications_config.get_endpoint_type(host, self)
            await self.send_command(
                "CLIENT",
                "MAINT_NOTIFICATIONS",
                "ON",
                "moving-endpoint-type",
                endpoint_type.value,
                check_health=check_health,
            )
            response = await self.read_response()
            if not response or str_if_bytes(response) != "OK":
                raise ResponseError(
                    "The server doesn't support maintenance notifications"
                )
        except Exception as e:
            if (
                isinstance(e, ResponseError)
                and maint_notifications_config.enabled == "auto"
            ):
                # Log warning but don't fail the connection
                import logging

                logger = logging.getLogger(__name__)
                logger.debug(f"Failed to enable maintenance notifications: {e}")
            else:
                raise

    def get_resolved_ip(self) -> str | None:
        """
        Extract the resolved IP address from an established connection or host.

View on GitHub (pinned to da03cdc7e8)

Solutions

  1. Upgrade the Redis server to a version that supports CLIENT MAINT_NOTIFICATIONS.
  2. Set maint_notifications_config.enabled = 'auto' so a ResponseError is logged but does not fail the connection.
  3. Disable maintenance notifications entirely (enabled = False) if your server doesn't support them.

Example fix

// before
cfg = MaintNotificationsConfig(enabled=True)
client = Redis(url=..., protocol=3, maint_notifications_config=cfg)  # raises [93]
// after
cfg = MaintNotificationsConfig(enabled='auto')  # logs warning, keeps working
Defensive patterns

Strategy: fallback

Validate before calling

# Probe server support once, then decide
cfg = MaintNotificationsConfig(enabled='auto' if not server_supports else True)

Try / catch

from redis.exceptions import ResponseError
try:
    await client.ping()
except ResponseError as e:
    if "doesn't support maintenance notifications" in str(e):
        # set enabled='auto' or False, then reconnect

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of redis/redis-py@da03cdc7e8 (2026-08-04). Data as JSON: /data/errors/5e6d634934008344.json. Report an issue: GitHub.