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

Problem setting title for protected notes #2291

Closed HiFiJ closed 2 years ago

HiFiJ commented 2 years ago

Hi everyone,

with the latest release 0.48.3 I seem to have problems in setting the note title for protected notes - they always revert to "[protected]".

Anyone else seeing this? Thank you,

Joost

App version: 0.48.3
DB version 185
Sync version 21
Build date 2021-10-22T21:31:44+02:00

08:28:53.665 ERROR: Could not decrypt note undefined: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length at Object.final () at Decipheriv.final (internal/crypto/cipher.js:174:29) at decrypt (/home/jc/Trilium-PackagedServer/0.48.3/src/services/data_encryption.js:71:91) at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.3/src/services/data_encryption.js:98:20) at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.3/src/services/protected_session.js:54:34) at Note.decrypt (/home/jc/Trilium-PackagedServer/0.48.3/src/becca/entities/note.js:1077:54) at Note.update (/home/jc/Trilium-PackagedServer/0.48.3/src/becca/entities/note.js:72:14) at Note.updateFromRow (/home/jc/Trilium-PackagedServer/0.48.3/src/becca/entities/note.js:32:14) at new Note (/home/jc/Trilium-PackagedServer/0.48.3/src/becca/entities/note.js:27:14) at Function. (/home/jc/Trilium-PackagedServer/0.48.3/src/services/notes.js:110:22) 08:28:53.711 Download of https://m3e.meduniwien.ac.at/lp/GuideAngio2011/web/Daten/Bilder/NASCETvsECST.png succeeded and was saved as image note EP264HAVqgB7 08:28:54.055 200 POST /api/tree/load with 5674 bytes took 1ms 08:28:57.199 200 GET /api/tree?subTreeNoteId=GYUHwMSWHv1k with 6335 bytes took 0ms 08:29:25.547 200 PUT /api/notes/GYUHwMSWHv1k with 92 bytes took 7ms 08:29:27.842 Slow 200 PUT /api/notes/GYUHwMSWHv1k with 92 bytes took 191ms 08:29:28.684 200 PUT /api/notes/GYUHwMSWHv1k with 92 bytes took 8ms 08:29:29.960 Slow 200 PUT /api/notes/GYUHwMSWHv1k with 92 bytes took 10ms 08:30:16.635 Slow 200 PUT /api/notes/GYUHwMSWHv1k with 92 bytes took 47ms 08:30:18.867 Slow 200 PUT /api/notes/GYUHwMSWHv1k with 92 bytes took 38ms 08:40:20.799 204 PUT /api/branches/mfWAkmVtYL9m/expanded/0 with 0 bytes took 2ms 09:08:14.386 Table counts: notes: 402, note_revisions: 1227, branches: 424, attributes: 340, api_tokens: 0 09:08:14.407 All consistency checks passed with no errors detected (took 21ms) 10:08:13.313 Created backup at /home/jc/.local/share/trilium-data/backup/backup-daily.db 10:08:14.386 Table counts: notes: 402, note_revisions: 1227, branches: 424, attributes: 340, api_tokens: 0 10:08:14.406 All consistency checks passed with no errors detected (took 20ms) 11:08:14.385 Table counts: notes: 402, note_revisions: 1227, branches: 424, attributes: 340, api_tokens: 0 11:08:14.395 All consistency checks passed with no errors detected (took 10ms) 11:45:33.498 200 GET /api/notes/KovC0MsmXfne with 4905 bytes took 1ms 11:45:34.097 204 PUT /api/options with 0 bytes took 5ms 11:45:35.798 200 GET /api/notes/Gzr3I0onLCN5 with 2220 bytes took 1ms 11:45:35.941 204 PUT /api/options with 0 bytes took 4ms 11:45:38.449 Slow 200 PUT /api/notes/Gzr3I0onLCN5 with 92 bytes took 14ms 11:45:38.553 200 GET /api/notes/Gzr3I0onLCN5 with 2192 bytes took 1ms 11:45:39.501 200 PUT /api/notes/Gzr3I0onLCN5 with 92 bytes took 8ms 11:45:39.565 200 GET /api/notes/Gzr3I0onLCN5 with 2196 bytes took 1ms 11:45:40.551 Slow 200 PUT /api/notes/Gzr3I0onLCN5 with 92 bytes took 12ms 11:45:40.653 200 GET /api/notes/Gzr3I0onLCN5 with 2197 bytes took 1ms 11:45:40.858 304 GET /api/notes/Gzr3I0onLCN5 with 2197 bytes took 1ms 11:45:41.585 200 PUT /api/notes/Gzr3I0onLCN5 with 92 bytes took 6ms 11:45:41.673 200 GET /api/notes/Gzr3I0onLCN5 with 2196 bytes took 2ms 11:45:42.632 200 PUT /api/notes/Gzr3I0onLCN5 with 92 bytes took 9ms 11:45:42.717 200 GET /api/notes/Gzr3I0onLCN5 with 2204 bytes took 1ms 11:45:43.663 Slow 200 PUT /api/notes/Gzr3I0onLCN5 with 92 bytes took 14ms 11:45:43.745 200 GET /api/notes/Gzr3I0onLCN5 with 2206 bytes took 0ms 11:45:44.687 200 PUT /api/notes/Gzr3I0onLCN5 with 92 bytes took 7ms 11:45:44.768 200 GET /api/notes/Gzr3I0onLCN5 with 2210 bytes took 1ms 11:45:44.898 304 GET /api/notes/Gzr3I0onLCN5 with 2210 bytes took 1ms 12:08:14.386 Table counts: notes: 402, note_revisions: 1228, branches: 424, attributes: 340, api_tokens: 0 12:08:14.404 All consistency checks passed with no errors detected (took 18ms) 12:21:22.790 304 GET /api/notes/lYNxmzi2S9Kr with 2122 bytes took 2ms 12:21:23.447 204 PUT /api/options with 0 bytes took 8ms 13:08:14.388 Table counts: notes: 402, note_revisions: 1228, branches: 424, attributes: 340, api_tokens: 0 13:08:14.406 All consistency checks passed with no errors detected (took 18ms) 14:08:14.389 Table counts: notes: 402, note_revisions: 1228, branches: 424, attributes: 340, api_tokens: 0 14:08:14.401 All consistency checks passed with no errors detected (took 12ms) 15:08:14.390 Table counts: notes: 402, note_revisions: 1228, branches: 424, attributes: 340, api_tokens: 0 15:08:14.399 All consistency checks passed with no errors detected (took 10ms) 16:08:14.396 Table counts: notes: 402, note_revisions: 1228, branches: 424, attributes: 340, api_tokens: 0 16:08:14.407 All consistency checks passed with no errors detected (took 10ms) 17:08:14.400 Table counts: notes: 402, note_revisions: 1228, branches: 424, attributes: 340, api_tokens: 0 17:08:14.409 All consistency checks passed with no errors detected (took 9ms) 18:08:14.402 Table counts: notes: 402, note_revisions: 1228, branches: 424, attributes: 340, api_tokens: 0 18:08:14.413 All consistency checks passed with no errors detected (took 12ms) 19:08:14.458 Table counts: notes: 402, note_revisions: 1228, branches: 424, attributes: 340, api_tokens: 0 19:08:14.474 All consistency checks passed with no errors detected (took 17ms) 20:08:14.512 Table counts: notes: 402, note_revisions: 1228, branches: 424, attributes: 340, api_tokens: 0 20:08:14.535 All consistency checks passed with no errors detected (took 23ms) 21:08:14.513 Table counts: notes: 402, note_revisions: 1228, branches: 424, attributes: 340, apitokens: 0 21:08:14.527 All consistency checks passed with no errors detected (took 14ms) 21:27:11.853 Generated CSRF token 37cjrUpB-FO-x8A1ZwWG77rgMwwY with secret undefined 21:27:13.105 200 GET /api/options with 6898 bytes took 1ms 21:27:13.122 200 GET /api/tree with 28800 bytes took 3ms 21:27:13.123 Keyboard action showNoteInfo found in database, but not in action definition. 21:27:13.124 Keyboard action showLinkMap found in database, but not in action definition. 21:27:13.124 Keyboard action focusOnAttributes found in database, but not in action definition. 21:27:13.124 Keyboard action toggleZenMode found in database, but not in action definition. 21:27:13.125 200 GET /api/keyboard-actions with 11756 bytes took 2ms 21:27:13.130 200 GET /api/keyboard-shortcuts-for-notes with 2 bytes took 1ms 21:27:13.134 200 GET /api/script/widgets with 2930 bytes took 2ms 21:27:13.343 200 POST /api/tree/load with 5537 bytes took 1ms 21:27:13.710 200 POST /api/tree/load with 2329 bytes took 1ms 21:27:13.719 200 GET /api/tree?subTreeNoteId=GYUHwMSWHv1k with 6335 bytes took 1ms 21:27:13.725 200 POST /api/tree/load with 4361 bytes took 3ms 21:27:13.727 200 GET /api/search/%23bookmarked%20or%20%23bookmarkFolder with 2 bytes took 1ms 21:27:14.887 200 GET /api/notes/WUONk0CNvg7h with 2325 bytes took 1ms 21:27:14.900 200 GET /api/tree?subTreeNoteId=RwPag6yERhIo with 4461 bytes took 9ms 21:27:15.768 200 GET /api/script/startup with 2971 bytes took 2ms 21:27:15.809 204 PUT /api/branches/mfWAkmVtYL9m/expanded/1 with 0 bytes took 3ms 21:27:15.822 200 POST /api/tree/load with 6617 bytes took 1ms 21:27:15.875 200 POST /api/tree/load with 6355 bytes took 2ms 21:27:15.927 200 POST /api/tree/load with 6936 bytes took 1ms 21:27:23.732 200 GET /api/app-info with 239 bytes took 4ms

zadam commented 2 years ago

Hi, what OS do you use?

I could not reproduce this, but I think it is a bug in Trilium which occurs only on some platforms. I fixed this, please try soon-to-be-release 0.48.4.

HiFiJ commented 2 years ago

Hi, thanks for your unbelievable quick response! This is on a linux server running Ubuntu 18.04.6 LTS.

Best regards,

Joost

HiFiJ commented 2 years ago

Hi,

unfortunately this seems to not fix my issure, this is the new log with 0.48.4:

09:14:55.831 App HTTPS server starting up at port 8080
09:14:55.832 {
  "appVersion": "0.48.4",
  "dbVersion": 185,
  "syncVersion": 21,
  "buildDate": "2021-10-28T22:28:52+02:00",
  "buildRevision": "ab7d121290eecf3ade934c39861b3cfea188b73d",
  "dataDirectory": "/home/jc/.local/share/trilium-data",
  "clipperProtocolVersion": "1.0"
}
09:14:55.834 CPU model: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz, logical cores: 1 freq: 1999 Mhz
09:14:55.838 Listening on port 8080
09:14:57.296 Generated CSRF token bPHqJSkq-XXX with secret undefined
09:14:58.014 200 GET /api/options with 6898 bytes took 2ms
09:14:58.024 200 GET /api/tree with 30435 bytes took 2ms
09:14:58.030 Keyboard action showNoteInfo found in database, but not in action definition.
09:14:58.031 Keyboard action showLinkMap found in database, but not in action definition.
09:14:58.031 Keyboard action focusOnAttributes found in database, but not in action definition.
09:14:58.031 Keyboard action toggleZenMode found in database, but not in action definition.
09:14:58.032 200 GET /api/keyboard-actions with 11756 bytes took 3ms
09:14:58.034 200 GET /api/script/widgets with 2 bytes took 1ms
09:14:58.036 200 GET /api/keyboard-shortcuts-for-notes with 2 bytes took 1ms
09:14:58.243 200 POST /api/tree/load with 2336 bytes took 2ms
09:14:58.245 200 GET /api/tree?subTreeNoteId=GYUHwMSWHv1k with 6376 bytes took 1ms
09:14:58.247 200 GET /api/tree?subTreeNoteId=Gzr3I0onLCN5 with 4013 bytes took 1ms
09:14:58.249 200 GET /api/search/%23bookmarked%20or%20%23bookmarkFolder with 2 bytes took 1ms
09:14:59.206 200 GET /api/notes/RwPag6yERhIo with 431 bytes took 2ms
09:15:00.201 200 GET /api/script/startup with 2 bytes took 2ms
09:15:05.058 ERROR: Could not decrypt note RaGSE80Sr6QM: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length
    at Decipheriv.final (internal/crypto/cipher.js:174:29)
    at decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:71:91)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:98:20)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/protected_session.js:54:34)
    at Note.decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/entities/note.js:1095:54)
    at Becca.decryptProtectedNotes (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca.js:55:18)
    at /home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca_loader.js:225:15
    at Object.emit (/home/jc/Trilium-PackagedServer/0.48.4/src/services/events.js:36:17)
    at loginToProtectedSession (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/api/login.js:70:18)
    at Function.cb (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/routes.js:145:34)
09:15:05.091 ERROR: Could not decrypt note Gzr3I0onLCN5: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length
    at Decipheriv.final (internal/crypto/cipher.js:174:29)
    at decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:71:91)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:98:20)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/protected_session.js:54:34)
    at Note.decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/entities/note.js:1095:54)
    at Becca.decryptProtectedNotes (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca.js:55:18)
    at /home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca_loader.js:225:15
    at Object.emit (/home/jc/Trilium-PackagedServer/0.48.4/src/services/events.js:36:17)
    at loginToProtectedSession (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/api/login.js:70:18)
    at Function.cb (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/routes.js:145:34)
09:15:05.094 ERROR: Could not decrypt note RwPag6yERhIo: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length
    at Decipheriv.final (internal/crypto/cipher.js:174:29)
    at decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:71:91)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:98:20)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/protected_session.js:54:34)
    at Note.decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/entities/note.js:1095:54)
    at Becca.decryptProtectedNotes (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca.js:55:18)
    at /home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca_loader.js:225:15
    at Object.emit (/home/jc/Trilium-PackagedServer/0.48.4/src/services/events.js:36:17)
    at loginToProtectedSession (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/api/login.js:70:18)
    at Function.cb (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/routes.js:145:34)
09:15:05.097 ERROR: Could not decrypt note WUONk0CNvg7h: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length
    at Decipheriv.final (internal/crypto/cipher.js:174:29)
    at decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:71:91)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:98:20)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/protected_session.js:54:34)
    at Note.decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/entities/note.js:1095:54)
    at Becca.decryptProtectedNotes (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca.js:55:18)
    at /home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca_loader.js:225:15
    at Object.emit (/home/jc/Trilium-PackagedServer/0.48.4/src/services/events.js:36:17)
    at loginToProtectedSession (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/api/login.js:70:18)
    at Function.cb (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/routes.js:145:34)
09:15:05.100 ERROR: Could not decrypt note 8gKytO8sO6oj: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length
    at Decipheriv.final (internal/crypto/cipher.js:174:29)
    at decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:71:91)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:98:20)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/protected_session.js:54:34)
    at Note.decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/entities/note.js:1095:54)
    at Becca.decryptProtectedNotes (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca.js:55:18)
    at /home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca_loader.js:225:15
    at Object.emit (/home/jc/Trilium-PackagedServer/0.48.4/src/services/events.js:36:17)
    at loginToProtectedSession (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/api/login.js:70:18)
    at Function.cb (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/routes.js:145:34)
09:15:05.100 ERROR: Could not decrypt note QAPcIVVR5yZ4: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length
    at Decipheriv.final (internal/crypto/cipher.js:174:29)
    at decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:71:91)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:98:20)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/protected_session.js:54:34)
    at Note.decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/entities/note.js:1095:54)
    at Becca.decryptProtectedNotes (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca.js:55:18)
    at /home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca_loader.js:225:15
    at Object.emit (/home/jc/Trilium-PackagedServer/0.48.4/src/services/events.js:36:17)
    at loginToProtectedSession (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/api/login.js:70:18)
    at Function.cb (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/routes.js:145:34)
09:15:05.101 ERROR: Could not decrypt note EP264HAVqgB7: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length
    at Decipheriv.final (internal/crypto/cipher.js:174:29)
    at decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:71:91)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:98:20)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/protected_session.js:54:34)
    at Note.decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/entities/note.js:1095:54)
    at Becca.decryptProtectedNotes (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca.js:55:18)
    at /home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca_loader.js:225:15
    at Object.emit (/home/jc/Trilium-PackagedServer/0.48.4/src/services/events.js:36:17)
    at loginToProtectedSession (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/api/login.js:70:18)
    at Function.cb (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/routes.js:145:34)
09:15:05.101 Sending message to all clients: {"type":"protectedSessionLogin"}
09:15:05.103 Slow 200 POST /api/login/protected with 16 bytes took 288ms
09:15:05.823 Table counts: notes: 403, note_revisions: 1229, branches: 425, attributes: 340, api_tokens: 0
09:15:05.837 All consistency checks passed with no errors detected (took 13ms)
09:15:15.490 ERROR: Could not decrypt note RaGSE80Sr6QM: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length
    at Decipheriv.final (internal/crypto/cipher.js:174:29)
    at decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:71:91)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:98:20)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/protected_session.js:54:34)
    at Note.decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/entities/note.js:1095:54)
    at Becca.decryptProtectedNotes (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca.js:55:18)
    at /home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca_loader.js:225:15
    at Object.emit (/home/jc/Trilium-PackagedServer/0.48.4/src/services/events.js:36:17)
    at loginToProtectedSession (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/api/login.js:70:18)
    at Function.cb (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/routes.js:145:34)
09:15:15.493 ERROR: Could not decrypt note Gzr3I0onLCN5: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length
    at Decipheriv.final (internal/crypto/cipher.js:174:29)
    at decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:71:91)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:98:20)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/protected_session.js:54:34)
    at Note.decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/entities/note.js:1095:54)
    at Becca.decryptProtectedNotes (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca.js:55:18)
    at /home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca_loader.js:225:15
    at Object.emit (/home/jc/Trilium-PackagedServer/0.48.4/src/services/events.js:36:17)
    at loginToProtectedSession (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/api/login.js:70:18)
    at Function.cb (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/routes.js:145:34)
09:15:15.496 ERROR: Could not decrypt note RwPag6yERhIo: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length
    at Decipheriv.final (internal/crypto/cipher.js:174:29)
    at decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:71:91)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:98:20)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/protected_session.js:54:34)
    at Note.decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/entities/note.js:1095:54)
    at Becca.decryptProtectedNotes (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca.js:55:18)
    at /home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca_loader.js:225:15
    at Object.emit (/home/jc/Trilium-PackagedServer/0.48.4/src/services/events.js:36:17)
    at loginToProtectedSession (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/api/login.js:70:18)
    at Function.cb (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/routes.js:145:34)
09:15:15.498 ERROR: Could not decrypt note WUONk0CNvg7h: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length
    at Decipheriv.final (internal/crypto/cipher.js:174:29)
    at decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:71:91)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:98:20)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/protected_session.js:54:34)
    at Note.decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/entities/note.js:1095:54)
    at Becca.decryptProtectedNotes (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca.js:55:18)
    at /home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca_loader.js:225:15
    at Object.emit (/home/jc/Trilium-PackagedServer/0.48.4/src/services/events.js:36:17)
    at loginToProtectedSession (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/api/login.js:70:18)
    at Function.cb (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/routes.js:145:34)
09:15:15.501 ERROR: Could not decrypt note 8gKytO8sO6oj: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length
    at Decipheriv.final (internal/crypto/cipher.js:174:29)
    at decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:71:91)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:98:20)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/protected_session.js:54:34)
    at Note.decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/entities/note.js:1095:54)
    at Becca.decryptProtectedNotes (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca.js:55:18)
    at /home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca_loader.js:225:15
    at Object.emit (/home/jc/Trilium-PackagedServer/0.48.4/src/services/events.js:36:17)
    at loginToProtectedSession (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/api/login.js:70:18)
    at Function.cb (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/routes.js:145:34)
09:15:15.504 ERROR: Could not decrypt note QAPcIVVR5yZ4: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length
    at Decipheriv.final (internal/crypto/cipher.js:174:29)
    at decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:71:91)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:98:20)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/protected_session.js:54:34)
    at Note.decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/entities/note.js:1095:54)
    at Becca.decryptProtectedNotes (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca.js:55:18)
    at /home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca_loader.js:225:15
    at Object.emit (/home/jc/Trilium-PackagedServer/0.48.4/src/services/events.js:36:17)
    at loginToProtectedSession (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/api/login.js:70:18)
    at Function.cb (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/routes.js:145:34)
09:15:15.506 ERROR: Could not decrypt note EP264HAVqgB7: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length
    at Decipheriv.final (internal/crypto/cipher.js:174:29)
    at decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:71:91)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/data_encryption.js:98:20)
    at Object.decryptString (/home/jc/Trilium-PackagedServer/0.48.4/src/services/protected_session.js:54:34)
    at Note.decrypt (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/entities/note.js:1095:54)
    at Becca.decryptProtectedNotes (/home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca.js:55:18)
    at /home/jc/Trilium-PackagedServer/0.48.4/src/becca/becca_loader.js:225:15
    at Object.emit (/home/jc/Trilium-PackagedServer/0.48.4/src/services/events.js:36:17)
    at loginToProtectedSession (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/api/login.js:70:18)
    at Function.cb (/home/jc/Trilium-PackagedServer/0.48.4/src/routes/routes.js:145:34)
09:15:15.508 Sending message to all clients: {"type":"protectedSessionLogin"}
09:15:15.509 Slow 200 POST /api/login/protected with 16 bytes took 145ms
09:15:15.545 200 GET /api/tree with 30474 bytes took 2ms
09:15:15.593 200 GET /api/tree with 30474 bytes took 2ms
09:15:15.608 200 POST /api/tree/load with 30970 bytes took 2ms
09:15:15.652 200 POST /api/tree/load with 37921 bytes took 2ms
09:15:15.791 304 GET /api/tree?subTreeNoteId=Gzr3I0onLCN5 with 4006 bytes took 1ms
09:15:15.803 200 GET /api/tree?subTreeNoteId=GYUHwMSWHv1k with 6363 bytes took 1ms
09:15:15.808 200 GET /api/tree?subTreeNoteId=Gzr3I0onLCN5 with 4006 bytes took 0ms
09:15:15.814 200 GET /api/tree?subTreeNoteId=GYUHwMSWHv1k with 6363 bytes took 0ms
09:15:15.816 200 GET /api/notes/GYUHwMSWHv1k with 1864 bytes took 1ms
09:15:15.820 200 GET /api/notes/lYNxmzi2S9Kr with 2122 bytes took 1ms
09:15:15.821 200 GET /api/notes/qtrc3ZNNLnH8 with 7662 bytes took 0ms
09:15:15.844 304 GET /api/notes/lYNxmzi2S9Kr with 2122 bytes took 1ms
09:15:15.857 200 GET /api/notes/RwPag6yERhIo with 2231 bytes took 1ms
09:15:15.859 304 GET /api/notes/GYUHwMSWHv1k with 1864 bytes took 1ms
09:15:15.890 304 GET /api/notes/qtrc3ZNNLnH8 with 7662 bytes took 1ms
09:15:15.899 200 GET /api/notes/Gzr3I0onLCN5 with 1888 bytes took 1ms
09:15:15.905 304 GET /api/notes/WUONk0CNvg7h with 2321 bytes took 1ms
09:15:15.911 200 GET /api/notes/Gzr3I0onLCN5 with 1888 bytes took 1ms
09:15:20.214 200 GET /api/notes/WUONk0CNvg7h with 2321 bytes took 2ms
09:15:20.252 200 GET /api/notes/8gKytO8sO6oj with 528 bytes took 1ms

I've run consistency error fixing which came back successfull giving no signs of any fixed errors. That's a log where I had to enter the password twice, maybe I mistyped on the first occasion, though I had no message regarding this.

Sorry to bother you with such a problem. Thanks for all your work!

Joost

zadam commented 2 years ago

Hi, so from your original stack trace I understood that this problem started when creating new protected notes. In your case the note was created in an incorrect state and thus not readable/writable. What's fixed now is this creation so you should be able to create and edit new protected notes without problem.

The messed up protected notes which you created are unfortunately unusable, I recommend deleting them. Since they were unusable from the start, they are empty and thus no actual loss should happen.

Protected notes are not part of consistency checks since to check them you need to have a password. But consistency checks don't have access to the password.

Hopefully my assumptions are correct and after deleting those old messed up protected notes all should work fine from then on ...

HiFiJ commented 2 years ago

Hi zadam,

sorry for getting back to you so lately! On the other hand I can confirm now after more than a week of testing/using the latest release that the problem is fixed in 0.48.5.

Once again thanks for your awesome work and support!!

Best regards,

Joost