redis/redis-py · warning · ResponseError

The server doesn't support maintenance notifications

Error message

The server doesn't support maintenance notifications

What it means

Raised as a ResponseError when the CLIENT MAINT_NOTIFICATIONS ON command returns anything other than 'OK', meaning the connected Redis server does not support maintenance notifications (an enterprise/Cloud moving-endpoint feature). When the config's enabled mode is 'auto', the error is swallowed and only logged at debug level; in any other mode it propagates and fails the connection.

Source

Thrown at redis/connection.py:655

            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."
                )
            else:
                endpoint_type = maint_notifications_config.get_endpoint_type(host, self)
                self.send_command(
                    "CLIENT",
                    "MAINT_NOTIFICATIONS",
                    "ON",
                    "moving-endpoint-type",
                    endpoint_type.value,
                    check_health=check_health,
                )
                response = 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) -> Optional[str]:
        """
        Extract the resolved IP address from an

View on GitHub (pinned to da03cdc7e8)

Solutions

  1. Set maint_notifications_config.enabled = 'auto' so unsupported servers degrade gracefully instead of failing the connection.
  2. Disable maintenance notifications entirely when targeting OSS Redis.
  3. Connect to a Redis deployment that supports maintenance notifications (Redis Cloud/Enterprise).

Example fix

// before
cfg = MaintNotificationsConfig(enabled=True)
client = redis.Redis(host=h, maint_notifications_config=cfg)
// after
cfg = MaintNotificationsConfig(enabled='auto')
client = redis.Redis(host=h, maint_notifications_config=cfg)
Defensive patterns

Strategy: fallback

Validate before calling

# before connecting, decide whether the target supports maintenance notifications
from redis.maint_notifications import MaintNotificationsConfig
cfg = MaintNotificationsConfig(enabled='auto')  # degrades gracefully on unsupported servers

Try / catch

from redis.exceptions import ResponseError
try:
    client.ping()
except ResponseError as e:
    if 'maintenance notifications' in str(e):
        # server lacks support; reconnect with maint disabled or enabled='auto'
        pass

Prevention

When it happens

Trigger: Connecting with maint_notifications_config.enabled (not 'auto') to a Redis server (e.g. open-source Redis) that does not understand CLIENT MAINT_NOTIFICATIONS. The on_connect path calls _enable_maintenance_notifications, sends the command, and the server returns an error or non-OK reply.

Common situations: Pointing a client configured for Redis Cloud / Enterprise maintenance notifications at a plain OSS Redis instance; version mismatch where the server predates the feature; typo in the config causing enabled to be a truthy non-'auto' value.

Related errors


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