LiteDB: v5 Beta - LiteException: Invalid DataPage buffer on 0

Great work on v5 but after a while got this during a routine Upsert call for saving player data and not sure what to look for.

One thing I noticed is that FindByID(x) doesn’t seem to work when you have a ulong (SteamID) as the BSON Id. Though FindOne(x => x.ID == steamID)) works fine. Database stores it as Int64 but might be casting to something weird in FindByID. We’re switching to string IDs to get around it for now.

LiteException: Invalid DataPage buffer on 0 at LiteDB.Engine.DataPage…ctor (LiteDB.Engine.PageBuffer buffer) [0x0002b] in <5655f9bdd3d648afba544285415ebde5>:0 at LiteDB.Engine.BasePage.ReadPage[T] (LiteDB.Engine.PageBuffer buffer) [0x000b7] in <5655f9bdd3d648afba544285415ebde5>:0 at LiteDB.Engine.Snapshot.ReadPage[T] (System.UInt32 pageID) [0x000a6] in <5655f9bdd3d648afba544285415ebde5>:0 at LiteDB.Engine.Snapshot.GetPage[T] (System.UInt32 pageID) [0x00017] in <5655f9bdd3d648afba544285415ebde5>:0 at LiteDB.Engine.DataService.Delete (LiteDB.Engine.PageAddress blockAddress) [0x00002] in <5655f9bdd3d648afba544285415ebde5>:0 at LiteDB.Engine.DataService+<>c__DisplayClass4_0+<<Update>g__source|0>d.MoveNext () [0x001ef] in <5655f9bdd3d648afba544285415ebde5>:0 at LiteDB.Engine.BufferWriter.MoveFordward (System.Int32 count) [0x00041] in <5655f9bdd3d648afba544285415ebde5>:0 at LiteDB.Engine.BufferWriter.Write (System.Byte value) [0x00012] in <5655f9bdd3d648afba544285415ebde5>:0 at LiteDB.Engine.BufferWriter.WriteDocument (LiteDB.BsonDocument value, System.Boolean recalc) [0x0004c] in <5655f9bdd3d648afba544285415ebde5>:0 at LiteDB.Engine.DataService.Update (LiteDB.Engine.CollectionPage col, LiteDB.Engine.PageAddress blockAddress, LiteDB.BsonDocument doc) [0x00060] in <5655f9bdd3d648afba544285415ebde5>:0 at LiteDB.Engine.LiteEngine.UpdateDocument (LiteDB.Engine.Snapshot snapshot, LiteDB.Engine.CollectionPage col, LiteDB.BsonDocument doc, LiteDB.Engine.IndexService indexer, LiteDB.Engine.DataService data) [0x00055] in <5655f9bdd3d648afba544285415ebde5>:0 at LiteDB.Engine.LiteEngine+<>c__DisplayClass29_0.<Upsert>b__0 (LiteDB.Engine.TransactionService transaction) [0x0005d] in <5655f9bdd3d648afba544285415ebde5>:0 at LiteDB.Engine.LiteEngine.AutoTransaction[T] (System.Func2[T,TResult] fn) [0x00033] in <5655f9bdd3d648afba544285415ebde5>:0 at LiteDB.Engine.LiteEngine.Upsert (System.String collection, System.Collections.Generic.IEnumerable1[T] docs, LiteDB.BsonAutoId autoId) [0x0004d] in <5655f9bdd3d648afba544285415ebde5>:0 at LiteDB.LiteCollection1[T].Upsert (System.Collections.Generic.IEnumerable1[T] documents) [0x00026] in <5655f9bdd3d648afba544285415ebde5>:0 at LiteDB.LiteCollection`1[T].Upsert (T document) [0x00013] in <5655f9bdd3d648afba544285415ebde5>:0 at BrokeProtocol.Entities.SvPlayer.Save () [0x00581] in <5067e8634c824346a184df1cd5594501>:0

ps. Small typo on LiteDB.Engine.BufferWriter.MoveFordward

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 23 (6 by maintainers)

Most upvoted comments

Yes, I have update my test code to also delete litedb log file and now test is green every time. Looks like there should a check, when litedb creates new database file, that there is already a log file and it is has incompatible data