{"record":{"id":"e12767d75792cc92","repo":"XTLS/Xray-core","slug":"maxclientver-i-should-be-less-than-256","errorCode":null,"errorMessage":"\"maxClientVer[\", i, \"]\" should be less than 256","messagePattern":"\"maxClientVer\\[\", i, \"\\]\" should be less than 256","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/transport_security.go","lineNumber":129,"sourceCode":"\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`)\n\t\t\t\t} else {\n\t\t\t\t\tconfig.MaxClientVer[i] = byte(u)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif len(c.ShortIds) == 0 {\n\t\t\treturn nil, errors.New(`empty \"shortIds\"`)\n\t\t}\n\t\tconfig.ShortIds = make([][]byte, len(c.ShortIds))\n\t\tfor i, s := range c.ShortIds {\n\t\t\tif len(s) > 16 {\n\t\t\t\treturn nil, errors.New(`too long \"shortIds[`, i, `]\": `, s)\n\t\t\t}\n\t\t\tconfig.ShortIds[i] = make([]byte, 8)\n\t\t\tif _, err = hex.Decode(config.ShortIds[i], []byte(s)); err != nil {\n\t\t\t\treturn nil, errors.New(`invalid \"shortIds[`, i, `]\": `, s)\n\t\t\t}\n\t\t}","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/transport_security.go#L111-L147","documentation":"Thrown by the REALITY builder when a component of maxClientVer fails ParseUint with bitSize 8 — the number is negative, non-numeric, or >= 256. Components map to single bytes in a 3-byte version vector.","triggerScenarios":"Setting \"maxClientVer\": \"1.8.256\" or \"1.8.x\".","commonSituations":"Typos and placeholder strings left in from templates.","solutions":["Keep every component numeric and within 0-255.","Omit maxClientVer if you do not need an upper bound."],"exampleFix":"// before\n\"maxClientVer\": \"1.8.256\"\n// after\n\"maxClientVer\": \"1.8.24\"","handlingStrategy":"validation","validationCode":"for i, p := range strings.Split(c.MaxClientVer, \".\") {\n    if _, err := strconv.ParseUint(p, 10, 8); err != nil {\n        return fmt.Errorf(\"maxClientVer component %d (%q) invalid or >= 256\", i, p)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reject negative, non-numeric, or >255 components before build.","Test version strings when you add them programmatically."],"tags":["config","reality","version","validation","go"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}