{"record":{"id":"896425c09512da92","repo":"nats-io/nats-server","slug":"the-minimum-version-should-be-at-least-2-8-0","errorCode":null,"errorMessage":"the minimum version should be at least 2.8.0","messagePattern":"the minimum version should be at least 2\\.8\\.0","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/leafnode.go","lineNumber":362,"sourceCode":"\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_ {\n\t\treturn fmt.Errorf(\"can not have a single nkey and a users array\")\n\t}","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/leafnode.go#L344-L380","documentation":"checkLeafMinVersionConfig rejects minimum versions older than 2.8.0 because leaf node features (such as the min_version mechanism itself and account-bound leaf connections) require at least 2.8.0. When the parsed version is valid but below 2.8.0, this error is returned. Called from validateLeafNode and parseLeafNodes.","triggerScenarios":"leafnodes { min_version: \"2.x.y\" } with x < 8 (e.g. \"2.6.2\", \"2.7.4\") during option validation or leaf node config parsing.","commonSituations":"Configs copied from very old NATS documentation or installations that were upgraded in place; operators pinning minimum versions below the supported floor.","solutions":["Raise min_version to \"2.8.0\" or later","Remove the min_version key to accept defaults","Upgrade all leaf/serving servers so an up-to-date minimum is safe"],"exampleFix":"// before\nleafnodes { min_version: \"2.7.1\" }\n// after\nleafnodes { min_version: \"2.8.0\" }","handlingStrategy":"validation","validationCode":"if mv := cfg.LeafNodes.MinVersion; mv != \"\" {\n  v, _ := semver.NewVersion(mv)\n  floor, _ := semver.NewVersion(\"2.8.0\")\n  if v != nil && v.LessThan(floor) {\n    return fmt.Errorf(\"min_version %s is below required 2.8.0\", mv)\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never set min_version below 2.8.0","Omit min_version unless a specific constraint is needed","Document supported server versions for your deployment"],"tags":["leafnode","version","config-validation"],"backgroundTag":"version-too-low","analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}