XTLS/Xray-core · error

empty profiles

Error message

empty profiles

What it means

Thrown by newClientConn when the login profiles list is empty. The XMC client randomly picks one profile (rand.Int over len(profiles)) to send as the Minecraft Login Start username/UUID, so at least one profile must be configured.

Source

Thrown at transport/internet/finalmask/xmc/client.go:49

	hostname        string
	paddingSchedule []paddingTurn
	packet          *packetStream
	deadlines       *connectionDeadlines
}

type clientState int

var (
	clientStateHandshake clientState = 1
	clientStateProxy     clientState = 2
)

func newClientConn(c net.Conn, profiles []loginProfile, password string, rsaPublicKey []byte, hostname string) (*clientConn, error) {
	if len(rsaPublicKey) == 0 {
		return nil, fmt.Errorf("empty rsa public key")
	}
	if len(profiles) == 0 {
		return nil, fmt.Errorf("empty profiles")
	}
	paddingSchedule, err := newClientPaddingSchedule2612()
	if err != nil {
		return nil, fmt.Errorf("select padding profile: %w", err)
	}
	return &clientConn{
		reader:          bufio.NewReader(c),
		writer:          c,
		c:               c,
		state:           clientStateHandshake,
		handshakeLock:   sync.Mutex{},
		profiles:        profiles,
		password:        password,
		rsaPublicKey:    rsaPublicKey,
		hostname:        hostname,
		paddingSchedule: paddingSchedule,
		deadlines:       newConnectionDeadlines(c),
	}, nil

View on GitHub (pinned to 7d214f8b09)

Solutions

  1. Add at least one login profile (username/UUID pair) to the client config.
  2. Check the config loader/templating to ensure the profiles array survives rendering.
  3. Validate profiles client-side before dialing (see defense below).

Example fix

// before
"profiles": []
// after
"profiles": [{"username": "Steve", "uuid": "..."}]
Defensive patterns

Strategy: validation

Validate before calling

if len(profiles) == 0 {
	return errors.New("xmc client requires at least one login profile")
}

Prevention

When it happens

Trigger: Calling newClientConn with a nil or zero-length profiles slice, i.e. an XMC config with no profile entries. Fails immediately at connection construction, before the socket is used.

Common situations: Forgetting the profiles array in the outbound config; an empty profiles: [] block; config templating that strips the array when a variable is unset.

Related errors


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