Beatmap import fails when multiple difficulties have the same BeatmapID
See original GitHub issueWhen importing a beatmapset that has multiple difficulties (2 are enough) which have the same “BeatmapID” set in the .osu files, osu!lazer will throw an error and fail to import the beatmapset.
In the log files this looks similar to this:
07.07.2018 22:49:51: Failed executing DbCommand (2ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?' (Size = 64), @p8='?', @p9='?', @p10='?' (Size = 32), @p11='?', @p12='?', @p13='?' (Size = 83), @p14='?', @p15='?', @p16='?', @p17='?', @p18='?' (Size = 30), @p19='?', @p20='?' (Size = 13), @p21='?'], CommandType='Text', CommandTimeout='10']
07.07.2018 22:49:51: INSERT INTO "BeatmapInfo" ("AudioLeadIn", "BaseDifficultyID", "BeatDivisor", "BeatmapSetInfoID", "Countdown", "DistanceSpacing", "GridSize", "Hash", "Hidden", "LetterboxInBreaks", "MD5Hash", "MetadataID", "OnlineBeatmapID", "Path", "RulesetID", "SpecialStyle", "StackLeniency", "StarDifficulty", "StoredBookmarks", "TimelineZoom", "Version", "WidescreenStoryboard")
07.07.2018 22:49:51: VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13, @p14, @p15, @p16, @p17, @p18, @p19, @p20, @p21);
07.07.2018 22:49:51: SELECT "ID"
07.07.2018 22:49:51: FROM "BeatmapInfo"
07.07.2018 22:49:51: WHERE changes() = 1 AND "ID" = last_insert_rowid();
07.07.2018 22:49:51: An exception occurred in the database while saving changes for context type 'osu.Game.Database.OsuDbContext'.
07.07.2018 22:49:51: Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> Microsoft.Data.Sqlite.SqliteException: SQLite Error 19: 'UNIQUE constraint failed: BeatmapInfo.OnlineBeatmapID'.
07.07.2018 22:49:51: bei Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
07.07.2018 22:49:51: bei Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
07.07.2018 22:49:51: --- Ende der internen Ausnahmestapelüberwachung ---
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(DbContext _, ValueTuple`2 parameters)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable`1 commandBatches, IRelationalConnection connection)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IReadOnlyList`1 entriesToSave)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess)
07.07.2018 22:49:51: Failed executing DbCommand (0ms) [Parameters=[@p10='?', @p11='?' (Size = 64), @p12='?', @p13='?', @p14='?'], CommandType='Text', CommandTimeout='10']
07.07.2018 22:49:51: INSERT INTO "BeatmapSetInfo" ("DeletePending", "Hash", "MetadataID", "OnlineBeatmapSetID", "Protected")
07.07.2018 22:49:51: VALUES (@p10, @p11, @p12, @p13, @p14);
07.07.2018 22:49:51: SELECT "ID"
07.07.2018 22:49:51: FROM "BeatmapSetInfo"
07.07.2018 22:49:51: WHERE changes() = 1 AND "ID" = last_insert_rowid();
07.07.2018 22:49:51: An exception occurred in the database while saving changes for context type 'osu.Game.Database.OsuDbContext'.
07.07.2018 22:49:51: Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> Microsoft.Data.Sqlite.SqliteException: SQLite Error 19: 'UNIQUE constraint failed: BeatmapSetInfo.OnlineBeatmapSetID'.
07.07.2018 22:49:51: bei Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
07.07.2018 22:49:51: bei Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
07.07.2018 22:49:51: --- Ende der internen Ausnahmestapelüberwachung ---
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(DbContext _, ValueTuple`2 parameters)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable`1 commandBatches, IRelationalConnection connection)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IReadOnlyList`1 entriesToSave)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess)
07.07.2018 22:49:51: Import of 358119 Sarah Connor - Cold As Ice (PH Electro Nightcore Mix) failed and has been rolled back.
07.07.2018 22:49:51: Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> Microsoft.Data.Sqlite.SqliteException: SQLite Error 19: 'UNIQUE constraint failed: BeatmapSetInfo.OnlineBeatmapSetID'.
07.07.2018 22:49:51: bei Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
07.07.2018 22:49:51: bei Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
07.07.2018 22:49:51: --- Ende der internen Ausnahmestapelüberwachung ---
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(DbContext _, ValueTuple`2 parameters)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable`1 commandBatches, IRelationalConnection connection)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IReadOnlyList`1 entriesToSave)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess)
07.07.2018 22:49:51: bei Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess)
07.07.2018 22:49:51: bei osu.Game.Database.DatabaseWriteUsage.Dispose(Boolean disposing)
07.07.2018 22:49:51: bei osu.Game.Database.DatabaseWriteUsage.Dispose()
07.07.2018 22:49:51: bei osu.Game.Database.ArchiveModelManager`2.Import(ArchiveReader archive)
Easily reproducable with the beatmaps Shadow gate to love and Monster. Log file: database.log
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
Some maps keep failing to import · Issue #2742 · ppy/osu
So I am assuming imports for multiple beatmaps with the same BeatmapID is not intended? As such beatmaps still are not able to...
Read more >[resolved] Adding a new difficulty · forum - Osu! - ppy
Hello! I'm trying to make a beatmap with an easy difficulty and a hard difficulty. I hit file>create new difficulty, and it created...
Read more >Beatmap difficulty calculation problem. Need Help.
So whenever at a difficulty selection screen I always see this notification : beatmap difficulty calculation is running in the background.
Read more >Trying to add more songs onto my beatmap : r/osugame
Put multiple audio files in the map's folder (File -> Open Song/Map Folder), then create a new difficulty in osu, go back to...
Read more >Importing beatmaps and skins - osu!mac - Read the Docs
Click to import¶ · Download a random osu beatmap or skin (and get the osz file) · Right click on osu!.app · Click...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Are you going to fix this? If not, please see my last comment.
Is it not a problem if a ranked map doesn’t show any leaderboards even though is has them?