{"record":{"id":"ec5cce3b2ad3c5a3","repo":"ppy/osu","slug":"beatmap-submission-not-supported-in-this-configura-ec5cce","errorCode":null,"errorMessage":"Beatmap submission not supported in this configuration!","messagePattern":"Beatmap submission not supported in this configuration!","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"osu.Game/Online/API/Requests/ReplaceBeatmapPackageRequest.cs","lineNumber":18,"sourceCode":"// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.\r\n// See the LICENCE file in the repository root for full licence text.\r\n\r\nusing System;\r\nusing System.Net.Http;\r\nusing osu.Framework.IO.Network;\r\n\r\nnamespace osu.Game.Online.API.Requests\r\n{\r\n    public class ReplaceBeatmapPackageRequest : APIUploadRequest\r\n    {\r\n        protected override string Uri\r\n        {\r\n            get\r\n            {\r\n                // can be removed once the service has been successfully deployed to production\r\n                if (API!.Endpoints.BeatmapSubmissionServiceUrl == null)\r\n                    throw new NotSupportedException(\"Beatmap submission not supported in this configuration!\");\r\n\r\n                return $@\"{API!.Endpoints.BeatmapSubmissionServiceUrl}/beatmapsets/{BeatmapSetID}\";\r\n            }\r\n        }\r\n\r\n        protected override string Target => throw new NotSupportedException();\r\n\r\n        public uint BeatmapSetID { get; }\r\n\r\n        private readonly byte[] oszPackage;\r\n\r\n        public ReplaceBeatmapPackageRequest(uint beatmapSetID, byte[] oszPackage)\r\n        {\r\n            this.oszPackage = oszPackage;\r\n            BeatmapSetID = beatmapSetID;\r\n        }\r\n\r\n        protected override WebRequest CreateWebRequest()\r","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/ppy/osu/blob/d9c73e12adff2feaae4a3e158d36fe5883faf6ca/osu.Game/Online/API/Requests/ReplaceBeatmapPackageRequest.cs#L1-L36","documentation":"Thrown by ReplaceBeatmapPackageRequest.Uri getter when API.Endpoints.BeatmapSubmissionServiceUrl is null. This request replaces an entire beatmapset's package (PUT /beatmapsets/{id}); the same production-rollout guard as the other submission requests applies. NotSupportedException indicates feature unavailability.","triggerScenarios":"Constructing/performing a ReplaceBeatmapPackageRequest (full replacement upload for an existing beatmapset) with BeatmapSubmissionServiceUrl unconfigured.","commonSituations":"Editor 'replace submission' path active on a build without the submission service URL; dev environments; pre-production rollout where the feature flag/endpoint isn't set.","solutions":["Configure API.Endpoints.BeatmapSubmissionServiceUrl to enable the submission service.","Hide/disable the replace-submission control when the URL is null.","After production deployment, remove the guard as the comment indicates."],"exampleFix":"// before\nvar req = new ReplaceBeatmapPackageRequest(beatmapSetId, oszBytes);\napi.Perform(req); // NotSupportedException\n\n// after\nif (api.Endpoints.BeatmapSubmissionServiceUrl == null)\n{\n    Notifications.Post(new SimpleNotification { Text = \"Beatmap submission is unavailable in this build.\" });\n    return;\n}\nvar req = new ReplaceBeatmapPackageRequest(beatmapSetId, oszBytes);\napi.Perform(req);","handlingStrategy":"validation","validationCode":"if (api.Endpoints.BeatmapSubmissionServiceUrl == null)\n{ Notifications.Post(new SimpleNotification { Text = \"Beatmap submission is unavailable.\" }); return; }\nvar req = new ReplaceBeatmapPackageRequest(beatmapSetId, oszBytes);","typeGuard":"static bool IsSubmissionEnabled(IAPIEndpointProvider endpoints)\n    => !string.IsNullOrWhiteSpace(endpoints.BeatmapSubmissionServiceUrl);","tryCatchPattern":"try { api.Perform(new ReplaceBeatmapPackageRequest(id, bytes)); }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"Beatmap submission\"))\n{ /* inform user the build lacks the submission endpoint */ }","preventionTips":["Disable replace-submission controls when BeatmapSubmissionServiceUrl is null.","Ensure endpoint configuration ships with builds that expose submission.","Remove the guard after the service reaches production."],"tags":["api","beatmap-submission","configuration","network","endpoints"],"backgroundTag":null,"analyzedSha":"d9c73e12adff2feaae4a3e158d36fe5883faf6ca","analyzedAt":"2026-08-13T14:12:54.015Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}