mbdavid / LiteDB

LiteDB - A .NET NoSQL Document Store in a single data file
http://www.litedb.org
MIT License
8.62k stars 1.25k forks source link

[BUG] System.Exception: LiteDB ENSURE: page type must be collection page #2340

Open goodatech opened 1 year ago

goodatech commented 1 year ago

Version Which LiteDB version/OS/.NET framework version are you using. (REQUIRED) Nuget Package v 5.0.16

Describe the bug A clear and concise description of what the bug is.

Constants.ENSURE (System.Boolean conditional, System.String message) System.Exception: LiteDB ENSURE: page type must be collection page

Code to Reproduce Write a small snippet to isolate your bug and could be possible to our team test. (REQUIRED) Not sure speicifically what method would be causing this. I updated the nuget package from a previous version. The error

Expected behavior A clear and concise description of what you expected to happen. No exception

Screenshots/Stacktrace If applicable, add screenshots/stacktrace

Constants.ENSURE (System.Boolean conditional, System.String message) LiteDB.Engine.CollectionPage..ctor (LiteDB.Engine.PageBuffer buffer) [0x00024] in <39f07bfc11864c4f838bdff3f73f86b9>:0 BasePage.ReadPage[T] (LiteDB.Engine.PageBuffer buffer) Snapshot.ReadPage[T] (System.UInt32 pageID, LiteDB.Engine.FileOrigin& origin, System.Int64& position, System.Int32& walVersion) Snapshot.GetPage[T] (System.UInt32 pageID, LiteDB.Engine.FileOrigin& origin, System.Int64& position, System.Int32& walVersion) Snapshot.GetPage[T] (System.UInt32 pageID) CollectionService.Get (System.String name, System.Boolean addIfNotExists, LiteDB.Engine.CollectionPage& collectionPage) LiteDB.Engine.Snapshot..ctor (LiteDB.Engine.LockMode mode, System.String collectionName, LiteDB.Engine.HeaderPage header, System.UInt32 transactionID, LiteDB.Engine.TransactionPages transPages, LiteDB.Engine.LockService locker, LiteDB.Engine.WalIndexService walIndex, LiteDB.Engine.DiskReader reader, System.Boolean addIfNotExists) [0x00086] in <39f07bfc11864c4f838bdff3f73f86b9>:0 TransactionService.gcreate|43_0 (LiteDB.Engine.TransactionService+<>c__DisplayClass43_0& ) TransactionService.CreateSnapshot (LiteDB.Engine.LockMode mode, System.String collection, System.Boolean addIfNotExists) QueryExecutor+<>cDisplayClass10_0+<gRunQuery|0>d.MoveNext () LiteDB.BsonDataReader..ctor (System.Collections.Generic.IEnumerable1[T] values, System.String collection) [0x00019] in <39f07bfc11864c4f838bdff3f73f86b9>:0 QueryExecutor.ExecuteQuery (System.Boolean executionPlan) QueryExecutor.ExecuteQuery () LiteEngine.Query (System.String collection, LiteDB.Query query) LiteQueryable1[T].ExecuteReader () LiteQueryable`1+d26[T].MoveNext () Enumerable.Single[TSource] (System.Collections.Generic.IEnumerable1[T] source) LiteQueryable1[T].Exists () LiteCollection`1[T].Exists (LiteDB.BsonExpression predicate) AppDataAccess.HasVersion (System.String version) DbSetup.InitAsync () AppService.InitAsync () App.InitAsync (System.Object sender, System.EventArgs args) AsyncMethodBuilderCore+<>c.b7_0 (System.Object state) SyncContext+<>c__DisplayClass2_0.b0 () Thread+RunnableImplementor.Run () IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) JNINativeWrapper.Wrap_JniMarshal_PP_V (_JniMarshal_PP_V callback, System.IntPtr jnienv, System.IntPtr klazz)

Additional context Add any other context about the problem here.

lwf163 commented 1 year ago

we also get this mistake.

ArtjomP commented 11 months ago

The same bug we've got :(