XTLS/Xray-core · error

Account is missing

Error message

Account is missing

What it means

Validation in User.GetTypedAccount: the user's protobuf Account field is nil, so there is no account payload to instantiate. The user entry in the config has no account object at all. Logged at Warning.

Solutions

  1. Provide a valid account (with correct typed payload) for each user
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at common/protocol/user.go:10 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at common/protocol/user.go:10

package protocol

import (
	"github.com/xtls/xray-core/common/errors"
	"github.com/xtls/xray-core/common/serial"
)

func (u *User) GetTypedAccount() (Account, error) {
	if u.GetAccount() == nil {
		return nil, errors.New("Account is missing").AtWarning()
	}

	rawAccount, err := u.Account.GetInstance()
	if err != nil {
		return nil, err
	}
	if asAccount, ok := rawAccount.(AsAccount); ok {
		return asAccount.AsAccount()
	}
	if account, ok := rawAccount.(Account); ok {
		return account, nil
	}
	return nil, errors.New("Unknown account type: ", u.Account.Type)
}

func (u *User) ToMemoryUser() (*MemoryUser, error) {
	account, err := u.GetTypedAccount()
	if err != nil {

View on GitHub (pinned to 7d214f8b09)