{"record":{"id":"df92090e9e184243","repo":"XTLS/Xray-core","slug":"invalid-maxclientver","errorCode":null,"errorMessage":"invalid \"maxClientVer\": ","messagePattern":"invalid \"maxClientVer\": ","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/transport_security.go","lineNumber":126,"sourceCode":"\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`)\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 {","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/transport_security.go#L108-L144","documentation":"Thrown by the REALITY builder while parsing maxClientVer when the dotted version string has more than three components (a 4th part exists at index 3). Like minClientVer, the max version is stored in a fixed 3-byte array, so only major.minor.patch is accepted.","triggerScenarios":"Setting \"maxClientVer\": \"1.8.24.3\".","commonSituations":"Same as minClientVer: four-part versions copied from release notes.","solutions":["Use a three-part version, e.g. \"1.8.24\".","maxClientVer is rarely needed — omit it unless capping clients is intentional."],"exampleFix":"// before\n\"maxClientVer\": \"1.8.24.3\"\n// after\n\"maxClientVer\": \"1.8.24\"","handlingStrategy":"validation","validationCode":"if c.MaxClientVer != \"\" && strings.Count(c.MaxClientVer, \".\") > 2 {\n    return errors.New(\"maxClientVer must be major.minor.patch\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Share the same version-triple validator for min and max client versions.","Usually omit maxClientVer entirely."],"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"}