{"id":"70ceb9fbb20e0ca4","repo":"go-redis/redis","slug":"invalid-client-type","errorCode":null,"errorMessage":"invalid client type","messagePattern":"invalid client type","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"maintnotifications/errors.go","lineNumber":29,"sourceCode":"\tErrInvalidRelaxedTimeout             = errors.New(logs.InvalidRelaxedTimeoutError())\n\tErrInvalidHandoffTimeout             = errors.New(logs.InvalidHandoffTimeoutError())\n\tErrInvalidHandoffWorkers             = errors.New(logs.InvalidHandoffWorkersError())\n\tErrInvalidHandoffQueueSize           = errors.New(logs.InvalidHandoffQueueSizeError())\n\tErrInvalidPostHandoffRelaxedDuration = errors.New(logs.InvalidPostHandoffRelaxedDurationError())\n\tErrInvalidEndpointType               = errors.New(logs.InvalidEndpointTypeError())\n\tErrInvalidMaintNotifications         = errors.New(logs.InvalidMaintNotificationsError())\n\tErrMaxHandoffRetriesReached          = errors.New(logs.MaxHandoffRetriesReachedError())\n\n\t// Configuration validation errors\n\n\t// ErrInvalidHandoffRetries is returned when the number of handoff retries is invalid\n\tErrInvalidHandoffRetries = errors.New(logs.InvalidHandoffRetriesError())\n)\n\n// Integration errors\nvar (\n\t// ErrInvalidClient is returned when the client does not support push notifications\n\tErrInvalidClient = errors.New(logs.InvalidClientError())\n)\n\n// Handoff errors\nvar (\n\t// ErrHandoffQueueFull is returned when the handoff queue is full\n\tErrHandoffQueueFull = errors.New(logs.HandoffQueueFullError())\n)\n\n// Notification errors\nvar (\n\t// ErrInvalidNotification is returned when a notification is in an invalid format\n\tErrInvalidNotification = errors.New(logs.InvalidNotificationError())\n)\n\n// connection handoff errors\nvar (\n\t// ErrConnectionMarkedForHandoff is returned when a connection is marked for handoff\n\t// and should not be used until the handoff is complete","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/go-redis/redis/blob/36d97525cd8076aed67cddf54778e9ea84550929/maintnotifications/errors.go#L11-L47","documentation":"Returned by NewManager (manager.go:128) when the supplied client is nil, and by setupPushNotifications (manager.go:230) when the client has no push-notification processor. Maintenance notifications require a client that implements ClientInterface and exposes a RESP3 push processor (Protocol: 3) to receive MOVING/MIGRATING frames.","triggerScenarios":"Passing nil to NewManager; or enabling maintnotifications on a client type that does not support push notifications (e.g. a minimal/mock client without GetPushProcessor). Also surfaces if RESP3 (Options.Protocol=3) is not negotiated, since the push processor may be absent.","commonSituations":"Enabling MaintNotificationsConfig on a custom UniversalClient wrapper that doesn't forward push support; forgetting to set Options.Protocol = 3 (required per AGENTS.md maintnotifications spec); a test stub client missing the processor.","solutions":["Ensure Options.Protocol = 3 is set so the client negotiates RESP3 and builds a push processor.","Use the standard redis.Client / ClusterClient which implement ClientInterface with push support; do not pass nil.","If wrapping the client, ensure your wrapper delegates GetPushProcessor() to the underlying real client."],"exampleFix":"// before\nopt := &redis.Options{Addr: addr, MaintNotificationsConfig: maintnotifications.DefaultConfig()}\n// Protocol omitted -> push processor absent -> ErrInvalidClient\n\n// after\nopt := &redis.Options{\n  Addr: addr,\n  Protocol: 3, // RESP3 required for push notifications\n  MaintNotificationsConfig: maintnotifications.DefaultConfig(),\n}","handlingStrategy":"validation","validationCode":"opt.Protocol = 3 // RESP3 required for push notifications\nif err := maintCfg.Validate(); err != nil {\n    return err\n}","typeGuard":null,"tryCatchPattern":"_, err := maintnotifications.NewManager(client, pool, cfg)\nif errors.Is(err, maintnotifications.ErrInvalidClient) {\n    // client is nil or lacks a push processor; ensure Protocol=3 and a real client type\n}","preventionTips":["Always set Options.Protocol = 3 when enabling MaintNotificationsConfig.","Use redis.Client/ClusterClient, not nil or a push-less wrapper.","Forward GetPushProcessor in any client wrapper."],"tags":["maintnotifications","config","resp3","push","client"],"analyzedSha":"36d97525cd8076aed67cddf54778e9ea84550929","analyzedAt":"2026-08-06T01:08:27.376Z","schemaVersion":2}