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) Data loss in multiple notes while using the application #3829

Closed akaep closed 1 year ago

akaep commented 1 year ago

Trilium Version

0.58.8

What operating system are you using?

Windows

What is your setup?

Local (no sync)

Operating System Version

Windows 11 Home - 22H2

Description

I've been using Trilium for a year without any issues. Originally ran Server with multiple Clients on various computers, but only needed the one computer, so I disconnected the Server about 6 months ago and have been using just the Client since.

Over the past couple days, I've been writing for a project in multiple notes in multiple subtrees. While using the application just now, I wrote in one of the notes (note 1) I've had open for 2 days, clicked to another of my notes in a different subtree (note 2) and note 2 was blank, whereas it had A LOT of information in it just minutes before. When I clicked back to note 1, it was now blank as well, but literally seconds prior it was also full of information. I have snapshots set to 600 seconds, but Note Revisions is blank on both notes, like no data was ever entered.

It seems to be limited to these two notes, but it seems I've lost 48 hours worth of work. Would love some help here. Are my notes just gone?

Error logs

Backend Logs: 11:41:10.941 Table counts: notes: 889, note_revisions: 96, branches: 898, attributes: 1814, etapi_tokens: 0 11:41:11.105 Slow query took 154ms: SELECT notes.noteId, notes.type, notes.mime FROM notes JOIN note_contents USING (noteId) WHERE isDeleted = 0 AND isProtected = 0 AND content IS NULL 11:41:11.108 All consistency checks passed with no errors detected (took 167ms) 11:41:29.901 No connection to sync server. 11:42:29.932 No connection to sync server. 11:43:29.918 No connection to sync server. 11:44:29.931 No connection to sync server. 11:45:29.969 No connection to sync server. 11:46:29.930 No connection to sync server. 11:47:29.960 No connection to sync server. 11:48:29.983 No connection to sync server. 11:49:29.942 No connection to sync server. 11:50:29.971 No connection to sync server. 11:51:29.979 No connection to sync server. 11:52:29.972 No connection to sync server. 11:53:29.982 No connection to sync server. 11:54:30.043 No connection to sync server. 11:55:30.011 No connection to sync server. 11:56:30.006 No connection to sync server. 11:57:30.064 No connection to sync server. 11:58:30.009 No connection to sync server. 11:59:30.025 No connection to sync server. 12:00:30.065 No connection to sync server. 12:01:30.043 No connection to sync server. 12:02:30.063 No connection to sync server. 12:03:30.119 No connection to sync server. 12:04:30.059 No connection to sync server. 12:05:30.078 No connection to sync server. 12:06:30.139 No connection to sync server. 12:07:30.081 No connection to sync server. 12:08:30.115 No connection to sync server. 12:09:30.116 No connection to sync server. 12:10:30.146 No connection to sync server. 12:11:30.139 No connection to sync server. 12:12:30.127 No connection to sync server. 12:13:30.186 No connection to sync server. 12:14:30.137 No connection to sync server. 12:15:30.151 No connection to sync server. 12:16:30.177 No connection to sync server. 12:17:29.138 200 GET /api/notes/UEJb9PciLqLR with 1495 bytes took 1ms 12:17:29.138 200 GET /api/note-map/UEJb9PciLqLR/backlink-count with 11 bytes took 0ms 12:17:29.166 204 PUT /api/options with 0 bytes took 1ms 12:17:29.173 200 GET /api/notes/7gowcTMU7GTT with 433 bytes took 0ms 12:17:30.169 No connection to sync server. 12:17:31.693 200 GET /api/notes/7gowcTMU7GTT with 433 bytes took 1ms 12:17:31.693 200 GET /api/note-map/7gowcTMU7GTT/backlink-count with 11 bytes took 0ms 12:17:31.708 204 PUT /api/options with 0 bytes took 0ms 12:17:31.721 204 PUT /api/branches/DXhpkDTF4Bh1_UEJb9PciLqLR/expanded/1 with 0 bytes took 0ms 12:17:36.681 200 GET /api/notes/026AiA8neuOl with 443 bytes took 1ms 12:17:36.681 200 GET /api/note-map/026AiA8neuOl/backlink-count with 11 bytes took 0ms 12:17:36.694 204 PUT /api/options with 0 bytes took 0ms

Frontend Logs: Cannot find action 'switchToMobileVersion' keyboard_actions.js:54 Cannot find action 'switchToDesktopVersion' keyboard_actions.js:54 Cannot find action 'showLaunchBarSubtree' keyboard_actions.js:54 Cannot find action 'showShareSubtree' keyboard_actions.js:54 Cannot find action 'showSQLConsoleHistory' keyboard_actions.js:54 Cannot find action 'showSearchHistory' keyboard_actions.js:54 Cannot find action 'showHiddenSubtree' keyboard_actions.js:54 Cannot find action 'downloadLatestVersion' keyboard_actions.js:54 Cannot find action 'logout' ws.js:202 12:33:52 Connected to server ws://127.0.0.1:XXXX/ with WebSocket tree.js:78 12:35:05 Did not find parent root (Trilium Life) for child _backendLog (Backend Log), available parents: _hidden (Hidden Notes). You can ignore this message as it is mostly harmless. 2tree.js:78 12:38:49 Did not find parent root (Trilium Life) for child _options (Options), available parents: _hidden (Hidden Notes). You can ignore this message as it is mostly harmless. jquery.fancytree-all-deps.min.js:1 FancytreeNode@YHj4pCLw84Lf[title='Options'] nodeSetExpanded: UL.style.display already set d @ jquery.fancytree-all-deps.min.js:1 tree.js:78 12:38:53 Did not find parent root (Trilium Life) for child _options (Options), available parents: _hidden (Hidden Notes). You can ignore this message as it is mostly harmless. app_context.js:108 Unhandled command showNoteRevisions, converting to event. 2tree.js:78 12:40:11 Did not find parent root (Trilium Life) for child _options (Options), available parents: _hidden (Hidden Notes). You can ignore this message as it is mostly harmless. 2tree.js:78 12:40:18 Did not find parent root (Trilium Life) for child _options (Options), available parents: _hidden (Hidden Notes). You can ignore this message as it is mostly harmless. tree.js:78 12:42:00 Did not find parent root (Trilium Life) for child _options (Options), available parents: _hidden (Hidden Notes). You can ignore this message as it is mostly harmless. tree.js:78 12:42:07 Did not find parent root (Trilium Life) for child _options (Options), available parents: _hidden (Hidden Notes). You can ignore this message as it is mostly harmless. tree.js:78 12:42:12 Did not find parent root (Trilium Life) for child _options (Options), available parents: _hidden (Hidden Notes). You can ignore this message as it is mostly harmless. 2jquery.fancytree-all-deps.min.js:1 FancytreeNode@UlIYIYCK7ydR[title='Dynatrace Product'] scrollIntoView(): node is invisible. tree.js:78 12:46:02 Did not find parent root (Trilium Life) for child UEJb9PciLqLR (FICO Information), available parents: DXhpkDTF4Bh1 (Dynatrace). You can ignore this message as it is mostly harmless. tree.js:78 12:46:13 Did not find parent root (Trilium Life) for child UEJb9PciLqLR (FICO Information), available parents: DXhpkDTF4Bh1 (Dynatrace). You can ignore this message as it is mostly harmless. tree.js:78 12:46:19 Did not find parent root (Trilium Life) for child UEJb9PciLqLR (FICO Information), available parents: DXhpkDTF4Bh1 (Dynatrace). You can ignore this message as it is mostly harmless. app_context.js:108 Unhandled command showNoteRevisions, converting to event. app_context.js:108 Unhandled command openAboutDialog, converting to event. toast.js:58 12:56:31 message: Auto collapsing notes after inactivity... tree.js:78 12:56:49 Did not find parent root (Trilium Life) for child UEJb9PciLqLR (FICO Information), available parents: DXhpkDTF4Bh1 (Dynatrace). You can ignore this message as it is mostly harmless. app_context.js:108 Unhandled command openAboutDialog, converting to event. ws.js:211 13:06:43 Lost websocket connection to the backend. If you keep having this issue repeatedly, you might want to check your reverse proxy (nginx, apache) configuration and allow/unblock WebSocket. toast.js:58 13:06:50 message: Auto collapsing notes after inactivity... DevTools failed to load source map: Could not load content for http://127.0.0.1:XXXX/assets/v0.58.8/libraries/bootstrap/js/bootstrap.bundle.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load source map: Could not load content for http://127.0.0.1:XXXX/assets/v0.58.8/libraries/fancytree/jquery.fancytree-all-deps.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load source map: Could not load content for http://127.0.0.1:XXXX/assets/v0.58.8/libraries/split.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load source map: Could not load content for http://127.0.0.1:XXXX/libraries/ckeditor/ckeditor.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load source map: Could not load content for http://127.0.0.1:XXXX/assets/v0.58.8/libraries/bootstrap/css/bootstrap.min.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

XXXJetfireXXX commented 1 year ago

Seems like the Hidden Notes plugin is being used here. afaik it is currently bugged, try removing it and see if it works. Try that first.

Are there any backups in the trilium data folder? The log kinda looks like it still tries to sync but it can't, since the server was disabled. Could it be that you left the server adress here? image If so, maybe you should try removing it? After that, move the document file somewhere else and replace it with the copy of the latest backup. That's what comes to my mind.

Nriver commented 1 year ago

There is a daily backup by default. You can find it in the data directory.

akaep commented 1 year ago

Seems like the Hidden Notes plugin is being used here. afaik it is currently bugged, try removing it and see if it works. Try that first.

Are there any backups in the trilium data folder? The log kinda looks like it still tries to sync but it can't, since the server was disabled. Could it be that you left the server adress here? image If so, maybe you should try removing it? After that, move the document file somewhere else and replace it with the copy of the latest backup. That's what comes to my mind.

Thanks, you're right, the address was still in there. I've removed it now, but the notes haven't come back. Unsure of what the Hidden Notes thing is - I haven't installed any plugins and I can't find any way to adjust Hidden Notes in the settings. I've restored to yesterday's backup, which got my about 20% of the data back, but I'm assuming the rest is toast.

XXXJetfireXXX commented 1 year ago

Oh, I mush have mistaken your logs with the logs of that plugin. That situation is... peculiar, to say the least.

akaep commented 1 year ago

Unfortunate, really like Trilium, but can't continue using it regularly if I may lose notes at random without any ability to recover.

zadam commented 1 year ago

That's very unfortunate. It kind of sounds like #3584 because there don't seem to be any updates triggered from the frontend to the backend - the CKEditor component silently crashes and the recovery from this crashed state was buggy. If that was the case, then you had a bad luck, since the version you used - 0.58.8 was the last one affected. The CKEditor crash recovery should now work in 0.59.X.

akaep commented 1 year ago

Bummer. Working on migrating to Linux right now and will likely spin up the server in Docker to get a little bit more protection. Thanks for looking into it.