{"record":{"id":"fa5087f00c432657","repo":"ppy/osu","slug":"no-valid-beatmap-files-found-in-the-beatmap-archiv","errorCode":null,"errorMessage":"No valid beatmap files found in the beatmap archive.","messagePattern":"No valid beatmap files found in the beatmap archive\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"osu.Game/Beatmaps/BeatmapImporter.cs","lineNumber":454,"sourceCode":"                    };\r\n\r\n                    var beatmap = new BeatmapInfo(ruleset, difficulty, metadata)\r\n                    {\r\n                        Hash = hash,\r\n                        DifficultyName = decodedInfo.DifficultyName,\r\n                        OnlineID = decodedInfo.OnlineID,\r\n                        BeatDivisor = decodedInfo.BeatDivisor,\r\n                        MD5Hash = memoryStream.ComputeMD5Hash(),\r\n                        EndTimeObjectCount = decoded.HitObjects.Count(h => h is IHasDuration),\r\n                        TotalObjectCount = decoded.HitObjects.Count\r\n                    };\r\n\r\n                    beatmaps.Add(beatmap);\r\n                }\r\n            }\r\n\r\n            if (!beatmaps.Any())\r\n                throw new ArgumentException(\"No valid beatmap files found in the beatmap archive.\");\r\n\r\n            return beatmaps;\r\n        }\r\n    }\r\n}\r\n","sourceCodeStart":436,"sourceCodeEnd":460,"githubUrl":"https://github.com/ppy/osu/blob/d9c73e12adff2feaae4a3e158d36fe5883faf6ca/osu.Game/Beatmaps/BeatmapImporter.cs#L436-L460","documentation":"Thrown by BeatmapImporter when, after iterating every file inside an imported beatmap archive, zero valid beatmap (.osu) files were decoded and added to the result list. The archive either contained no .osu files at all, or every .osu file failed to decode and was skipped silently during the loop.","triggerScenarios":"Calling beatmap import with an archive (zip, directory, or single file) that contains no decodable .osu beatmap files — e.g. a zip with only audio/images, a skin archive mistaken for a beatmap, or .osu files whose first-line magic doesn't match any registered decoder so they produce no BeatmapInfo.","commonSituations":"User drags a skin zip onto the beatmap import window; a corrupt or partially downloaded archive where the .osu files are truncated; a packaged mapset where .osu files were deleted or renamed with an unrecognized extension before zipping.","solutions":["Verify the archive actually contains .osu files before importing — open the zip and confirm the presence of beatmap files.","Ensure the .osu files start with the correct format magic (e.g. 'osu file format vN') so the decoder can identify them.","If the archive is a skin or other non-beatmap content, route it through the correct importer instead of BeatmapImporter.","If files exist but fail to decode, check Decoder.GetDecoder logs for which files were skipped and fix the root cause (truncation, encoding, format corruption)."],"exampleFix":"// before\nvar importTask = new ImportTask(path);\nbeatmapImporter.Import(importTask); // throws if no .osu files\n\n// after\nusing var reader = importTask.GetReader();\nbool hasBeatmapFiles = reader.Filenames.Any(f => f.EndsWith(\".osu\", StringComparison.OrdinalIgnoreCase));\nif (!hasBeatmapFiles)\n    throw new InvalidOperationException($\"{path} contains no .osu beatmap files\");\nbeatmapImporter.Import(new ImportTask(path));","handlingStrategy":"validation","validationCode":"// Check archive contents before importing\nusing var reader = importTask.GetReader();\nbool hasBeatmapFiles = reader.Filenames\n    .Any(f => f.EndsWith(\".osu\", StringComparison.OrdinalIgnoreCase));\nif (!hasBeatmapFiles)\n    throw new InvalidOperationException(\"Archive contains no .osu files\");","typeGuard":null,"tryCatchPattern":"try\n{\n    beatmapImporter.Import(task);\n}\ncatch (ArgumentException ex) when (ex.Message.Contains(\"No valid beatmap files\"))\n{\n    Logger.Log($\"Import failed: archive has no valid beatmaps\", LoggingTarget.Database);\n}","preventionTips":["Validate archive contents before passing to BeatmapImporter.","Distinguish beatmap archives from skin/other archives at the user-interaction layer.","Log which files inside the archive failed to decode for easier diagnosis."],"tags":["beatmap-import","archive","osu-format","validation"],"backgroundTag":null,"analyzedSha":"d9c73e12adff2feaae4a3e158d36fe5883faf6ca","analyzedAt":"2026-08-13T14:12:54.015Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}