{"record":{"id":"e783baa098b84f40","repo":"redis/redis-py","slug":"to-configure-maintenance-notifications-a-parser-m","errorCode":null,"errorMessage":"To configure maintenance notifications, a parser must be provided!","messagePattern":"To configure maintenance notifications, a parser must be provided!","errorType":"exception","errorClass":"RedisError","httpStatus":null,"severity":"error","filePath":"redis/asyncio/connection.py","lineNumber":245,"sourceCode":"        orig_host_address: str | None = None,\n        orig_socket_timeout: float | None = None,\n        orig_socket_connect_timeout: float | None = None,\n        oss_cluster_maint_notifications_handler: (\n            AsyncOSSMaintNotificationsHandler | None\n        ) = None,\n        parser: BaseParser | None = None,\n    ) -> None:\n        if (\n            not self.maint_notifications_config\n            or not self.maint_notifications_config.enabled\n        ):\n            self._maint_notifications_pool_handler = None\n            self._maint_notifications_connection_handler = None\n            self._oss_cluster_maint_notifications_handler = None\n            return\n\n        if not parser:\n            raise RedisError(\n                \"To configure maintenance notifications, a parser must be provided!\"\n            )\n\n        if not isinstance(parser, _AsyncHiredisParser) and not isinstance(\n            parser, _AsyncRESP3Parser\n        ):\n            raise RedisError(\n                \"Maintenance notifications are only supported with hiredis and RESP3 parsers!\"\n            )\n\n        if maint_notifications_pool_handler:\n            # Extract a reference to a new pool handler that copies all properties\n            # of the original one and has a different connection reference\n            # This is needed because when we attach the handler to the parser\n            # we need to make sure that the handler has a reference to the\n            # connection that the parser is attached to.\n            self._maint_notifications_pool_handler = (\n                maint_notifications_pool_handler.get_handler_for_connection()","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/redis/redis-py/blob/6a6b581b48225afa0b76912d1028c6035baee932/redis/asyncio/connection.py#L227-L263","documentation":"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.","triggerScenarios":"Internal/pool code calling _configure_maintenance_notifications without passing parser=; subclassing the connection and overriding the pool handler wiring incorrectly.","commonSituations":"Custom connection subclasses; bugs in pool handler delegation paths.","solutions":["Pass the active parser instance when invoking _configure_maintenance_notifications","Avoid subclassing connection internals; use the public configuration options instead","If you hit this from library code, upgrade redis-py"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# internal API; callers cannot trigger. If subclassing, always pass parser= into _configure_maintenance_notifications.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not subclass connection internals without passing the parser","Prefer public configuration options over internal hooks"],"tags":["async","connection","maintenance-notifications","internal"],"backgroundTag":null,"analyzedSha":"6a6b581b48225afa0b76912d1028c6035baee932","analyzedAt":"2026-08-10T12:52:44.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}