{"record":{"id":"91a600dc0ddcad2a","repo":"nats-io/nats-server","slug":"invalid-leafnode-s-minimum-version-v","errorCode":null,"errorMessage":"invalid leafnode's minimum version: %v","messagePattern":"invalid leafnode's minimum version: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/leafnode.go","lineNumber":360,"sourceCode":"\n\tif o.Gateway.Name == _EMPTY_ && o.Gateway.Port == 0 {\n\t\treturn nil\n\t}\n\t// If we are here we have both leaf nodes and gateways defined, make sure there\n\t// is a system account defined.\n\tif o.SystemAccount == _EMPTY_ {\n\t\treturn fmt.Errorf(\"leaf nodes and gateways (both being defined) require a system account to also be configured\")\n\t}\n\tif err := validatePinnedCerts(o.LeafNode.TLSPinnedCerts); err != nil {\n\t\treturn fmt.Errorf(\"leafnode: %v\", err)\n\t}\n\treturn nil\n}\n\nfunc checkLeafMinVersionConfig(mv string) error {\n\tif ok, err := versionAtLeastCheckError(mv, 2, 8, 0); !ok || err != nil {\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid leafnode's minimum version: %v\", err)\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"the minimum version should be at least 2.8.0\")\n\t\t}\n\t}\n\treturn nil\n}\n\n// Used to validate user names in LeafNode configuration.\n// - rejects mix of single and multiple users.\n// - rejects duplicate user names.\nfunc validateLeafNodeAuthOptions(o *Options) error {\n\tif len(o.LeafNode.Users) == 0 {\n\t\treturn nil\n\t}\n\tif o.LeafNode.Username != _EMPTY_ {\n\t\treturn fmt.Errorf(\"can not have a single user/pass and a users array\")\n\t}\n\tif o.LeafNode.Nkey != _EMPTY_ {","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/leafnode.go#L342-L378","documentation":"checkLeafMinVersionConfig validates the leafnode minimum version setting and wraps a parse failure from versionAtLeastCheckError as \"invalid leafnode's minimum version: %v\". It throws when the configured minimum version string cannot be parsed as a semver version. Called from validateLeafNode and parseLeafNodes when leafnodes.min_version is set.","triggerScenarios":"Config contains leafnodes { min_version: \"<unparseable string>\" } and the server validates options or parses leaf node config; versionAtLeastCheckError returns a non-nil error (bad version format).","commonSituations":"Typos like \"v.2.8.0\", \"2.8\", \"latest\", or pasting a full version string with build metadata that the parser rejects.","solutions":["Set min_version to a valid semantic version string, e.g. \"2.8.0\"","Check the wrapped %v error to see the exact parse problem","Remove the min_version setting if the constraint is not needed"],"exampleFix":"// before\nleafnodes { min_version: \"2.8\" }\n// after\nleafnodes { min_version: \"2.8.0\" }","handlingStrategy":"validation","validationCode":"if mv := cfg.LeafNodes.MinVersion; mv != \"\" {\n  if _, err := semver.NewVersion(mv); err != nil {\n    return fmt.Errorf(\"invalid leafnode min_version %q: %v\", mv, err)\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use full semver strings (MAJOR.MINOR.PATCH)","Avoid manual edits to version strings; source them from variables","Run `nats-server -t` before restarts"],"tags":["leafnode","version","config-validation"],"backgroundTag":"invalid-version-string","analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}