zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.2k stars 1.9k forks source link

(Bug report) Consistency checks failed #2831

Closed Qining closed 2 years ago

Qining commented 2 years ago

Trilium Version

0.50.3

What operating system are you using?

Windows

What is your setup?

Local + server sync

Operating System Version

Windows 10 19042.1415

Description

Logs:

08:53:18.537 CPU model: AMD Ryzen 7 3700X 8-Core Processor             , logical cores: 16 freq: 3593 Mhz
08:53:18.575 Registered global shortcut Ctrl+Alt+P for action createNoteIntoInbox
08:53:18.576 Listening on port 37840
08:53:19.147 Generated CSRF token WsRyfUUM-IvYjErD0wXwtwaSuCOzcfmBEzuU with secret _csrf=_ofBj_f7vySGdj2Qf6e8XWhO; Path=/
08:53:19.481 200 GET /api/options with 5647 bytes took 0ms
08:53:19.483 200 GET /api/tree with 38731 bytes took 1ms
08:53:19.485 200 GET /api/keyboard-actions with 11944 bytes took 1ms
08:53:19.485 200 GET /api/keyboard-shortcuts-for-notes with 2 bytes took 0ms
08:53:19.486 200 GET /api/script/widgets with 2930 bytes took 0ms
08:53:19.488 200 POST /api/tree/load with 3846 bytes took 1ms
08:53:19.525 200 POST /api/tree/load with 2479 bytes took 1ms
08:53:22.451 Table counts: notes: 759, note_revisions: 522, branches: 831, attributes: 1784, etapi_tokens: 2
08:53:22.492 Slow query took 23ms: SELECT notes.noteId, notes.type, notes.mime FROM notes JOIN note_contents USING (noteId) WHERE isDeleted = 0 AND isProtected = 0 AND content IS NULL
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: b0TwTcs2w9v1,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: SGKIyQyS5Cg8,b0TwTcs2w9v1,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: TpTrwREmFOmj,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: WS0cGINTsY9e,TpTrwREmFOmj,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: cnQZMcI8Gxfh,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: oiQ3wQTfFOPM - fxVl9GsUgczW, whole path: cnQZMcI8Gxfh,oiQ3wQTfFOPM
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: iiBS1V4TwTfl,cnQZMcI8Gxfh,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: oiQ3wQTfFOPM - fxVl9GsUgczW, whole path: iiBS1V4TwTfl,cnQZMcI8Gxfh,oiQ3wQTfFOPM
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: 7hgTpUEjQbK1,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: rKcS7Tmfr7Hq,7hgTpUEjQbK1,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: MJVDdQfe5C58,7hgTpUEjQbK1,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: QcHA8crvonWb,7hgTpUEjQbK1,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: w3NR2BHsAua4,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: KHj7RRcy8jka,w3NR2BHsAua4,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: ws3vQB1V1zwG,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: 2UzwTUGmWIB8,ws3vQB1V1zwG,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: eCoTZpVn2ye1,ws3vQB1V1zwG,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: npUmyEjeR0lI,ws3vQB1V1zwG,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: hvMAmufL5mIM,ws3vQB1V1zwG,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: crLlBxSMxrAr,ws3vQB1V1zwG,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: p47CsBrouCoa,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: oiQ3wQTfFOPM - fxVl9GsUgczW, whole path: p47CsBrouCoa,oiQ3wQTfFOPM
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: 620YmvDXaAY3,p47CsBrouCoa,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: oiQ3wQTfFOPM - fxVl9GsUgczW, whole path: 620YmvDXaAY3,p47CsBrouCoa,oiQ3wQTfFOPM
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: nJDnbiMmlqH5,p47CsBrouCoa,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: oiQ3wQTfFOPM - fxVl9GsUgczW, whole path: nJDnbiMmlqH5,p47CsBrouCoa,oiQ3wQTfFOPM
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: 7geSTVstmmUb,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: oiQ3wQTfFOPM - fxVl9GsUgczW, whole path: 7geSTVstmmUb,oiQ3wQTfFOPM
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: WFCWb54o67D1,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: cqVmtrTUPiGi,WFCWb54o67D1,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: vKe1YqC67yHh,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: oiQ3wQTfFOPM - fxVl9GsUgczW, whole path: vKe1YqC67yHh,oiQ3wQTfFOPM
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: w2CFZVQEf0Sm,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: nwvAEUtVTyrp,w2CFZVQEf0Sm,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: oiQ3wQTfFOPM - fxVl9GsUgczW, whole path: oiQ3wQTfFOPM
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: fxVl9GsUgczW - oiQ3wQTfFOPM, whole path: diBXI9rrohLO,fxVl9GsUgczW
08:53:22.498 Consistency error: Tree cycle detected at parent-child relationship: oiQ3wQTfFOPM - fxVl9GsUgczW, whole path: diBXI9rrohLO,oiQ3wQTfFOPM
08:53:22.498 Consistency checks failed (took 47ms)
08:53:22.498 Sending message to all clients: {"type":"consistency-checks-failed"}
08:53:23.469 Nothing to push
08:53:23.508 Finished pull
08:53:23.508 Nothing to push
08:53:23.633 Content hash computation took 29ms

Using Windows Client and Browser at the same time.

Is there a comment do fix this on the server side? Or I just lost all of my notes?

XXXJetfireXXX commented 2 years ago

Looks like there's a tree cycle (infinite recursion?): A is a parent of B while B is a parent of A, which is impossible. You should probably try opening the document database using some SQL editor and find which notes are causing this issue. (oiQ3wQTfFOPM - fxVl9GsUgczW). I'm not an expert at that though, just a wild guess.

zadam commented 2 years ago

Hi, can you try this build? It should automatically recover from that tree cycle error.

If this doesn't help then the best option would be to restore backup.

Qining commented 2 years ago

Yes, the issue is I accidentally create a loop by 'cloning, cloning and cloning'. I managed to recover from backups (luckily there is one backup somehow can be started, all the ones after that one simply do not open). And after I deleted a clone, everything backed to normal.

zadam commented 2 years ago

Ok, great to hear you managed to fix it.