trilium icon indicating copy to clipboard operation
trilium copied to clipboard

Consistency error: Fixer failed with Cannot set properties of undefined (setting 'parentNoteId') TypeError: Cannot set properties of undefined (setting 'parentNoteId')

Open jmu opened this issue 1 year ago • 3 comments

For bug reports, PLEASE mention version of Trilium you're using and also include log files from following location:

trilium | Consistency error: Fixer failed with Cannot set properties of undefined (setting 'parentNoteId') TypeError: Cannot set properties of undefined (setting 'parentNoteId') trilium | at /usr/src/app/src/services/consistency_checks.js:152:41 trilium | at Function. (/usr/src/app/src/services/consistency_checks.js:31:41) trilium | at Function.sqliteTransaction (/usr/src/app/node_modules/better-sqlite3/lib/methods/transaction.js:65:24)

tried two versions follow, and not update to the latest version, similar error #image: zadam/trilium:0.54.3 image: zadam/trilium:0.56-latest

more log:

trilium | Consistency error: Fixer failed with Cannot set properties of undefined (setting 'parentNoteId') TypeError: Cannot set properties of undefined (setting 'parentNoteId') trilium | at /usr/src/app/src/services/consistency_checks.js:152:41 trilium | at Function. (/usr/src/app/src/services/consistency_checks.js:31:41) trilium | at Function.sqliteTransaction (/usr/src/app/node_modules/better-sqlite3/lib/methods/transaction.js:65:24) trilium | at Object.transactional (/usr/src/app/src/services/sql.js:236:52) trilium | at ConsistencyChecks.findAndFixIssues (/usr/src/app/src/services/consistency_checks.js:31:21) trilium | at ConsistencyChecks.findBrokenReferenceIssues (/usr/src/app/src/services/consistency_checks.js:142:14) trilium | at ConsistencyChecks.runAllChecksAndFixers (/usr/src/app/src/services/consistency_checks.js:662:14) trilium | at /usr/src/app/src/services/consistency_checks.js:708:18 trilium | at Object.doExclusively (/usr/src/app/src/services/sync_mutex.js:13:22) trilium | at async ConsistencyChecks.runChecks (/usr/src/app/src/services/consistency_checks.js:703:9) trilium | Consistency error: Fixer failed with Cannot set properties of undefined (setting 'parentNoteId') TypeError: Cannot set properties of undefined (setting 'parentNoteId') trilium | at /usr/src/app/src/services/consistency_checks.js:152:41 trilium | at Function. (/usr/src/app/src/services/consistency_checks.js:31:41) trilium | at Function.sqliteTransaction (/usr/src/app/node_modules/better-sqlite3/lib/methods/transaction.js:65:24) trilium | at Object.transactional (/usr/src/app/src/services/sql.js:236:52) trilium | at ConsistencyChecks.findAndFixIssues (/usr/src/app/src/services/consistency_checks.js:31:21) trilium | at ConsistencyChecks.findBrokenReferenceIssues (/usr/src/app/src/services/consistency_checks.js:142:14) trilium | at ConsistencyChecks.runAllChecksAndFixers (/usr/src/app/src/services/consistency_checks.js:662:14) trilium | at /usr/src/app/src/services/consistency_checks.js:708:18 trilium | at Object.doExclusively (/usr/src/app/src/services/sync_mutex.js:13:22) trilium | at async ConsistencyChecks.runChecks (/usr/src/app/src/services/consistency_checks.js:703:9) trilium | Consistency error: Fixer failed with Cannot set properties of undefined (setting 'parentNoteId') TypeError: Cannot set properties of undefined (setting 'parentNoteId') trilium | at /usr/src/app/src/services/consistency_checks.js:152:41 trilium | at Function. (/usr/src/app/src/services/consistency_checks.js:31:41) trilium | at Function.sqliteTransaction (/usr/src/app/node_modules/better-sqlite3/lib/methods/transaction.js:65:24) trilium | at Object.transactional (/usr/src/app/src/services/sql.js:236:52) trilium | at ConsistencyChecks.findAndFixIssues (/usr/src/app/src/services/consistency_checks.js:31:21) trilium | at ConsistencyChecks.findBrokenReferenceIssues (/usr/src/app/src/services/consistency_checks.js:142:14) trilium | at ConsistencyChecks.runAllChecksAndFixers (/usr/src/app/src/services/consistency_checks.js:662:14) trilium | at /usr/src/app/src/services/consistency_checks.js:708:18 trilium | at Object.doExclusively (/usr/src/app/src/services/sync_mutex.js:13:22) trilium | at async ConsistencyChecks.runChecks (/usr/src/app/src/services/consistency_checks.js:703:9) trilium | Consistency error: Fixer failed with Cannot set properties of undefined (setting 'parentNoteId') TypeError: Cannot set properties of undefined (setting 'parentNoteId') trilium | at /usr/src/app/src/services/consistency_checks.js:152:41 trilium | at Function. (/usr/src/app/src/services/consistency_checks.js:31:41) trilium | at Function.sqliteTransaction (/usr/src/app/node_modules/better-sqlite3/lib/methods/transaction.js:65:24) trilium | at Object.transactional (/usr/src/app/src/services/sql.js:236:52) trilium | at ConsistencyChecks.findAndFixIssues (/usr/src/app/src/services/consistency_checks.js:31:21) trilium | at ConsistencyChecks.findBrokenReferenceIssues (/usr/src/app/src/services/consistency_checks.js:142:14) trilium | at ConsistencyChecks.runAllChecksAndFixers (/usr/src/app/src/services/consistency_checks.js:662:14) trilium | at /usr/src/app/src/services/consistency_checks.js:708:18 trilium | at Object.doExclusively (/usr/src/app/src/services/sync_mutex.js:13:22) trilium | at async ConsistencyChecks.runChecks (/usr/src/app/src/services/consistency_checks.js:703:9) trilium | Consistency error: Fixer failed with Cannot set properties of undefined (setting 'parentNoteId') TypeError: Cannot set properties of undefined (setting 'parentNoteId') trilium | at /usr/src/app/src/services/consistency_checks.js:152:41 trilium | at Function. (/usr/src/app/src/services/consistency_checks.js:31:41) trilium | at Function.sqliteTransaction (/usr/src/app/node_modules/better-sqlite3/lib/methods/transaction.js:65:24) trilium | at Object.transactional (/usr/src/app/src/services/sql.js:236:52) trilium | at ConsistencyChecks.findAndFixIssues (/usr/src/app/src/services/consistency_checks.js:31:21) trilium | at ConsistencyChecks.findBrokenReferenceIssues (/usr/src/app/src/services/consistency_checks.js:142:14) trilium | at ConsistencyChecks.runAllChecksAndFixers (/usr/src/app/src/services/consistency_checks.js:662:14) trilium | at /usr/src/app/src/services/consistency_checks.js:708:18 trilium | at Object.doExclusively (/usr/src/app/src/services/sync_mutex.js:13:22) trilium | at async ConsistencyChecks.runChecks (/usr/src/app/src/services/consistency_checks.js:703:9) trilium | Consistency error: Fixer failed with Cannot set properties of undefined (setting 'parentNoteId') TypeError: Cannot set properties of undefined (setting 'parentNoteId') trilium | at /usr/src/app/src/services/consistency_checks.js:152:41 trilium | at Function. (/usr/src/app/src/services/consistency_checks.js:31:41) trilium | at Function.sqliteTransaction (/usr/src/app/node_modules/better-sqlite3/lib/methods/transaction.js:65:24) trilium | at Object.transactional (/usr/src/app/src/services/sql.js:236:52) trilium | at ConsistencyChecks.findAndFixIssues (/usr/src/app/src/services/consistency_checks.js:31:21) trilium | at ConsistencyChecks.findBrokenReferenceIssues (/usr/src/app/src/services/consistency_checks.js:142:14) trilium | at ConsistencyChecks.runAllChecksAndFixers (/usr/src/app/src/services/consistency_checks.js:662:14) trilium | at /usr/src/app/src/services/consistency_checks.js:708:18 trilium | at Object.doExclusively (/usr/src/app/src/services/sync_mutex.js:13:22) trilium | at async ConsistencyChecks.runChecks (/usr/src/app/src/services/consistency_checks.js:703:9) trilium | Consistency error: Fixer failed with Cannot set properties of undefined (setting 'parentNoteId') TypeError: Cannot set properties of undefined (setting 'parentNoteId') trilium | at /usr/src/app/src/services/consistency_checks.js:152:41 trilium | at Function. (/usr/src/app/src/services/consistency_checks.js:31:41) trilium | at Function.sqliteTransaction (/usr/src/app/node_modules/better-sqlite3/lib/methods/transaction.js:65:24) trilium | at Object.transactional (/usr/src/app/src/services/sql.js:236:52) trilium | at ConsistencyChecks.findAndFixIssues (/usr/src/app/src/services/consistency_checks.js:31:21) trilium | at ConsistencyChecks.findBrokenReferenceIssues (/usr/src/app/src/services/consistency_checks.js:142:14) trilium | at ConsistencyChecks.runAllChecksAndFixers (/usr/src/app/src/services/consistency_checks.js:662:14) trilium | at /usr/src/app/src/services/consistency_checks.js:708:18 trilium | at Object.doExclusively (/usr/src/app/src/services/sync_mutex.js:13:22) trilium | at async ConsistencyChecks.runChecks (/usr/src/app/src/services/consistency_checks.js:703:9) trilium | Consistency error: Fixer failed with Cannot set properties of undefined (setting 'parentNoteId') TypeError: Cannot set properties of undefined (setting 'parentNoteId') trilium | at /usr/src/app/src/services/consistency_checks.js:152:41 trilium | at Function. (/usr/src/app/src/services/consistency_checks.js:31:41) trilium | at Function.sqliteTransaction (/usr/src/app/node_modules/better-sqlite3/lib/methods/transaction.js:65:24) trilium | at Object.transactional (/usr/src/app/src/services/sql.js:236:52) trilium | at ConsistencyChecks.findAndFixIssues (/usr/src/app/src/services/consistency_checks.js:31:21) trilium | at ConsistencyChecks.findBrokenReferenceIssues (/usr/src/app/src/services/consistency_checks.js:142:14) trilium | at ConsistencyChecks.runAllChecksAndFixers (/usr/src/app/src/services/consistency_checks.js:662:14) trilium | at /usr/src/app/src/services/consistency_checks.js:708:18 trilium | at Object.doExclusively (/usr/src/app/src/services/sync_mutex.js:13:22) trilium | at async ConsistencyChecks.runChecks (/usr/src/app/src/services/consistency_checks.js:703:9) trilium | Consistency error: Fixer failed with Cannot set properties of undefined (setting 'parentNoteId') TypeError: Cannot set properties of undefined (setting 'parentNoteId') trilium | at /usr/src/app/src/services/consistency_checks.js:152:41 trilium | at Function. (/usr/src/app/src/services/consistency_checks.js:31:41) trilium | at Function.sqliteTransaction (/usr/src/app/node_modules/better-sqlite3/lib/methods/transaction.js:65:24) trilium | at Object.transactional (/usr/src/app/src/services/sql.js:236:52) trilium | at ConsistencyChecks.findAndFixIssues (/usr/src/app/src/services/consistency_checks.js:31:21) trilium | at ConsistencyChecks.findBrokenReferenceIssues (/usr/src/app/src/services/consistency_checks.js:142:14) trilium | at ConsistencyChecks.runAllChecksAndFixers (/usr/src/app/src/services/consistency_checks.js:662:14) trilium | at /usr/src/app/src/services/consistency_checks.js:708:18 trilium | at Object.doExclusively (/usr/src/app/src/services/sync_mutex.js:13:22) trilium | at async ConsistencyChecks.runChecks (/usr/src/app/src/services/consistency_checks.js:703:9) trilium | SqliteError: database disk image is malformed trilium | at /usr/src/app/src/services/sql.js:131:31 trilium | at wrap (/usr/src/app/src/services/sql.js:206:18) trilium | at Object.getRows (/usr/src/app/src/services/sql.js:131:12) trilium | at ConsistencyChecks.findAndFixIssues (/usr/src/app/src/services/consistency_checks.js:27:29) trilium | at ConsistencyChecks.findExistencyIssues (/usr/src/app/src/services/consistency_checks.js:249:14) trilium | at ConsistencyChecks.runAllChecksAndFixers (/usr/src/app/src/services/consistency_checks.js:664:14) trilium | at /usr/src/app/src/services/consistency_checks.js:708:18 trilium | at Object.doExclusively (/usr/src/app/src/services/sync_mutex.js:13:22) trilium | at async ConsistencyChecks.runChecks (/usr/src/app/src/services/consistency_checks.js:703:9) trilium | SqliteError: database disk image is malformed trilium | at /usr/src/app/src/services/sql.js:131:31 trilium | at wrap (/usr/src/app/src/services/sql.js:206:18) trilium | at Object.getRows (/usr/src/app/src/services/sql.js:131:12) trilium | at ConsistencyChecks.findAndFixIssues (/usr/src/app/src/services/consistency_checks.js:27:29) trilium | at ConsistencyChecks.findExistencyIssues (/usr/src/app/src/services/consistency_checks.js:249:14) trilium | at ConsistencyChecks.runAllChecksAndFixers (/usr/src/app/src/services/consistency_checks.js:664:14) trilium | at /usr/src/app/src/services/consistency_checks.js:708:18 trilium | at Object.doExclusively (/usr/src/app/src/services/sync_mutex.js:13:22) trilium | at async ConsistencyChecks.runChecks (/usr/src/app/src/services/consistency_checks.js:703:9) trilium | websocket client connected

jmu avatar Feb 12 '23 16:02 jmu

Hi, did you update to the latest version? If you have issues, please post errors for the latest version.

zadam avatar Feb 12 '23 17:02 zadam

Hi, did you update to the latest version? If you have issues, please post errors for the latest version.

I tried to update the latest version. here is the log: trilium | No USER_UID specified, leaving 1000 trilium | No USER_GID specified, leaving 1000 trilium | App db version is 212, while db version is 197. Migration needed. trilium | DB size: 60162 KB trilium | Trusted reverse proxy: false trilium | App HTTP server starting up at port 8080 trilium | { trilium | "appVersion": "0.58.7", trilium | "dbVersion": 212, trilium | "syncVersion": 29, trilium | "buildDate": "2023-01-17T23:14:58+01:00", trilium | "buildRevision": "a3149aecf41bac3c559ebbd1865e916264985ac3", trilium | "dataDirectory": "/data", trilium | "clipperProtocolVersion": "1.0", trilium | "utcDateTime": "2023-02-13T01:57:15.623Z" trilium | } trilium | CPU model: Cortex-A72, logical cores: 4 freq: 1500 Mhz trilium | Listening on port 8080 trilium | Created backup at /data/backup/backup-before-migration.db trilium | Attempting migration to version 198 trilium | Migration with SQL script: UPDATE branches SET branchId = '_hidden__search' WHERE parentNoteId = 'hidden' AND noteId = 'search' AND isDeleted = 0; trilium | UPDATE branches SET branchId = 'root__globalNoteMap' WHERE parentNoteId = 'singles' AND noteId = 'globalnotemap' AND isDeleted = 0; trilium | UPDATE branches SET branchId = '_hidden__sqlConsole' WHERE parentNoteId = 'hidden' AND noteId = 'sqlconsole' AND isDeleted = 0; trilium | UPDATE branches SET branchId = 'root__hidden' WHERE parentNoteId = 'root' AND noteId = 'hidden' AND isDeleted = 0; trilium | UPDATE branches SET branchId = '_hidden__bulkAction' WHERE parentNoteId = 'hidden' AND noteId = 'bulkaction' AND isDeleted = 0; trilium | UPDATE branches SET branchId = '_hidden__share' WHERE parentNoteId = 'root' AND noteId = 'share' AND isDeleted = 0; trilium | trilium | Migration to version 198 has been successful. trilium | Attempting migration to version 199 trilium | Migration with SQL script: UPDATE notes SET noteId = '_globalNoteMap', title = 'Note Map' WHERE noteId = 'globalnotemap'; trilium | UPDATE note_contents SET noteId = '_globalNoteMap' WHERE noteId = 'globalnotemap'; trilium | UPDATE note_revisions SET noteId = '_globalNoteMap' WHERE noteId = 'globalnotemap'; trilium | UPDATE branches SET noteId = '_globalNoteMap' WHERE noteId = 'globalnotemap'; trilium | UPDATE branches SET parentNoteId = '_globalNoteMap' WHERE parentNoteId = 'globalnotemap'; trilium | UPDATE attributes SET noteId = '_globalNoteMap' WHERE noteId = 'globalnotemap'; trilium | UPDATE attributes SET value = '_globalNoteMap' WHERE type = 'relation' AND value = 'globalnotemap'; trilium | UPDATE entity_changes SET entityId = '_globalNoteMap' WHERE entityId = 'globalnotemap'; trilium | trilium | UPDATE notes SET noteId = '_bulkAction', title = 'Bulk Action' WHERE noteId = 'bulkaction'; trilium | UPDATE note_contents SET noteId = '_bulkAction' WHERE noteId = 'bulkaction'; trilium | UPDATE note_revisions SET noteId = '_bulkAction' WHERE noteId = 'bulkaction'; trilium | UPDATE branches SET parentNoteId = '_bulkAction' WHERE parentNoteId = 'bulkaction'; trilium | UPDATE branches SET noteId = '_bulkAction' WHERE noteId = 'bulkaction'; trilium | UPDATE attributes SET noteId = '_bulkAction' WHERE noteId = 'bulkaction'; trilium | UPDATE attributes SET value = '_bulkAction' WHERE type = 'relation' AND value = 'bulkaction'; trilium | UPDATE entity_changes SET entityId = '_bulkAction' WHERE entityId = 'bulkaction'; trilium | trilium | UPDATE notes SET noteId = '_sqlConsole', title = 'SQL Console History' WHERE noteId = 'sqlconsole'; trilium | UPDATE note_contents SET noteId = '_sqlConsole' WHERE noteId = 'sqlconsole'; trilium | UPDATE note_revisions SET noteId = '_sqlConsole' WHERE noteId = 'sqlconsole'; trilium | UPDATE branches SET noteId = '_sqlConsole' WHERE noteId = 'sqlconsole'; trilium | UPDATE branches SET parentNoteId = '_sqlConsole' WHERE parentNoteId = 'sqlconsole'; trilium | UPDATE attributes SET noteId = '_sqlConsole' WHERE noteId = 'sqlconsole'; trilium | UPDATE attributes SET value = '_sqlConsole' WHERE type = 'relation' AND value = 'sqlconsole'; trilium | UPDATE entity_changes SET entityId = '_sqlConsole' WHERE entityId = 'sqlconsole'; trilium | trilium | UPDATE notes SET noteId = '_hidden', title = 'Hidden Notes' WHERE noteId = 'hidden'; trilium | UPDATE note_contents SET noteId = '_hidden' WHERE noteId = 'hidden'; trilium | UPDATE note_revisions SET noteId = '_hidden' WHERE noteId = 'hidden'; trilium | UPDATE branches SET noteId = '_hidden', prefix = NULL WHERE noteId = 'hidden'; trilium | UPDATE branches SET parentNoteId = '_hidden' WHERE parentNoteId = 'hidden'; trilium | UPDATE attributes SET noteId = '_hidden' WHERE noteId = 'hidden'; trilium | UPDATE attributes SET value = '_hidden' WHERE type = 'relation' AND value = 'hidden'; trilium | UPDATE entity_changes SET entityId = '_hidden' WHERE entityId = 'hidden'; trilium | trilium | UPDATE notes SET noteId = '_search', title = 'Search History' WHERE noteId = 'search'; trilium | UPDATE note_contents SET noteId = '_search' WHERE noteId = 'search'; trilium | UPDATE note_revisions SET noteId = '_search' WHERE noteId = 'search'; trilium | UPDATE branches SET noteId = '_search' WHERE noteId = 'search'; trilium | UPDATE branches SET parentNoteId = '_search' WHERE parentNoteId = 'search'; trilium | UPDATE attributes SET noteId = '_search' WHERE noteId = 'search'; trilium | UPDATE attributes SET value = '_search' WHERE type = 'relation' AND value = 'search'; trilium | UPDATE entity_changes SET entityId = '_search' WHERE entityId = 'search'; trilium | trilium | UPDATE notes SET noteId = '_share', title = 'Shared Notes' WHERE noteId = 'share'; trilium | UPDATE note_contents SET noteId = '_share' WHERE noteId = 'share'; trilium | UPDATE note_revisions SET noteId = '_share' WHERE noteId = 'share'; trilium | UPDATE branches SET noteId = '_share' WHERE noteId = 'share'; trilium | UPDATE branches SET parentNoteId = '_share' WHERE parentNoteId = 'share'; trilium | UPDATE attributes SET noteId = '_share' WHERE noteId = 'share'; trilium | UPDATE attributes SET value = '_share' WHERE type = 'relation' AND value = 'share'; trilium | UPDATE entity_changes SET entityId = '_share' WHERE entityId = 'share'; trilium | trilium | Migration to version 199 has been successful. trilium | Attempting migration to version 200 trilium | Migration with JS module trilium | Slow query took 21ms: SELECT noteId, title, type, mime, isProtected, dateCreated, dateModified, utcDateCreated, utcDateModified FROM notes WHERE isDeleted = 0 trilium | Slow query took 23ms: SELECT attributeId, noteId, type, name, value, isInheritable, position, utcDateModified FROM attributes WHERE isDeleted = 0 trilium | Becca (note cache) load took 218ms trilium | Created new note '_share', branch '_hidden__share' of type 'doc', mime '' trilium | Created new note '_backendLog', branch '_hidden__backendLog' of type 'contentWidget', mime '' trilium | Created new note '_userHidden', branch '_hidden__userHidden' of type 'doc', mime '' trilium | Created new note '_lbTplRoot', branch '_hidden__lbTplRoot' of type 'doc', mime '' trilium | Created new note '_lbTplBase', branch '_lbTplRoot__lbTplBase' of type 'doc', mime '' trilium | Created new note '_lbTplCommandLauncher', branch '_lbTplRoot__lbTplCommandLauncher' of type 'doc', mime '' trilium | Created new note '_lbTplNoteLauncher', branch '_lbTplRoot__lbTplNoteLauncher' of type 'doc', mime '' trilium | Created new note '_lbTplScriptLauncher', branch '_lbTplRoot__lbTplScriptLauncher' of type 'doc', mime '' trilium | Created new note '_lbTplBuiltinWidget', branch '_lbTplRoot__lbTplBuiltinWidget' of type 'doc', mime '' trilium | Created new note '_lbTplSpacer', branch '_lbTplRoot__lbTplSpacer' of type 'doc', mime '' trilium | Created new note '_lbTplCustomWidget', branch '_lbTplRoot__lbTplCustomWidget' of type 'doc', mime '' trilium | Created new note '_lbRoot', branch '_hidden__lbRoot' of type 'doc', mime '' trilium | Created new note '_lbAvailableLaunchers', branch '_lbRoot__lbAvailableLaunchers' of type 'doc', mime '' trilium | Created new note '_lbBackInHistory', branch '_lbAvailableLaunchers__lbBackInHistory' of type 'launcher', mime '' trilium | Created new note '_lbForwardInHistory', branch '_lbAvailableLaunchers__lbForwardInHistory' of type 'launcher', mime '' trilium | Created new note '_lbBackendLog', branch '_lbAvailableLaunchers__lbBackendLog' of type 'launcher', mime '' trilium | Created new note '_lbVisibleLaunchers', branch '_lbRoot__lbVisibleLaunchers' of type 'doc', mime '' trilium | Created new note '_lbNewNote', branch '_lbVisibleLaunchers__lbNewNote' of type 'launcher', mime '' trilium | Created new note '_lbSearch', branch '_lbVisibleLaunchers__lbSearch' of type 'launcher', mime '' trilium | Created new note '_lbJumpTo', branch '_lbVisibleLaunchers__lbJumpTo' of type 'launcher', mime '' trilium | Created new note '_lbNoteMap', branch '_lbVisibleLaunchers__lbNoteMap' of type 'launcher', mime '' trilium | Created new note '_lbCalendar', branch '_lbVisibleLaunchers__lbCalendar' of type 'launcher', mime '' trilium | Created new note '_lbRecentChanges', branch '_lbVisibleLaunchers__lbRecentChanges' of type 'launcher', mime '' trilium | Created new note '_lbSpacer1', branch '_lbVisibleLaunchers__lbSpacer1' of type 'launcher', mime '' trilium | Created new note '_lbBookmarks', branch '_lbVisibleLaunchers__lbBookmarks' of type 'launcher', mime '' trilium | Created new note '_lbToday', branch '_lbVisibleLaunchers__lbToday' of type 'launcher', mime '' trilium | Created new note '_lbSpacer2', branch '_lbVisibleLaunchers__lbSpacer2' of type 'launcher', mime '' trilium | Created new note '_lbProtectedSession', branch '_lbVisibleLaunchers__lbProtectedSession' of type 'launcher', mime '' trilium | Created new note '_lbSyncStatus', branch '_lbVisibleLaunchers__lbSyncStatus' of type 'launcher', mime '' trilium | Created new note '_options', branch '_hidden__options' of type 'book', mime '' trilium | Created new note '_optionsAppearance', branch '_options__optionsAppearance' of type 'contentWidget', mime '' trilium | Created new note '_optionsShortcuts', branch '_options__optionsShortcuts' of type 'contentWidget', mime '' trilium | Created new note '_optionsTextNotes', branch '_options__optionsTextNotes' of type 'contentWidget', mime '' trilium | Created new note '_optionsCodeNotes', branch '_options__optionsCodeNotes' of type 'contentWidget', mime '' trilium | Created new note '_optionsImages', branch '_options__optionsImages' of type 'contentWidget', mime '' trilium | Created new note '_optionsSpellcheck', branch '_options__optionsSpellcheck' of type 'contentWidget', mime '' trilium | Created new note '_optionsPassword', branch '_options__optionsPassword' of type 'contentWidget', mime '' trilium | Created new note '_optionsEtapi', branch '_options__optionsEtapi' of type 'contentWidget', mime '' trilium | Created new note '_optionsBackup', branch '_options__optionsBackup' of type 'contentWidget', mime '' trilium | Created new note '_optionsSync', branch '_options__optionsSync' of type 'contentWidget', mime '' trilium | Created new note '_optionsOther', branch '_options__optionsOther' of type 'contentWidget', mime '' trilium | Created new note '_optionsAdvanced', branch '_options__optionsAdvanced' of type 'contentWidget', mime '' trilium | Migration to version 200 has been successful. trilium | Attempting migration to version 201 trilium | Migration with SQL script: DELETE FROM branches WHERE noteId = '_share' AND parentNoteId != 'root' AND parentNoteId != '_hidden'; -- delete all other branches of _share if any trilium | UPDATE branches SET parentNoteId = '_hidden' WHERE noteId = '_share'; trilium | trilium | Migration to version 201 has been successful. trilium | Attempting migration to version 202 trilium | Migration with SQL script: DELETE FROM branches WHERE noteId = '_globalNoteMap' AND parentNoteId != 'singles' AND parentNoteId != '_hidden'; -- make sure there are no clones which would fail at the next line trilium | UPDATE branches SET parentNoteId = '_hidden' WHERE noteId = '_globalNoteMap'; trilium | trilium | Migration to version 202 has been successful. trilium | Attempting migration to version 203 trilium | Migration with SQL script: DELETE FROM branches WHERE noteId = 'singles'; trilium | DELETE FROM notes WHERE noteId = 'singles'; trilium | DELETE FROM note_contents WHERE noteId = 'singles'; trilium | DELETE FROM note_revisions WHERE noteId = 'singles'; trilium | DELETE FROM attributes WHERE noteId = 'singles'; trilium | DELETE FROM entity_changes WHERE entityId = 'singles'; trilium | trilium | Migration to version 203 has been successful. trilium | Attempting migration to version 204 trilium | Migration with JS module trilium | Slow query took 23ms: SELECT attributeId, noteId, type, name, value, isInheritable, position, utcDateModified FROM attributes WHERE isDeleted = 0 trilium | Becca (note cache) load took 159ms trilium | Migration to version 204 has been successful. trilium | Attempting migration to version 205 trilium | Migration with SQL script: UPDATE notes SET type = 'relationMap' WHERE type = 'relation-map'; trilium | UPDATE notes SET type = 'noteMap' WHERE type = 'note-map'; trilium | UPDATE notes SET type = 'webView' WHERE type = 'web-view'; trilium | trilium | Migration to version 205 has been successful. trilium | Attempting migration to version 206 trilium | Migration with JS module trilium | Slow query took 26ms: SELECT attributeId, noteId, type, name, value, isInheritable, position, utcDateModified FROM attributes WHERE isDeleted = 0 trilium | Becca (note cache) load took 99ms trilium | Marking branches UyaM1bC0jxDO as deleted trilium | Deleting note eaZDIhN1nV0Z trilium | Marking attributes 6hrq7tYH5lGz as deleted trilium | Marking attributes jcLdshsMUxap as deleted trilium | Marking notes eaZDIhN1nV0Z as deleted trilium | Marking branches AIroMYg0ItGW as deleted trilium | Deleting note VEMS5d1MYL7W trilium | Marking attributes mC9irOaII23k as deleted trilium | Marking attributes OJgatvPlIJEt as deleted trilium | Marking notes VEMS5d1MYL7W as deleted trilium | Marking branches VW0QnMMHhOsk as deleted trilium | Deleting note xmLWd7WW6Qfa trilium | Marking attributes fUp5VKgqNLzR as deleted trilium | Marking attributes dqhHljzODegl as deleted trilium | Marking notes xmLWd7WW6Qfa as deleted trilium | Marking branches 2rMltcYvmqsI as deleted trilium | Deleting note HW9Sbl1o4t71 trilium | Marking attributes fyjts3STIoSS as deleted trilium | Marking attributes Xhu7jIUyeUFd as deleted trilium | Marking notes HW9Sbl1o4t71 as deleted trilium | Marking branches 0l3KOxsuRgBo as deleted trilium | Deleting note hftQ0iBHLS0V trilium | Marking attributes khWlJ59vkuWv as deleted trilium | Marking attributes 6NyVgILwD0f4 as deleted trilium | Marking notes hftQ0iBHLS0V as deleted trilium | Marking branches ScwEz2LvyX4C as deleted trilium | Deleting note Mijmuf5LOmxr trilium | Marking attributes iQQdXDhN4TMb as deleted trilium | Marking attributes s4KAPeBh88Ta as deleted trilium | Marking notes Mijmuf5LOmxr as deleted trilium | Marking branches gNpss8t3DBZ6 as deleted trilium | Deleting note QgoRQh0vkcti trilium | Marking attributes L9K0NlqIfDmi as deleted trilium | Marking attributes JHKrlrfmgoS6 as deleted trilium | Marking notes QgoRQh0vkcti as deleted trilium | Marking branches RB6k1yrGxMvW as deleted trilium | Deleting note xGwPtAs4Jz0D trilium | Marking attributes 0lgYJDMpoO7R as deleted trilium | Marking attributes mynR4bBG9TlM as deleted trilium | Marking notes xGwPtAs4Jz0D as deleted trilium | Marking branches 15PJavGMgRdk as deleted trilium | Deleting note hoAauR0isBc4 trilium | Marking attributes wTbmA5YxrAN3 as deleted trilium | Marking attributes KWIanTUE0MuC as deleted trilium | Marking notes hoAauR0isBc4 as deleted trilium | Marking branches VU7sDjww5tYp as deleted trilium | Deleting note 6ZpEVCS8xWlQ trilium | Marking attributes aLhFXP7B8uTA as deleted trilium | Marking notes 6ZpEVCS8xWlQ as deleted trilium | Migration to version 206 has been successful. trilium | Attempting migration to version 207 trilium | Migration with SQL script: UPDATE notes SET title = 'SQL Console History' WHERE noteId = 'sqlConsole'; trilium | UPDATE notes SET title = 'Search History' WHERE noteId = 'search'; trilium | Migration to version 207 has been successful. trilium | Attempting migration to version 208 trilium | Migration with JS module trilium | Slow query took 24ms: SELECT attributeId, noteId, type, name, value, isInheritable, position, utcDateModified FROM attributes WHERE isDeleted = 0 trilium | Becca (note cache) load took 149ms trilium | Marking attributes iTG054ur6yML as deleted trilium | Migration to version 208 has been successful. trilium | Attempting migration to version 209 trilium | Migration with SQL script: UPDATE attributes SET name = 'workspaceInbox' WHERE type = 'label' AND name = 'hoistedInbox'; trilium | UPDATE entity_changes SET entityId = 'workspaceInbox' WHERE entityName = 'attributes' AND entityId = 'hoistedInbox'; trilium | trilium | UPDATE attributes SET name = 'workspaceSearchHome' WHERE type = 'label' AND name = 'hoistedSearchHome'; trilium | UPDATE entity_changes SET entityId = 'workspaceSearchHome' WHERE entityName = 'attributes' AND entityId = 'hoistedSearchHome'; trilium | trilium | Migration to version 209 has been successful. trilium | Attempting migration to version 210 trilium | Migration with JS module trilium | Transaction rollback dirtied the becca, forcing reload. trilium | Slow query took 24ms: SELECT attributeId, noteId, type, name, value, isInheritable, position, utcDateModified FROM attributes WHERE isDeleted = 0 trilium | Becca (note cache) load took 102ms trilium | Migration to version 210 has been successful. trilium | Attempting migration to version 211 trilium | Migration with SQL script: -- case based on isDeleted is needed, otherwise 2 branches (1 deleted, 1 not) might get the same ID trilium | UPDATE entity_changes SET entityId = COALESCE(( trilium | SELECT trilium | CASE isDeleted trilium | WHEN 0 THEN parentNoteId || '' || noteId trilium | WHEN 1 THEN branchId trilium | END trilium | FROM branches WHERE branchId = entityId trilium | ), entityId) trilium | WHERE entityName = 'branches' AND isErased = 0; trilium | trilium | UPDATE branches SET branchId = parentNoteId || '' || noteId WHERE isDeleted = 0; trilium | trilium | ERROR: error during migration to version 211: SqliteError: database disk image is malformed trilium | at Database.exec (/usr/src/app/node_modules/better-sqlite3/lib/methods/wrappers.js:9:14) trilium | at Object.executeScript (/usr/src/app/src/services/sql.js:200:25) trilium | at executeMigration (/usr/src/app/src/services/migration.js:80:13) trilium | at Function. (/usr/src/app/src/services/migration.js:56:17) trilium | at Function.sqliteTransaction (/usr/src/app/node_modules/better-sqlite3/lib/methods/transaction.js:65:24) trilium | at Object.transactional (/usr/src/app/src/services/sql.js:242:52) trilium | at migrate (/usr/src/app/src/services/migration.js:51:9) trilium | at async Object.migrateIfNecessary (/usr/src/app/src/services/migration.js:117:9) trilium | at async initDbConnection (/usr/src/app/src/services/sql_init.js:41:5) trilium | ERROR: migration failed, crashing hard trilium | App db version is 212, while db version is 197. Migration needed. trilium | DB size: 60162 KB trilium | Trusted reverse proxy: false trilium | App HTTP server starting up at port 8080 trilium | { trilium | "appVersion": "0.58.7", trilium | "dbVersion": 212, trilium | "syncVersion": 29, trilium | "buildDate": "2023-01-17T23:14:58+01:00", trilium | "buildRevision": "a3149aecf41bac3c559ebbd1865e916264985ac3", trilium | "dataDirectory": "/data", trilium | "clipperProtocolVersion": "1.0", trilium | "utcDateTime": "2023-02-13T01:57:27.261Z" trilium | } trilium | CPU model: Cortex-A72, logical cores: 4 freq: 1500 Mhz trilium | Listening on port 8080

jmu avatar Feb 13 '23 01:02 jmu

There's this (actually appearing also in previous logs, but I didn't notice it before):

SqliteError: database disk image is malformed

This means that the database file is corrupted. Most often it happens when user attempts to sync the DB file with e.g. dropbox or similar. Another possibility is some power failure or hardware problem.

This can be fixed only with restoring the backup: https://github.com/zadam/trilium/wiki/Backup#restoring-backup

zadam avatar Feb 13 '23 14:02 zadam