XTLS/Xray-core · error
Email must not be empty.
Error message
Email must not be empty.
What it means
Guard error in Validator.Del: deleting a user requires a non-empty email because email is the lookup key. An empty string would otherwise be ambiguous (multiple unnamed users). Pure input-validation failure with no state change.
Source
Thrown at proxy/shadowsocks/validator.go:50
account := u.Account.(*MemoryAccount)
if !account.Cipher.IsAEAD() && len(v.users) > 0 {
return errors.New("The cipher is not support Single-port Multi-user")
}
v.users = append(v.users, u)
if !v.behaviorFused {
hashkdf := hmac.New(sha256.New, []byte("SSBSKDF"))
hashkdf.Write(account.Key)
v.behaviorSeed = crc64.Update(v.behaviorSeed, crc64.MakeTable(crc64.ECMA), hashkdf.Sum(nil))
}
return nil
}
// Del a Shadowsocks user with a non-empty Email.
func (v *Validator) Del(email string) error {
if email == "" {
return errors.New("Email must not be empty.")
}
v.Lock()
defer v.Unlock()
email = strings.ToLower(email)
idx := -1
for i, u := range v.users {
if strings.EqualFold(u.Email, email) {
idx = i
break
}
}
if idx == -1 {
return errors.New("User ", email, " not found.")
}
ulen := len(v.users)View on GitHub (pinned to 7d214f8b09)
Solutions
- Supply the exact email of an existing user to Del.
- Fix the panel/script to validate non-empty email before calling the API.
- If the target user genuinely has no email, assign one first (edit user), then delete.
Example fix
// before
validator.Del("")
// after
validator.Del("alice@example.com") Defensive patterns
Strategy: validation
Validate before calling
func delUser(v *Validator, email string) error {
if strings.TrimSpace(email) == "" {
return errors.New("email required to delete a user")
}
return v.Del(strings.TrimSpace(email))
} Type guard
func isValidEmail(s string) bool { return strings.TrimSpace(s) != "" } Prevention
- Require a selected user in panel delete forms.
- Trim and check emails in API middleware before reaching the validator.
When it happens
Trigger: Calling Validator.Del("") — typically from an API handler or panel that omitted the email field when issuing the remove-user request.
Common situations: Management panel form submitted without selecting a user; API client sending {email: ""} or omitting email; scripts iterating a user list where one entry lacks an email.
Related errors
- failed to parse user
- The cipher is not support Single-port Multi-user
- User ${email} not found.
- proxy is not a UserManager
- empty tag name!
AI-assisted analysis of XTLS/Xray-core@7d214f8b09 (2026-08-15).
Data as JSON: /api/errors/91552e656233fca5.
Report an issue: GitHub.