{"record":{"id":"a80de2a770e43528","repo":"XTLS/Xray-core","slug":"minclientver-i-should-be-less-than-256","errorCode":null,"errorMessage":"\"minClientVer[\", i, \"]\" should be less than 256","messagePattern":"\"minClientVer\\[\", i, \"\\]\" should be less than 256","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/transport_security.go","lineNumber":111,"sourceCode":"\t\t}\n\t\tif len(c.ServerNames) == 0 {\n\t\t\treturn nil, errors.New(`empty \"serverNames\"`)\n\t\t}\n\t\tif c.PrivateKey == \"\" {\n\t\t\treturn nil, errors.New(`empty \"privateKey\"`)\n\t\t}\n\t\tif config.PrivateKey, err = base64.RawURLEncoding.DecodeString(c.PrivateKey); err != nil || len(config.PrivateKey) != 32 {\n\t\t\treturn nil, errors.New(`invalid \"privateKey\": `, c.PrivateKey)\n\t\t}\n\t\tif c.MinClientVer != \"\" {\n\t\t\tconfig.MinClientVer = make([]byte, 3)\n\t\t\tvar u uint64\n\t\t\tfor i, s := range strings.Split(c.MinClientVer, \".\") {\n\t\t\t\tif i == 3 {\n\t\t\t\t\treturn nil, errors.New(`invalid \"minClientVer\": `, c.MinClientVer)\n\t\t\t\t}\n\t\t\t\tif u, err = strconv.ParseUint(s, 10, 8); err != nil {\n\t\t\t\t\treturn nil, errors.New(`\"minClientVer[`, i, `]\" should be less than 256`)\n\t\t\t\t} else {\n\t\t\t\t\tconfig.MinClientVer[i] = byte(u)\n\t\t\t\t}\n\t\t\t}\n\t\t\terrors.LogWarning(context.Background(), `REALITY: Changing \"minClientVer\" will increase the likelihood of your server's IP being blocked by the GFW`)\n\t\t} else {\n\t\t\tconfig.MinClientVer = []byte{26, 3, 27} // change it at your own risk: https://github.com/XTLS/Xray-core/commit/af7eb68028732a8ee3c0e5d6ab2b8a657bb2e770\n\t\t\terrors.LogWarning(context.Background(), `REALITY: The default minimal client version is Xray-core v26.3.27, other clients may be refused to connect`)\n\t\t}\n\t\tif c.MaxClientVer != \"\" {\n\t\t\tconfig.MaxClientVer = make([]byte, 3)\n\t\t\tvar u uint64\n\t\t\tfor i, s := range strings.Split(c.MaxClientVer, \".\") {\n\t\t\t\tif i == 3 {\n\t\t\t\t\treturn nil, errors.New(`invalid \"maxClientVer\": `, c.MaxClientVer)\n\t\t\t\t}\n\t\t\t\tif u, err = strconv.ParseUint(s, 10, 8); err != nil {\n\t\t\t\t\treturn nil, errors.New(`\"maxClientVer[`, i, `]\" should be less than 256`)","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/transport_security.go#L93-L129","documentation":"Thrown by the REALITY builder when a component of minClientVer fails ParseUint with bitSize 8 — i.e. the number is negative or >= 256. Each version component must fit in one byte because the parsed result is stored into a [3]byte.","triggerScenarios":"Setting \"minClientVer\": \"1.300.0\" or \"1.-2.3\" (non-numeric strings also land here since ParseUint fails).","commonSituations":"Typos, or treating the field as a date/build number like \"24.1234.5\".","solutions":["Keep every component in 0-255 and numeric, e.g. \"1.8.6\".","Omit the field to use the safe default."],"exampleFix":"// before\n\"minClientVer\": \"1.512.0\"\n// after\n\"minClientVer\": \"1.8.6\"","handlingStrategy":"validation","validationCode":"func validVerComponent(s string) bool {\n    _, err := strconv.ParseUint(s, 10, 8)\n    return err == nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Constrain each version component to 0-255 at input time.","Avoid non-numeric placeholders like 'x' in templates."],"tags":["config","reality","version","validation","go"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}