You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get Exception on new LiteDatabase(connectionString); LiteDB.LiteException: Cannot insert duplicate key in unique index '_id'. The duplicate value is '"azAZ09"'.
Code to Reproduce
new LiteDatabase("Upgrade=true; Filename=usersv4.db;");
Expected behavior
I was really hoping for a smooth upgrade from v4 to v5 databases since I work in a production environment.
Screenshots/Stacktrace
[DB] Load error: LiteDB.LiteException: Cannot insert duplicate key in unique index '_id'. The duplicate value is 'azAZ09'.
at LiteDB.Engine.IndexService.AddNode (LiteDB.Engine.CollectionIndex index, LiteDB.BsonValue key, LiteDB.Engine.PageAddress dataBlock, System.Byte level, LiteDB.Engine.IndexNode last) [0x00128] in <b80fc713aed144279006f0797bd35ed4>:0
at LiteDB.Engine.IndexService.AddNode (LiteDB.Engine.CollectionIndex index, LiteDB.BsonValue key, LiteDB.Engine.PageAddress dataBlock, LiteDB.Engine.IndexNode last) [0x00055] in <b80fc713aed144279006f0797bd35ed4>:0
at LiteDB.Engine.LiteEngine.InsertDocument (LiteDB.Engine.Snapshot snapshot, LiteDB.BsonDocument doc, LiteDB.BsonAutoId autoId, LiteDB.Engine.IndexService indexer, LiteDB.Engine.DataService data) [0x000f3] in <b80fc713aed144279006f0797bd35ed4>:0
at LiteDB.Engine.LiteEngine.RebuildContent (LiteDB.Engine.IFileReader reader) [0x00130] in <b80fc713aed144279006f0797bd35ed4>:0
at LiteDB.Engine.LiteEngine.Upgrade (System.String filename, System.String password) [0x00133] in <b80fc713aed144279006f0797bd35ed4>:0
at LiteDB.LiteDatabase..ctor (LiteDB.ConnectionString connectionString, LiteDB.BsonMapper mapper) [0x00039] in <b80fc713aed144279006f0797bd35ed4>:0
at LiteDB.LiteDatabase..ctor (System.String connectionString, LiteDB.BsonMapper mapper) [0x00007] in <b80fc713aed144279006f0797bd35ed4>:0
at BrokeProtocol.Server.LiteDB.Driver.CJCEPPOGFEG () [0x0001c] in <69fa3b45e17a42a98d5e2c6a47ea61ef>:0
The text was updated successfully, but these errors were encountered:
@NongBenz This issue is happening because there is an user with id azAZ09 and another one with id azaz09, and LiteDB uses CompareOptions.IgnoreCase by default. If you checkout the latest master and add Collation=en-US/None; to your connection string, you should be able to upgrade your datafile.
Version
Latest Master branch 5.0.8 (abe624)
Describe the bug
Trying to Upgrade v4 DB to v5 (loading with Connection String: "Upgrade=true;")
V4 Database hosted on Google Drive (25MB):
https://drive.google.com/file/d/13kP-boXDHsfJ9WP6IBx-LMpFdPUv7zMk/view?usp=sharing
Get Exception on new LiteDatabase(connectionString);
LiteDB.LiteException: Cannot insert duplicate key in unique index '_id'. The duplicate value is '"azAZ09"'.
Code to Reproduce
new LiteDatabase("Upgrade=true; Filename=usersv4.db;");
Expected behavior
I was really hoping for a smooth upgrade from v4 to v5 databases since I work in a production environment.
Screenshots/Stacktrace
The text was updated successfully, but these errors were encountered: