XTLS/Xray-core · error
"minClientVer[", i, "]" should be less than 256
Error message
"minClientVer[", i, "]" should be less than 256
What it means
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.
Source
Thrown at infra/conf/transport_security.go:111
}
if len(c.ServerNames) == 0 {
return nil, errors.New(`empty "serverNames"`)
}
if c.PrivateKey == "" {
return nil, errors.New(`empty "privateKey"`)
}
if config.PrivateKey, err = base64.RawURLEncoding.DecodeString(c.PrivateKey); err != nil || len(config.PrivateKey) != 32 {
return nil, errors.New(`invalid "privateKey": `, c.PrivateKey)
}
if c.MinClientVer != "" {
config.MinClientVer = make([]byte, 3)
var u uint64
for i, s := range strings.Split(c.MinClientVer, ".") {
if i == 3 {
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`)View on GitHub (pinned to 7d214f8b09)
Solutions
- Keep every component in 0-255 and numeric, e.g. "1.8.6".
- Omit the field to use the safe default.
Example fix
// before "minClientVer": "1.512.0" // after "minClientVer": "1.8.6"
Defensive patterns
Strategy: validation
Validate before calling
func validVerComponent(s string) bool {
_, err := strconv.ParseUint(s, 10, 8)
return err == nil
} Prevention
- Constrain each version component to 0-255 at input time.
- Avoid non-numeric placeholders like 'x' in templates.
When it happens
Trigger: Setting "minClientVer": "1.300.0" or "1.-2.3" (non-numeric strings also land here since ParseUint fails).
Common situations: Typos, or treating the field as a date/build number like "24.1234.5".
Related errors
- invalid "minClientVer":
- invalid "maxClientVer":
- "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/a80de2a770e43528.
Report an issue: GitHub.