{"id":"4ba02b89c7cdf6ea","repo":"go-redis/redis","slug":"invalid-endpoint-type","errorCode":null,"errorMessage":"invalid endpoint type","messagePattern":"invalid endpoint type","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"maintnotifications/errors.go","lineNumber":15,"sourceCode":"package maintnotifications\n\nimport (\n\t\"errors\"\n\n\t\"github.com/redis/go-redis/v9/internal/maintnotifications/logs\"\n)\n\n// Configuration errors\nvar (\n\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 (","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/go-redis/redis/blob/36d97525cd8076aed67cddf54778e9ea84550929/maintnotifications/errors.go#L1-L33","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\ncfg := &maintnotifications.Config{EndpointType: maintnotifications.EndpointType(\"external\")}\n\n// after\ncfg := &maintnotifications.Config{EndpointType: maintnotifications.EndpointTypeExternalIP}","handlingStrategy":"validation","validationCode":"if !cfg.EndpointType.IsValid() {\n    cfg.EndpointType = maintnotifications.EndpointTypeAuto\n}\nif err := cfg.Validate(); err != nil {\n    return fmt.Errorf(\"maint config: %w\", err)\n}","typeGuard":"func validEndpointType(e maintnotifications.EndpointType) bool {\n    return e.IsValid()\n}","tryCatchPattern":null,"preventionTips":["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."],"tags":["maintnotifications","config","validation","endpoint"],"analyzedSha":"36d97525cd8076aed67cddf54778e9ea84550929","analyzedAt":"2026-08-06T01:08:27.376Z","schemaVersion":2}