XTLS/Xray-core · error

shadowsocks 2022 (multi-user): users must have empty method

Error message

shadowsocks 2022 (multi-user): users must have empty method

What it means

Shadowsocks-2022 multi-user mode derives each user's PSK with the server-wide method; per-user cipher fields are invalid. This error fires when any user entry in the users array has a non-empty 'cipher'/'method' value.

Source

Thrown at infra/conf/shadowsocks.go:140

	if v.Cipher == "" {
		return nil, errors.New("shadowsocks 2022 (multi-user): missing server method")
	}
	if !strings.Contains(v.Cipher, "aes") {
		return nil, errors.New("shadowsocks 2022 (multi-user): only blake3-aes-*-gcm methods are supported")
	}

	if v.Users[0].Address == nil {
		config := new(shadowsocks_2022.MultiUserServerConfig)
		config.Method = v.Cipher
		config.Key = v.Password
		config.Network = v.NetworkList.Build()

		config.Users = make([]*protocol.User, len(v.Users))
		processUser := func(idx int) error {
			user := v.Users[idx]
			if user.Cipher != "" {
				return errors.New("shadowsocks 2022 (multi-user): users must have empty method")
			}
			account := &shadowsocks_2022.Account{
				Key: user.Password,
			}
			config.Users[idx] = &protocol.User{
				Email:   user.Email,
				Level:   uint32(user.Level),
				Account: serial.ToTypedMessage(account),
			}
			return nil
		}
		if err := task.ParallelForN(len(v.Users), processUser); err != nil {
			return nil, err
		}
		return config, nil
	}

	config := new(shadowsocks_2022.RelayServerConfig)

View on GitHub (pinned to 7d214f8b09)

Solutions

  1. Remove (or empty) the 'cipher'/'method' field from every entry in 'users'; keep only password, email, level.
  2. Ensure the single server-level method matches all user key lengths (derive user keys from the same method's key size).

Example fix

// before
"users": [{"cipher": "2022-blake3-aes-128-gcm", "password": "..."}]

// after
"users": [{"password": "...", "email": "u1"}]  // method only at server level
Defensive patterns

Strategy: validation

Validate before calling

func validSS2022Users(users []User) bool {
    for _, u := range users {
        if u.Cipher != "" {
            return false
        }
    }
    return true
}

Prevention

When it happens

Trigger: A multi-user 2022 inbound where a user object includes "cipher": "2022-blake3-aes-128-gcm" or any non-empty method string.

Common situations: Reusing classic multi-user config structure where each user had its own cipher; generating users with a template that always fills the method field.

Related errors


AI-assisted analysis of XTLS/Xray-core@7d214f8b09 (2026-08-15). Data as JSON: /api/errors/50ac390e110a846e. Report an issue: GitHub.