{"record":{"id":"28ba091ab087a55c","repo":"ppy/osu","slug":"difficulty-playablebeatmap-beatmapinfo-difficul","errorCode":null,"errorMessage":"Difficulty \"\"{playableBeatmap.BeatmapInfo.DifficultyName}\"\" has BeatmapID {playableBeatmap.BeatmapInfo.OnlineID} that has not been assigned to it by the server!","messagePattern":"Difficulty \"\"(.+?)\"\" has BeatmapID (.+?) that has not been assigned to it by the server!","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"osu.Game/Screens/Edit/Submission/SubmissionBeatmapExporter.cs","lineNumber":42,"sourceCode":"        }\r\n\r\n        protected override void MutateBeatmap(BeatmapSetInfo beatmapSet, IBeatmap playableBeatmap)\r\n        {\r\n            base.MutateBeatmap(beatmapSet, playableBeatmap);\r\n\r\n            if (beatmapSetId != null && allocatedBeatmapIds != null)\r\n            {\r\n                playableBeatmap.BeatmapInfo.BeatmapSet = beatmapSet;\r\n                playableBeatmap.BeatmapInfo.BeatmapSet!.OnlineID = (int)beatmapSetId;\r\n\r\n                if (allocatedBeatmapIds.Contains(playableBeatmap.BeatmapInfo.OnlineID))\r\n                {\r\n                    allocatedBeatmapIds.Remove(playableBeatmap.BeatmapInfo.OnlineID);\r\n                    return;\r\n                }\r\n\r\n                if (playableBeatmap.BeatmapInfo.OnlineID > 0)\r\n                    throw new InvalidOperationException($@\"Difficulty \"\"{playableBeatmap.BeatmapInfo.DifficultyName}\"\" has BeatmapID {playableBeatmap.BeatmapInfo.OnlineID} that has not been assigned to it by the server!\");\r\n\r\n                if (allocatedBeatmapIds.Count == 0)\r\n                    throw new InvalidOperationException(@\"Ran out of new beatmap IDs to assign to unsubmitted beatmaps!\");\r\n\r\n                int newId = allocatedBeatmapIds.First();\r\n                allocatedBeatmapIds.Remove(newId);\r\n                playableBeatmap.BeatmapInfo.OnlineID = newId;\r\n            }\r\n        }\r\n    }\r\n}\r\n","sourceCodeStart":24,"sourceCodeEnd":54,"githubUrl":"https://github.com/ppy/osu/blob/d9c73e12adff2feaae4a3e158d36fe5883faf6ca/osu.Game/Screens/Edit/Submission/SubmissionBeatmapExporter.cs#L24-L54","documentation":"Thrown during beatmap submission when a difficulty's OnlineID is positive (> 0) but is not present in the server-allocated allocatedBeatmapIds list. This signals an inconsistency: the beatmap claims an existing online ID that the server did not allocate for this submission, indicating stale/cached IDs or a set-merge conflict.","triggerScenarios":"A playable beatmap has BeatmapInfo.OnlineID set to a positive value that is not in allocatedBeatmapIds during submission. The exporter refuses to silently attach an unallocated ID.","commonSituations":"Re-submitting a beatmap set after a server-side ID reset; merging beatmaps from different sets whose online IDs collide; a previous failed submission left stale OnlineIDs on difficulties.","solutions":["Clear BeatmapInfo.OnlineID (set to -1 or 0) for difficulties being (re-)submitted so the server allocates fresh IDs.","Verify allocatedBeatmapIds was returned for the correct beatmap set before submission.","If resubmitting, request a fresh allocation from the server rather than reusing cached OnlineIDs.","Audit submission flow to ensure OnlineIDs are only set from server responses."],"exampleFix":"// before\nif (playableBeatmap.BeatmapInfo.OnlineID > 0)\n    throw new InvalidOperationException(...);\n\n// after (reset before submit)\nforeach (var b in beatmapSet.Beatmaps)\n    b.OnlineID = -1; // let server allocate\n// ... then submit","handlingStrategy":"validation","validationCode":"if (beatmap.OnlineID > 0 && !allocatedBeatmapIds.Contains(beatmap.OnlineID))\n    beatmap.OnlineID = -1; // reset to let the server allocate","typeGuard":null,"tryCatchPattern":"try { exporter.Export(playableBeatmap, beatmapSetId, allocatedBeatmapIds); }\ncatch (InvalidOperationException) { /* reset IDs and retry */ }","preventionTips":["Clear stale OnlineIDs before (re-)submission.","Only set OnlineIDs from server allocation responses.","Ensure allocatedBeatmapIds corresponds to the correct beatmap set."],"tags":["beatmap","submission","online-id","server"],"backgroundTag":null,"analyzedSha":"d9c73e12adff2feaae4a3e158d36fe5883faf6ca","analyzedAt":"2026-08-13T14:12:54.015Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}