XTLS/Xray-core · error

invalid profile

Error message

invalid profile

What it means

Each entry in the profiles list must be a non-nil object with a non-empty Username; this error fires when an entry is null or its username is the empty string. The username is the primary routing/login field for the Minecraft session, so a blank one is rejected before any connection is made.

Source

Thrown at transport/internet/finalmask/xmc/profile.go:20

import "fmt"

type loginProfile struct {
	Username          string
	UUID              UUID
	TexturesValue     string
	TexturesSignature string
}

func profilesFromConfig(configured []*Profile) ([]loginProfile, error) {
	if len(configured) == 0 {
		return nil, fmt.Errorf("empty profiles")
	}

	profiles := make([]loginProfile, 0, len(configured))
	for _, configuredProfile := range configured {
		if configuredProfile == nil || configuredProfile.Username == "" {
			return nil, fmt.Errorf("invalid profile")
		}
		if len(configuredProfile.Uuid) != len(UUID{}) {
			return nil, fmt.Errorf("bad profile UUID length: %d", len(configuredProfile.Uuid))
		}
		if configuredProfile.TexturesValue == "" || configuredProfile.TexturesSignature == "" {
			return nil, fmt.Errorf("incomplete profile textures")
		}

		profile := loginProfile{
			Username:          configuredProfile.Username,
			TexturesValue:     configuredProfile.TexturesValue,
			TexturesSignature: configuredProfile.TexturesSignature,
		}
		copy(profile.UUID[:], configuredProfile.Uuid)
		profiles = append(profiles, profile)
	}
	return profiles, nil
}

View on GitHub (pinned to 7d214f8b09)

Solutions

  1. Set a valid Minecraft username on every profile entry.
  2. Check for key-name or case mismatches between your config and the Profile struct fields.
  3. Remove null/placeholder entries from the array.
  4. Trim and validate usernames in whatever pipeline generates the config.

Example fix

// before
{"userName": "steve", ...}
// after
{"username": "steve", ...}
Defensive patterns

Strategy: validation

Validate before calling

func validProfile(p *Profile) bool {
    return p != nil && strings.TrimSpace(p.Username) != ""
}

Prevention

When it happens

Trigger: A profiles array containing null, {}, or an object whose username key is misspelled (so it unmarshals to "") or explicitly set to "".

Common situations: JSON key casing mismatch ("userName" vs "username") silently yielding an empty string; YAML profile entries with only a comment; templating loops that emit an empty entry for a missing secret.

Related errors


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