{"record":{"id":"35cd1da78151e83d","repo":"XTLS/Xray-core","slug":"build-minecraft-profile-d-w","errorCode":null,"errorMessage":"build minecraft profile %d: %w","messagePattern":"build minecraft profile (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/transport_finalmask.go","lineNumber":784,"sourceCode":"\tif c.Password == \"\" {\n\t\treturn nil, fmt.Errorf(\"empty password\")\n\t}\n\n\trsaPrivateKey, err := xmc.DeriveRSAKey(c.Password)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"derive minecraft rsa key: %w\", err)\n\t}\n\n\trsaPublicKey, err := x509.MarshalPKIXPublicKey(&rsaPrivateKey.PublicKey)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"marshal minecraft rsa public key: %w\", err)\n\t}\n\n\tprofiles := make([]*xmc.Profile, 0, len(c.Profiles))\n\tfor i := range c.Profiles {\n\t\tprofile, err := c.Profiles[i].Build()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"build minecraft profile %d: %w\", i, err)\n\t\t}\n\t\tprofiles = append(profiles, profile)\n\t}\n\n\treturn &xmc.Config{\n\t\tPassword:      c.Password,\n\t\tHostname:      c.Hostname,\n\t\tRsaPrivateKey: x509.MarshalPKCS1PrivateKey(rsaPrivateKey),\n\t\tRsaPublicKey:  rsaPublicKey,\n\t\tProfiles:      profiles,\n\t}, nil\n}\n\ntype Xicmp struct {\n\tDGRAM bool     `json:\"dgram\"`\n\tIPs   []string `json:\"ips\"`\n}\n","sourceCodeStart":766,"sourceCodeEnd":802,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/transport_finalmask.go#L766-L802","documentation":"XMC.Build loops over the configured profiles and calls XMCProfile.Build on each; any per-profile failure is wrapped with the zero-based index %d so you can locate the offending entry. The inner error is one of: invalid username, invalid UUID, or incomplete textures.","triggerScenarios":"An xmc profiles array where element at the reported index has a bad username, unparseable UUID, or missing texturesValue/texturesSignature.","commonSituations":"Multiple profiles where only one was hastily filled in; index reported is 0-based — developers sometimes edit the wrong (1-based) entry.","solutions":["Use the index in the message to select profiles[i] (0-based) and read the inner error","Fix that entry per the inner error: username regex, UUID format, or both texture fields","Re-validate the whole list, not just the failing entry"],"exampleFix":"// error: build minecraft profile 1: invalid minecraft profile UUID...\n// before\n\"profiles\": [ {ok...}, { \"username\": \"Alex\", \"uuid\": \"nope\" } ]\n// after\n\"profiles\": [ {ok...}, { \"username\": \"Alex\", \"uuid\": \"e5206dbd-...-c1a1d\" } ]","handlingStrategy":"validation","validationCode":"func validateXmcProfiles(profiles []XMCProfile) error {\n    for i, p := range profiles {\n        if !xmcUsernameRe.MatchString(p.Username) { return fmt.Errorf(\"profile %d: bad username\", i) }\n        if _, err := uuid.Parse(p.UUID); err != nil { return fmt.Errorf(\"profile %d: bad uuid\", i) }\n        if p.TexturesValue == \"\" || p.TexturesSignature == \"\" { return fmt.Errorf(\"profile %d: missing textures\", i) }\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the full list up front; the runtime error index is 0-based","Centralize profile building so each entry is checked once"],"tags":["xmc","minecraft","config","validation"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}