Open webteamby opened 4 years ago
Another one error in v.5.0.0-beta:
System.NotImplementedException: The method or operation is not implemented.
at LiteDB.BufferSliceExtensions.ReadIndexKey(BufferSlice buffer, Int32 offset)
at LiteDB.Engine.IndexNode..ctor(IndexPage page, Byte index, BufferSlice segment)
at LiteDB.Engine.IndexService.Find(CollectionIndex index, BsonValue value, Boolean sibling, Int32 order)
at LiteDB.Engine.IndexEquals.Execute(IndexService indexer, CollectionIndex index)+MoveNext()
at LiteDB.Engine.BasePipe.LoadDocument(IEnumerable1 nodes)+MoveNext() at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable
1 source, Boolean& found)
at LiteDB.BsonExpression.Execute(IEnumerable1 source) at LiteDB.Engine.QueryPipe.SelectAll(IEnumerable
1 source, BsonExpression select)+MoveNext()
at LiteDB.Engine.QueryExecutor.<>c__DisplayClass9_0.<1 values, String collection) at LiteDB.Engine.QueryExecutor.ExecuteQuery(Boolean executionPlan) at LiteDB.Engine.LiteEngine.Query(String collection, Query query) at LiteDB.LiteQueryable
1.ToDocuments()+MoveNext()
at System.Linq.Enumerable.Single[TSource](IEnumerable1 source) at LiteDB.LiteQueryable
1.Exists()
at MigrationLibrary.DAL.Repository.Implementation.UserRepoLiteDb.Exists(Expression`1 filter)
Hi @webteamby ,
Thanks for reporting both exceptions. I don't know if you had a way to reproduce those errors, but if so, could you please try doing it again using the latest v5 RC? Keep in mind though, that a change has been made between the beta and RC versions and are thus incompatible, so you'll need to recreate your database.
I am getting this error with 5.0.9 that is similar to OP's error.
---> System.NotImplementedException: The method or operation is not implemented.
at LiteDB.BufferSliceExtensions.ReadIndexKey(BufferSlice buffer, Int32 offset)
at LiteDB.Engine.IndexNode..ctor(IndexPage page, Byte index, BufferSlice segment)
at LiteDB.Engine.IndexService.GetNodeList(PageAddress nodeAddress)+MoveNext()
at System.Linq.Enumerable.SelectEnumerableIterator`2.ToArray()
at LiteDB.Engine.LiteEngine.UpdateDocument(Snapshot snapshot, CollectionPage col, BsonDocument doc, IndexService indexer, DataService data)
at LiteDB.Engine.LiteEngine.<>c__DisplayClass30_0.<Upsert>b__0(TransactionService transaction)
at LiteDB.Engine.LiteEngine.AutoTransaction[T](Func`2 fn)
My database size is 38.2 MB
My litedb file opens fine in LiteDB Studio.
This error occured when .Upsert
was called on my ILiteCollection<MyClass>
object.
This error still happens in the latest main repo source. The helper that get the Bson Type returns the value of 59 (in my instance here), which does not parse to any known type in the enum.
This is the method call that returns 59:
ExtendedLengthHelper.ReadLength(buffer[offset++], buffer[offset], out var type, out var len);
The offset value is 13:
This probably doesn't say much but:
This still happens with the latest code from master, which includes an corruption fix that was added recently (https://github.com/mbdavid/LiteDB/commit/26bdeb673d95ca6078a4ed12a0f7ffc8d22e50a9)
Got this error in v.5.0.0-beta:
_System.NotImplementedException: The method or operation is not implemented. at LiteDB.BufferSliceExtensions.ReadIndexKey(BufferSlice buffer, Int32 offset) at LiteDB.Engine.IndexNode..ctor(IndexPage page, Byte index, BufferSlice segment) at LiteDB.Engine.IndexService.AddNode(CollectionIndex index, BsonValue key, PageAddress dataBlock, Byte level, IndexNode last) at LiteDB.Engine.IndexService.AddNode(CollectionIndex index, BsonValue key, PageAddress dataBlock, IndexNode last) at LiteDB.Engine.LiteEngine.InsertDocument(Snapshot snapshot, BsonDocument doc, BsonAutoId autoId, IndexService indexer, DataService data) at LiteDB.Engine.LiteEngine.<>c__DisplayClass29_0.b_0(TransactionService transaction)
at LiteDB.Engine.LiteEngine.AutoTransaction[T](Func
2 fn) at MigrationLibrary.DAL.Repository.Implementation.UserRepoLiteDb.Upsert(IEnumerable
1 listEntities) in C:\src\UserRepoLiteDb.cs:line 86