{"record":{"id":"90a3cefa6ebba6a7","repo":"ppy/osu","slug":"ran-out-of-new-beatmap-ids-to-assign-to-unsubmitte","errorCode":null,"errorMessage":"Ran out of new beatmap IDs to assign to unsubmitted beatmaps!","messagePattern":"Ran out of new beatmap IDs to assign to unsubmitted beatmaps!","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"osu.Game/Screens/Edit/Submission/SubmissionBeatmapExporter.cs","lineNumber":45,"sourceCode":"        {\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":27,"sourceCodeEnd":54,"githubUrl":"https://github.com/ppy/osu/blob/d9c73e12adff2feaae4a3e158d36fe5883faf6ca/osu.Game/Screens/Edit/Submission/SubmissionBeatmapExporter.cs#L27-L54","documentation":"Thrown during beatmap submission when allocatedBeatmapIds.Count == 0 but there are still unsubmitted difficulties needing IDs. The server pre-allocated a finite batch of beatmap IDs and the local set has more difficulties than IDs available.","triggerScenarios":"Submitting a beatmap set where the number of new (OnlineID <= 0) difficulties exceeds the count of IDs returned by the server's allocation endpoint.","commonSituations":"Adding many difficulties to a set in one submission; server allocation quota exhausted; client requested too few IDs from the allocation endpoint.","solutions":["Request a larger allocation batch from the server before submitting (increase the requested ID count).","Reduce the number of new difficulties submitted in a single operation.","Retry submission after the server grants additional IDs.","Check the allocation request parameter that specifies how many IDs are needed."],"exampleFix":"// before\nif (allocatedBeatmapIds.Count == 0)\n    throw new InvalidOperationException(@\"Ran out of new beatmap IDs to assign to unsubmitted beatmaps!\");\n\n// after (precompute need)\nint needed = beatmapSet.Beatmaps.Count(b => b.OnlineID <= 0);\nif (allocatedBeatmapIds.Count < needed)\n    throw new InvalidOperationException($\"Need {needed} IDs but server allocated {allocatedBeatmapIds.Count}.\");","handlingStrategy":"validation","validationCode":"int needed = beatmapSet.Beatmaps.Count(b => b.OnlineID <= 0);\nif (allocatedBeatmapIds.Count < needed)\n    throw new InvalidOperationException($\"Need {needed} IDs; have {allocatedBeatmapIds.Count}.\");","typeGuard":null,"tryCatchPattern":"try { exporter.Export(...); }\ncatch (InvalidOperationException) { /* re-request allocation, retry */ }","preventionTips":["Compute the number of new difficulties and request that many IDs from the server.","Split large submissions to fit the allocation quota.","Retry after obtaining more IDs."],"tags":["beatmap","submission","online-id","quota","server"],"backgroundTag":null,"analyzedSha":"d9c73e12adff2feaae4a3e158d36fe5883faf6ca","analyzedAt":"2026-08-13T14:12:54.015Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}