Closed HiFiJ closed 3 years ago
Another problem: 1) Created an unprotected note on the server with content 2) After sync, the note opens correctly on the server and on the desktop build 3) Setting it to protected on the desktop and syncing leads to (server log):
21:24:01.155 204 POST /api/sync/finished took 1ms 21:24:01.205 Content hash computation took 9ms 21:24:01.207 Slow 200 GET /api/sync/check took 12ms 21:24:05.468 Received request to trigger sync now. 21:24:05.468 200 POST /api/sync/now took 1ms 21:24:12.636 304 GET /api/setup/status took 1ms 21:24:12.667 200 POST /api/login/sync took 1ms 21:24:12.778 304 GET /api/sync/changed?lastEntityChangeId=15324 took 1ms 21:24:12.812 Slow 204 POST /api/sync/finished took 10ms 21:24:12.849 Content hash computation took 10ms 21:24:12.850 Slow 304 GET /api/sync/check took 11ms 21:24:20.220 Slow 200 POST /api/login/protected took 119ms 21:24:20.296 304 GET /api/tree took 1ms 21:24:20.343 200 POST /api/tree/load took 1ms 21:24:20.484 ERROR: get /api/notes/:noteId threw exception: Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length at Decipheriv.final (internal/crypto/cipher.js:172:29) at Object.decrypt (/home/jc/Trilium-PackagedServer/trilium-linux-x64-server/src/services/data_encryption.js:71:91) at Object.decrypt (/home/jc/Trilium-PackagedServer/trilium-linux-x64-server/src/services/protected_session.js:64:34) at Note.getContent (/home/jc/Trilium-PackagedServer/trilium-linux-x64-server/src/entities/note.js:87:91) at getNote (/home/jc/Trilium-PackagedServer/trilium-linux-x64-server/src/routes/api/notes.js:19:29) at Function.cb (/home/jc/Trilium-PackagedServer/trilium-linux-x64-server/src/routes/routes.js:96:34) at Function.sqliteTransaction (/home/jc/Trilium-PackagedServer/trilium-linux-x64-server/node_modules/better-sqlite3/lib/transaction.js:58:24) at Object.transactional (/home/jc/Trilium-PackagedServer/trilium-linux-x64-server/src/services/sql.js:234:52) at /home/jc/Trilium-PackagedServer/trilium-linux-x64-server/src/routes/routes.js:98:44 at /home/jc/Trilium-PackagedServer/trilium-linux-x64-server/node_modules/cls-hooked/context.js:118:13 21:24:20.486 500 GET /api/notes/kodkFNn2kAMZ took 3ms 21:24:20.488 200 GET /api/similar-notes/kodkFNn2kAMZ took 1ms 21:24:20.488 ERROR: get /api/similar-notes/:noteId threw exception: Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length at Decipheriv.final (internal/crypto/cipher.js:172:29) at Object.decrypt (/home/jc/Trilium-PackagedServer/trilium-linux-x64-server/src/services/data_encryption.js:71:91) at Object.decrypt (/home/jc/Trilium-PackagedServer/trilium-linux-x64-server/src/services/protected_session.js:64:34) at Note.getContent (/home/jc/Trilium-PackagedServer/trilium-linux-x64-server/src/entities/note.js:87:91) at buildRewardMap (/home/jc/Trilium-PackagedServer/trilium-linux-x64-server/src/services/note_cache/similarity.js:127:36) at Object.findSimilarNotes (/home/jc/Trilium-PackagedServer/trilium-linux-x64-server/src/services/note_cache/similarity.js:249:23) at getSimilarNotes (/home/jc/Trilium-PackagedServer/trilium-linux-x64-server/src/routes/api/similar_notes.js:15:36) at Function.cb (/home/jc/Trilium-PackagedServer/trilium-linux-x64-server/src/routes/routes.js:96:34) at Function.sqliteTransaction (/home/jc/Trilium-PackagedServer/trilium-linux-x64-server/node_modules/better-sqlite3/lib/transaction.js:58:24) at Object.transactional (/home/jc/Trilium-PackagedServer/trilium-linux-x64-server/src/services/sql.js:234:52) 21:24:20.491 200 GET /api/notes/kodkFNn2kAMZ/revisions took 1ms 21:24:20.558 JS Error: Error when calling GET similar-notes/kodkFNn2kAMZ: error - Internal Server Error Stack: w@https://XXXXX.net:8080/app-dist/desktop.js:1:86327 throwError@https://XXXXX.net:8080/app-dist/desktop.js:1:64325 c@https://XXXXX.net:8080/app-dist/desktop.js:1:61330
21:24:20.558 JS Error: Error when calling GET notes/kodkFNn2kAMZ: error - Internal Server Error Stack: w@https://XXXX.net:8080/app-dist/desktop.js:1:86327 throwError@https://XXXX.net:8080/app-dist/desktop.js:1:64325 c@https://XXXXX.net:8080/app-dist/desktop.js:1:61330
Hi, thank you for reporting this issue!
I managed to reproduce similar problems like you describe with protected notes.
I will try to fix this tomorrow (I already have some idea what might be causing this) and subsequently release a fixed version. In the meantime I recommend to not create protected notes.
Fix has been releases in 0.46.6.
The previously affected notes are however not fixed. To remedy this situation, you should trigger sync of the affected notes on the source instance - e. g. using context menu on the tree - advanced - force note sync or by just editing them (adding space etc.). This will sync them again and fix the issue on other instances.
Thanks a lot for the very fast response, great!! Best regards,
Joost
Hello,
thanks a lot for Trilium, it's amazing! I'm using it with a self hosted server and 4 synced desktop builds. Since update from 045.x to 0.46.5 on server and all desktop builds, I am experiencing severe problems when adding notes on the desktop builds. Adding the note on the desktop works including heading and contents, is correctly restored after exiting and reentering protected mode (all my notes are in protected mode). On the server I only get an "undefined" note entry with no contents. Trying to open/reopen the note gives me
Would this look like a bug, or something else? I tried vacuuming the DB, ran "Fix consistency errors" and "Full sync" two times, but got this issue repeatedly. Thanks for any clues, glad to help with further logs etc.,
Joost
PS: Desktop log does not show any signs of error: