go-redis/redis · error
invalid endpoint type
Error message
invalid endpoint type
What it means
Returned by Config.Validate() (maintnotifications/config.go:194-196) when Config.EndpointType is not one of the six valid constants. EndpointType tells the server what address form to return in a MOVING notification so the client can dial the new endpoint correctly. Valid values are defined in config.go:42-49: auto, internal-ip, internal-fqdn, external-ip, external-fqdn, none.
Source
Thrown at maintnotifications/errors.go:15
package maintnotifications import ( "errors" "github.com/redis/go-redis/v9/internal/maintnotifications/logs" ) // Configuration errors var ( ErrInvalidRelaxedTimeout = errors.New(logs.InvalidRelaxedTimeoutError()) ErrInvalidHandoffTimeout = errors.New(logs.InvalidHandoffTimeoutError()) ErrInvalidHandoffWorkers = errors.New(logs.InvalidHandoffWorkersError()) ErrInvalidHandoffQueueSize = errors.New(logs.InvalidHandoffQueueSizeError()) ErrInvalidPostHandoffRelaxedDuration = errors.New(logs.InvalidPostHandoffRelaxedDurationError()) ErrInvalidEndpointType = errors.New(logs.InvalidEndpointTypeError()) ErrInvalidMaintNotifications = errors.New(logs.InvalidMaintNotificationsError()) ErrMaxHandoffRetriesReached = errors.New(logs.MaxHandoffRetriesReachedError()) // Configuration validation errors // ErrInvalidHandoffRetries is returned when the number of handoff retries is invalid ErrInvalidHandoffRetries = errors.New(logs.InvalidHandoffRetriesError()) ) // Integration errors var ( // ErrInvalidClient is returned when the client does not support push notifications ErrInvalidClient = errors.New(logs.InvalidClientError()) ) // Handoff errors var (
View on GitHub (pinned to 36d97525cd)
Solutions
- Use a typed EndpointType constant: maintnotifications.EndpointTypeAuto (safest default), EndpointTypeExternalIP, etc.
- If loading from config, map the string to a constant via a switch with a default that falls back to EndpointTypeAuto instead of passing the raw string.
- Call EndpointType.IsValid() (config.go:52) before constructing the client to fail with a clearer message.
Example fix
// before
cfg := &maintnotifications.Config{EndpointType: maintnotifications.EndpointType("external")}
// after
cfg := &maintnotifications.Config{EndpointType: maintnotifications.EndpointTypeExternalIP} Defensive patterns
Strategy: validation
Validate before calling
if !cfg.EndpointType.IsValid() {
cfg.EndpointType = maintnotifications.EndpointTypeAuto
}
if err := cfg.Validate(); err != nil {
return fmt.Errorf("maint config: %w", err)
} Type guard
func validEndpointType(e maintnotifications.EndpointType) bool {
return e.IsValid()
} Prevention
- Map external config strings to the typed constants via a switch.
- Default unknown values to EndpointTypeAuto rather than passing raw strings.
- Keep a list of the 6 valid constants beside your config docs.
When it happens
Trigger: Assigning a raw string (e.g. 'external', 'public-ip', 'ip') to Options.MaintNotificationsConfig.EndpointType instead of one of the EndpointType* constants, then validating the config during client construction.
Common situations: Typing an endpoint type from memory that doesn't match a constant; loading the value from YAML/env without mapping it through the defined constants; a version upgrade that renamed a constant.
Related errors
- MaxWorkers must be greater than or equal to 0
- handoff queue size must be greater than 0
- post-handoff relaxed duration must be greater than or equal
- invalid maintenance notifications setting (must be 'disabled
- MaxHandoffRetries must be between 1 and 10
AI-assisted analysis of go-redis/redis@36d97525cd (2026-08-06).
Data as JSON: /data/errors/4ba02b89c7cdf6ea.json.
Report an issue: GitHub.