XTLS/Xray-core · error
invalid "maxClientVer":
Error message
invalid "maxClientVer":
What it means
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.
Source
Thrown at infra/conf/transport_security.go:126
return nil, errors.New(`invalid "minClientVer": `, c.MinClientVer)
}
if u, err = strconv.ParseUint(s, 10, 8); err != nil {
return nil, errors.New(`"minClientVer[`, i, `]" should be less than 256`)
} else {
config.MinClientVer[i] = byte(u)
}
}
errors.LogWarning(context.Background(), `REALITY: Changing "minClientVer" will increase the likelihood of your server's IP being blocked by the GFW`)
} else {
config.MinClientVer = []byte{26, 3, 27} // change it at your own risk: https://github.com/XTLS/Xray-core/commit/af7eb68028732a8ee3c0e5d6ab2b8a657bb2e770
errors.LogWarning(context.Background(), `REALITY: The default minimal client version is Xray-core v26.3.27, other clients may be refused to connect`)
}
if c.MaxClientVer != "" {
config.MaxClientVer = make([]byte, 3)
var u uint64
for i, s := range strings.Split(c.MaxClientVer, ".") {
if i == 3 {
return nil, errors.New(`invalid "maxClientVer": `, c.MaxClientVer)
}
if u, err = strconv.ParseUint(s, 10, 8); err != nil {
return nil, errors.New(`"maxClientVer[`, i, `]" should be less than 256`)
} else {
config.MaxClientVer[i] = byte(u)
}
}
}
if len(c.ShortIds) == 0 {
return nil, errors.New(`empty "shortIds"`)
}
config.ShortIds = make([][]byte, len(c.ShortIds))
for i, s := range c.ShortIds {
if len(s) > 16 {
return nil, errors.New(`too long "shortIds[`, i, `]": `, s)
}
config.ShortIds[i] = make([]byte, 8)
if _, err = hex.Decode(config.ShortIds[i], []byte(s)); err != nil {View on GitHub (pinned to 7d214f8b09)
Solutions
- Use a three-part version, e.g. "1.8.24".
- maxClientVer is rarely needed — omit it unless capping clients is intentional.
Example fix
// before "maxClientVer": "1.8.24.3" // after "maxClientVer": "1.8.24"
Defensive patterns
Strategy: validation
Validate before calling
if c.MaxClientVer != "" && strings.Count(c.MaxClientVer, ".") > 2 {
return errors.New("maxClientVer must be major.minor.patch")
} Prevention
- Share the same version-triple validator for min and max client versions.
- Usually omit maxClientVer entirely.
When it happens
Trigger: Setting "maxClientVer": "1.8.24.3".
Common situations: Same as minClientVer: four-part versions copied from release notes.
Related errors
- invalid "minClientVer":
- "minClientVer[", i, "]" should be less than 256
- "maxClientVer[", i, "]" should be less than 256
- REALITY: Empty "realitySettings".
- please fill in a valid value for "target"
AI-assisted analysis of XTLS/Xray-core@7d214f8b09 (2026-08-15).
Data as JSON: /api/errors/df92090e9e184243.
Report an issue: GitHub.