-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] LiteDB ENSURE: stored slot must be same as called #1984
Comments
Hi @alb3ric, this ensure prevent database to be corrupted. I add this checkes to capture corruption problems... Can you send me your database (have any sensitive/customer data)? You can send to |
Hello Mauricio, I understand that the checks is to capture corruption problems and I think it's great. I just sent you the file by email. Thanks in advance. Regards |
Is there a solution? Me too |
I too would like to know how to avoid/solve this issue... |
FYI for all: I managed to make a system for detecting this and repairing the DB by running .Rebuild() which failed due to trying to insert a duplicate ID, so I catch the exception, get all the data out of the DB by just using FindAll, and then create a new one fresh and insert the data into that one, then for the sake of cleanliness my application closes and re-opens to ensure a clean slate. |
any solutions? how to avoid/solve it? |
Version
5.0.10 .NET 4.7 Windows 2016
Describe the bug
I have a database in version 5.0.10. When upserting I got this error => "LiteDB ENSURE: stored slot must be same as called"
and then it keet doing it
If I reopen the database i got this error : LiteDB ENSURE: invalid segment position and then when inserting the previous errors is coming back.
Code to Reproduce
I can send the database (73MO)
Screenshots/Stacktrace
System.Exception: LiteDB ENSURE: stored slot must be same as called
at LiteDB.Constants.ENSURE(Boolean conditional, String message)
at LiteDB.Engine.Snapshot.GetFreeDataPage(Int32 bytesLength)
at LiteDB.Engine.DataService.<>c__DisplayClass3_0.<g__source|0>d.MoveNext()
at LiteDB.Engine.BufferWriter..ctor(IEnumerable
1 source) at LiteDB.Engine.DataService.Insert(BsonDocument doc) at LiteDB.Engine.LiteEngine.InsertDocument(Snapshot snapshot, BsonDocument doc, BsonAutoId autoId, IndexService indexer, DataService data) at LiteDB.Engine.LiteEngine.<>c__DisplayClass31_0.<Upsert>b__0(TransactionService transaction) at LiteDB.Engine.LiteEngine.AutoTransaction[T](Func
2 fn)at LiteDB.LiteCollection`1.Upsert(T entity)
Thanks in advance for the help.
Regards
The text was updated successfully, but these errors were encountered: