{"record":{"id":"5f56bcadf8985dd9","repo":"nats-io/nats-server","slug":"unknown-version-v","errorCode":null,"errorMessage":"unknown version: %v","messagePattern":"unknown version: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/server.go","lineNumber":3730,"sourceCode":"\t\treturn \"1.2\"\n\tcase tls.VersionTLS13:\n\t\treturn \"1.3\"\n\t}\n\treturn fmt.Sprintf(\"Unknown [0x%x]\", ver)\n}\n\nfunc tlsVersionFromString(ver string) (uint16, error) {\n\tswitch ver {\n\tcase \"1.0\":\n\t\treturn tls.VersionTLS10, nil\n\tcase \"1.1\":\n\t\treturn tls.VersionTLS11, nil\n\tcase \"1.2\":\n\t\treturn tls.VersionTLS12, nil\n\tcase \"1.3\":\n\t\treturn tls.VersionTLS13, nil\n\t}\n\treturn 0, fmt.Errorf(\"unknown version: %v\", ver)\n}\n\n// Remove a client or route from our internal accounting.\nfunc (s *Server) removeClient(c *client) {\n\t// kind is immutable, so can check without lock\n\tswitch c.kind {\n\tcase CLIENT:\n\t\tc.mu.Lock()\n\t\tcid := c.cid\n\t\tupdateProtoInfoCount := false\n\t\tif c.kind == CLIENT && c.opts.Protocol >= ClientProtoInfo {\n\t\t\tupdateProtoInfoCount = true\n\t\t}\n\t\tproxyKey := c.proxyKey\n\t\tc.mu.Unlock()\n\n\t\ts.mu.Lock()\n\t\tdelete(s.clients, cid)","sourceCodeStart":3712,"sourceCodeEnd":3748,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/server.go#L3712-L3748","documentation":"tlsVersionFromString maps the config strings '1.0'-'1.3' to tls.VersionTLSxx constants; any other value falls through and yields this error with the offending string. It fires while normalizing TLS min/max version settings (e.g. from tls { min_version: ... }), so an unrecognized version name (typo, '1.4', 'TLS12') is the input at fault.","triggerScenarios":"Config `tls` block (or route/monitor TLS config) sets `first_tls_version` / version string parsed by this helper with a value not in {\"1.0\",\"1.1\",\"1.2\",\"1.3\"}; the switch falls through and returns the error.","commonSituations":"Setting `first_tls_version: 1.4` (not a real version); writing \"TLSv1.2\" or \"tls1.2\" instead of bare \"1.2\"; YAML parsing 1.2 as a float 1.2 vs string — formatting issues after copy-paste.","solutions":["Use one of the accepted strings exactly: \"1.0\", \"1.1\", \"1.2\", or \"1.3\"","Quote the value in YAML (`first_tls_version: \"1.2\"`) so it isn't parsed as a float","Remove first_tls_version to use the library default","Upgrade guidance: prefer \"1.2\" or \"1.3\" since older versions are deprecated"],"exampleFix":"// before\ntls {\n  first_tls_version: TLSv1.2\n}\n// after\ntls {\n  first_tls_version: \"1.2\"\n}","handlingStrategy":"validation","validationCode":"// Validate TLS version strings against the accepted set\nvar validTLSVersions = map[string]bool{\"1.0\": true, \"1.1\": true, \"1.2\": true, \"1.3\": true}\n\nfunc checkTLSVersion(v string) error {\n    if v != \"\" && !validTLSVersions[v] {\n        return fmt.Errorf(\"first_tls_version must be one of 1.0,1.1,1.2,1.3, got %q\", v)\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Write bare versions \"1.2\"/\"1.3\" — no \"TLSv\" prefix","Quote numeric-looking values in YAML so 1.2 stays a string","Prefer \"1.2\" as minimum; 1.0/1.1 are deprecated by Go TLS anyway"],"tags":["nats-server","tls","configuration","version"],"backgroundTag":"tls-version-parse-error","analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}