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.

v5 Beta - LiteException: Invalid DataPage buffer on 0

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:23 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
maxbl4commented, Feb 17, 2020

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

0reactions
mbdavidcommented, Feb 21, 2020

Hi @nabeelio, that’s very important for LiteDB. Any bug that can corrupt database is my TOP priority. If you get again, open that I will take a closer look. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

v5 Beta - LiteException: Invalid DataPage buffer on 0
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...
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