Litedb: LiteException: Document has more than 20 nested documents. Check for circular references (use DbRef)

Created on 31 Jul 2016  路  2Comments  路  Source: mbdavid/LiteDB

How can I track down which insert/update is causing this error to occur? I'm not using DbRef anywhere. The stack trace and error message doesn't have any information about what model this error is for, where it is being called in my code, etc. Here's the full stack trace:

LiteException: Document has more than 20 nested documents. Check for circular references (use DbRef)
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeDictionary (System.Type type, IDictionary dict, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.SerializeObject (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.Serialize (System.Type type, System.Object obj, Int32 depth) [0x00000] in :0
at LiteDB.BsonMapper.ToDocument (System.Type type, System.Object entity) [0x00000] in :0
at LiteDB.BsonMapper.ToDocumentModel [0x00000] in :0
at LiteDB.LiteCollection1[Model].<Update>b__45_0 (.Model x) [0x00000] in <filename unknown>:0 at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator102[Model,LiteDB.BsonDocument].MoveNext () [0x00000] in :0
at LiteDB.DbEngine+<>c__DisplayClass20_0.b__0 (LiteDB.CollectionPage col) [0x00000] in :0
at LiteDB.DbEngine.WriteTransactionInt32 [0x00000] in :0

Most helpful comment

I figured out what was causing the error. There was a struct that I forgot to register the serialize/deserialize methods. Would it be possible for that exception to also include the data type that failed to be serialized?

All 2 comments

I figured out what was causing the error. There was a struct that I forgot to register the serialize/deserialize methods. Would it be possible for that exception to also include the data type that failed to be serialized?

Thanks

Was this page helpful?
0 / 5 - 0 ratings