redis/redis-py · error · ResponseError

The server doesn't support maintenance notifications

Error message

The server doesn't support maintenance notifications

What it means

ResponseError from Connection._enable_maintenance_notifications (redis/asyncio/connection.py:417) raised when CLIENT MAINT_NOTIFICATIONS ON does not return OK. The connected Redis server does not implement the MAINT_NOTIFICATIONS subcommand - typically an older Redis version, a non-cluster deployment, or a managed Redis that disables it. Note: when enabled=='auto', this is caught and logged, not raised.

Solutions

  1. Set maint_notifications_config.enabled='auto' so unsupported servers log and continue
  2. Upgrade the Redis server to a build that supports CLIENT MAINT_NOTIFICATIONS
  3. Disable maintenance notifications if your topology does not need them

Example fix

// before
Redis(maint_notifications_config=Config(enabled=True))
// after
Redis(maint_notifications_config=Config(enabled='auto'))
Defensive patterns

Strategy: fallback

Validate before calling

# set enabled='auto' so unsupported servers log instead of raising
config = MaintNotificationsConfig(enabled='auto')

Try / catch

try:
    await client.connect()
except ResponseError as e:
    if 'maintenance notifications' in str(e).lower():
        # server lacks support; retry with notifications disabled

Prevention

When it happens

Trigger: Connecting to Redis < the version that supports MAINT_NOTIFICATIONS, or a standalone (non-OSS-cluster) Redis; enabling the feature on a server that rejects the command.

Common situations: Pointing a maintenance-notifications-enabled client at a local dev Redis, Redis Stack, or a managed Redis without the command; version drift between client config and server.

Related errors


AI-assisted analysis of redis/redis-py@6a6b581b48 (2026-08-10). Data as JSON: /api/errors/5e6d634934008344. Report an issue: GitHub.

Appendix: 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 6a6b581b48)