{"record":{"id":"09e836494ac90000","repo":"XTLS/Xray-core","slug":"empty-profiles-09e836","errorCode":null,"errorMessage":"empty profiles","messagePattern":"empty profiles","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"transport/internet/finalmask/xmc/profile.go","lineNumber":14,"sourceCode":"package xmc\n\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,","sourceCodeStart":1,"sourceCodeEnd":32,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/transport/internet/finalmask/xmc/profile.go#L1-L32","documentation":"profilesFromConfig requires at least one configured Profile for the xmc (Minecraft-protocol) transport; it is invoked from both client and server config builders (config.go:12 and config.go:25). With no profiles there is no login identity (username/UUID/textures) to present or accept, so the transport refuses to start.","triggerScenarios":"Creating an xmc inbound/outbound whose JSON config has an empty, missing, or null \"profiles\" array.","commonSituations":"Copying an xmc config template and deleting the profiles block; generating config programmatically and serializing an empty slice as absent; expecting the transport to work like a generic proxy without Minecraft login data.","solutions":["Add at least one profile object with username, uuid, texturesValue, and texturesSignature to the xmc settings.","If profiles come from an external source, fail config generation early when the list is empty rather than passing it through.","Verify the JSON key name matches the config struct (Profile fields) so unmarshalling actually populates the slice."],"exampleFix":"// before\n\"profiles\": []\n// after\n\"profiles\": [{\"username\": \"steve\", \"uuid\": \"<16 raw bytes b64>\", \"texturesValue\": \"...\", \"texturesSignature\": \"...\"}]","handlingStrategy":"validation","validationCode":"if len(cfg.Profiles) == 0 {\n    return errors.New(\"xmc: at least one profile is required\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fail config generation early when the profiles list is empty.","Include a complete example profile in config templates.","Check that the JSON key matches the Profile struct so unmarshal populates the field."],"tags":["go","configuration","minecraft","authentication"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}