question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Beatmap import fails when multiple difficulties have the same BeatmapID

See original GitHub issue

When 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:closed
  • Created 5 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
peppycommented, Jul 10, 2018

Are you going to fix this? If not, please see my last comment.

0reactions
Morillicommented, Jul 10, 2018

Is it not a problem if a ranked map doesn’t show any leaderboards even though is has them?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found