{"record":{"id":"00520cac24a6c5b8","repo":"XTLS/Xray-core","slug":"invalid-profile","errorCode":null,"errorMessage":"invalid profile","messagePattern":"invalid profile","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"transport/internet/finalmask/xmc/profile.go","lineNumber":20,"sourceCode":"\nimport \"fmt\"\n\ntype loginProfile struct {\n\tUsername          string\n\tUUID              UUID\n\tTexturesValue     string\n\tTexturesSignature string\n}\n\nfunc profilesFromConfig(configured []*Profile) ([]loginProfile, error) {\n\tif len(configured) == 0 {\n\t\treturn nil, fmt.Errorf(\"empty profiles\")\n\t}\n\n\tprofiles := make([]loginProfile, 0, len(configured))\n\tfor _, configuredProfile := range configured {\n\t\tif configuredProfile == nil || configuredProfile.Username == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"invalid profile\")\n\t\t}\n\t\tif len(configuredProfile.Uuid) != len(UUID{}) {\n\t\t\treturn nil, fmt.Errorf(\"bad profile UUID length: %d\", len(configuredProfile.Uuid))\n\t\t}\n\t\tif configuredProfile.TexturesValue == \"\" || configuredProfile.TexturesSignature == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"incomplete profile textures\")\n\t\t}\n\n\t\tprofile := loginProfile{\n\t\t\tUsername:          configuredProfile.Username,\n\t\t\tTexturesValue:     configuredProfile.TexturesValue,\n\t\t\tTexturesSignature: configuredProfile.TexturesSignature,\n\t\t}\n\t\tcopy(profile.UUID[:], configuredProfile.Uuid)\n\t\tprofiles = append(profiles, profile)\n\t}\n\treturn profiles, nil\n}","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/transport/internet/finalmask/xmc/profile.go#L2-L38","documentation":"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.","triggerScenarios":"A profiles array containing null, {}, or an object whose username key is misspelled (so it unmarshals to \"\") or explicitly set to \"\".","commonSituations":"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.","solutions":["Set a valid Minecraft username on every profile entry.","Check for key-name or case mismatches between your config and the Profile struct fields.","Remove null/placeholder entries from the array.","Trim and validate usernames in whatever pipeline generates the config."],"exampleFix":"// before\n{\"userName\": \"steve\", ...}\n// after\n{\"username\": \"steve\", ...}","handlingStrategy":"validation","validationCode":"func validProfile(p *Profile) bool {\n    return p != nil && strings.TrimSpace(p.Username) != \"\"\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify username key spelling/casing against the config struct.","Reject null or username-less entries at config load.","Run a config dry-run/validation mode before deploying."],"tags":["go","configuration","minecraft","authentication","validation"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}