LiteDB icon indicating copy to clipboard operation
LiteDB copied to clipboard

[BUG] db.Rebuild throws an exception "Detected loop in FindAll({0})"

Open frabul opened this issue 1 year ago • 2 comments

LiteDB version 5.0.20 Windows 11 .net 6.0

When calling Rebuild on the database it fails with an exception "LiteDB.LiteException: 'Detected loop in FindAll({0})'" To reproduce it try to open the attached db and Rebuild. The attached file is 7z zipped file, i hade to add the .gif extension in order to attach it because 7z is forbidden.

TradesAndOrdersArch = new LiteDatabase(OperationsArchivePath);
TradesAndOrdersArch.Pragma("UTC_DATE", true);
TradesAndOrdersDb = new LiteDatabase(OperationsDbPath);
TradesAndOrdersDb.Rebuild();

Image

frabul avatar Jan 18 '25 16:01 frabul

I've published a temporary nuget package variant with fix for this bug: https://www.nuget.org/packages/LiteDB.Fixed/5.0.22

The source code: https://github.com/patryk9200/LiteDB

patryk9200 avatar Apr 25 '25 13:04 patryk9200

@patryk9200 thanks for the fix, I've sent you an email with a sample db which still causes the same issue if you could check ;)

materemias avatar May 17 '25 09:05 materemias