redis/redis-py · error · RedisError

To configure maintenance notifications, a parser must be…

Error message

To configure maintenance notifications, a parser must be provided!

What it means

RedisError from AbstractConnection._configure_maintenance_notifications (redis/asyncio/connection.py:244) when the method is called with no parser argument. Maintenance notifications require a parser instance to attach a push handler to; omitting it is an internal programming error, not something an end user triggers directly.

Solutions

  1. Pass the active parser instance when invoking _configure_maintenance_notifications
  2. Avoid subclassing connection internals; use the public configuration options instead
  3. If you hit this from library code, upgrade redis-py
Defensive patterns

Strategy: validation

Validate before calling

# internal API; callers cannot trigger. If subclassing, always pass parser= into _configure_maintenance_notifications.

Prevention

When it happens

Trigger: Internal/pool code calling _configure_maintenance_notifications without passing parser=; subclassing the connection and overriding the pool handler wiring incorrectly.

Common situations: Custom connection subclasses; bugs in pool handler delegation paths.

Related errors


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

Appendix: source

Thrown at redis/asyncio/connection.py:245

        orig_host_address: str | None = None,
        orig_socket_timeout: float | None = None,
        orig_socket_connect_timeout: float | None = None,
        oss_cluster_maint_notifications_handler: (
            AsyncOSSMaintNotificationsHandler | None
        ) = None,
        parser: BaseParser | None = None,
    ) -> None:
        if (
            not self.maint_notifications_config
            or not self.maint_notifications_config.enabled
        ):
            self._maint_notifications_pool_handler = None
            self._maint_notifications_connection_handler = None
            self._oss_cluster_maint_notifications_handler = None
            return

        if not parser:
            raise RedisError(
                "To configure maintenance notifications, a parser must be provided!"
            )

        if not isinstance(parser, _AsyncHiredisParser) and not isinstance(
            parser, _AsyncRESP3Parser
        ):
            raise RedisError(
                "Maintenance notifications are only supported with hiredis and RESP3 parsers!"
            )

        if maint_notifications_pool_handler:
            # Extract a reference to a new pool handler that copies all properties
            # of the original one and has a different connection reference
            # This is needed because when we attach the handler to the parser
            # we need to make sure that the handler has a reference to the
            # connection that the parser is attached to.
            self._maint_notifications_pool_handler = (
                maint_notifications_pool_handler.get_handler_for_connection()

View on GitHub (pinned to 6a6b581b48)