Trilium: Load error! (too much recursion)

Created on 2 Jun 2020  路  6Comments  路  Source: zadam/trilium

Hi,

It seems I am unable to load certain trees in my database anymore due to a load error caused by too much recursion. I am still able to export this and see my content, however, I would be interested in what is causing this so I can prevent it in the future. Here are some details:
image.

I am not sure what is causing this but it seems to have occured after I updated to 0.42.4 from 0.40.3

I am using Trillium 0.42.4. It is a similar issue as this one, so I will provide the same logs.
image
image

backend_log.txt

Creating a backup and reading from that did not seem to solve the issue. I am also unable to open / edit the notes in this tree to alter it but I suspect there are some weird linkings going on between them. Any idea on how to solve this? Thanks!

All 6 comments

Hello, thank you reporting this issue!

The log does not really have anything suspicious but the "too much recursion" could suggest that there is some kind of cycle in the note graph.

It would be extremely helpful if you could create an anonymized database and send it to zadam.[email protected]. Just click on the button here:

And go to the ~/trilium-data/anonymized/ and take the DB file there. This file retains the structure of the note tree but deletes (and VACUUMs) all the data and metadata.

Since I won't see the "Literature" title, I can't identify the problematic node - what noteId does it have? You can see that in Note Actions -> Show note info.

Thank you!

Hi Zadam,

Thanks for the fast reply! Unfortunately, I am getting another error when I try to anonymize my database. I am not sure how to define a filename or should I try the new trilium update?

image

21:56:01.221 INFO ERROR: JS Error: Error when calling POST anonymization/anonymize: error - Internal Server Error
21:56:40.309 INFO GET /api/options
21:56:40.342 INFO GET /api/options/user-themes
21:56:40.342 INFO GET /api/keyboard-actions
21:56:43.276 INFO POST /api/anonymization/anonymize
21:56:43.320 INFO ERROR: Error executing transaction, executing rollback. Inner stack: Error: sqlite: filename is not defined
at /home/kevin/Projects/trilium-linux-x64-server/node_modules/sqlite/build/Database.js:34:23
at new Promise ()
at Database.open (/home/kevin/Projects/trilium-linux-x64-server/node_modules/sqlite/build/Database.js:31:16)
at Object.open (/home/kevin/Projects/trilium-linux-x64-server/node_modules/sqlite/build/index.js:13:14)
at Object.anonymize (/home/kevin/Projects/trilium-linux-x64-server/src/services/anonymization.js:17:29)
at anonymize (/home/kevin/Projects/trilium-linux-x64-server/src/routes/api/anonymization.js:6:25)
at /home/kevin/Projects/trilium-linux-x64-server/src/routes/routes.js:92:38
at /home/kevin/Projects/trilium-linux-x64-server/src/services/sql.js:224:25
Outside stack: Error
at Object.transactional (/home/kevin/Projects/trilium-linux-x64-server/src/services/sql.js:215:23)
at /home/kevin/Projects/trilium-linux-x64-server/src/routes/routes.js:91:38
at /home/kevin/Projects/trilium-linux-x64-server/node_modules/cls-hooked/context.js:118:13
at Namespace.run (/home/kevin/Projects/trilium-linux-x64-server/node_modules/cls-hooked/context.js:97:5)
at Namespace.runAndReturn (/home/kevin/Projects/trilium-linux-x64-server/node_modules/cls-hooked/context.js:117:8)
at Object.init (/home/kevin/Projects/trilium-linux-x64-server/src/services/cls.js:5:28)
at /home/kevin/Projects/trilium-linux-x64-server/src/routes/routes.js:85:38
at Layer.handle [as handle_request] (/home/kevin/Projects/trilium-linux-x64-server/node_modules/express/lib/router/layer.js:95:5)
at next (/home/kevin/Projects/trilium-linux-x64-server/node_modules/express/lib/router/route.js:137:13)
at csrf (/home/kevin/Projects/trilium-linux-x64-server/node_modules/csurf/index.js:117:5)
21:56:43.333 INFO ERROR: post /api/anonymization/anonymize threw exception: Error: sqlite: filename is not defined
at /home/kevin/Projects/trilium-linux-x64-server/node_modules/sqlite/build/Database.js:34:23
at new Promise ()
at Database.open (/home/kevin/Projects/trilium-linux-x64-server/node_modules/sqlite/build/Database.js:31:16)
at Object.open (/home/kevin/Projects/trilium-linux-x64-server/node_modules/sqlite/build/index.js:13:14)
at Object.anonymize (/home/kevin/Projects/trilium-linux-x64-server/src/services/anonymization.js:17:29)
at anonymize (/home/kevin/Projects/trilium-linux-x64-server/src/routes/api/anonymization.js:6:25)
at /home/kevin/Projects/trilium-linux-x64-server/src/routes/routes.js:92:38
at /home/kevin/Projects/trilium-linux-x64-server/src/services/sql.js:224:25
21:56:43.342 INFO ERROR: JS Error: Error when calling POST anonymization/anonymize: error - Internal Server Error
21:57:42.329 INFO GET /api/backend-log

Hello, looks like the anonymization had a bug - I just released 0.42.6 which should fix that - could you download that release and try anonymization again?

I appreciate your help!

Hello, with the help of your anonymized database I could figure out the issue - the problem was with the fact that you had a template note which was a child/descendant of its own template instance. This created attribute inheritance cycle. This situation is valid, but sort of unexpected so I did not test it before.

Anyway I added the protection to the code to avoid this kind of cycle and I will be releasing it soon.

Thank you for your help! It's really important to fix these kind of blocker issues.

Fix should be in v0.42.7

Thanks, can confirm it works now on my end! Much appreciate all the work you put into Trillium and it really shows as it is an amazing knowledge database!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zadam picture zadam  路  4Comments

gerroon picture gerroon  路  5Comments

apg-dev picture apg-dev  路  5Comments

sambbaron picture sambbaron  路  3Comments

wwalc picture wwalc  路  3Comments